21 lines
406 B
Go
21 lines
406 B
Go
package policy
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"git.sad.ovh/sophie/nuke/internal"
|
|
"git.sad.ovh/sophie/nuke/lib/config"
|
|
"git.sad.ovh/sophie/nuke/lib/policy/checker"
|
|
)
|
|
|
|
type Bot struct {
|
|
Rules checker.Impl
|
|
Challenge *config.ChallengeRules
|
|
Weight *config.Weight
|
|
Name string
|
|
Action config.Rule
|
|
}
|
|
|
|
func (b Bot) Hash() string {
|
|
return internal.FastHash(fmt.Sprintf("%s::%s", b.Name, b.Rules.Hash()))
|
|
}
|