chore(aa): minor cosmetic of the rule interface.

This commit is contained in:
Alexandre Pujol 2024-06-27 18:45:32 +01:00
parent 86b2f74a24
commit 191c72fcb6
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC
20 changed files with 62 additions and 62 deletions

View file

@ -13,12 +13,12 @@ import (
type requirement map[string][]string
type constraint uint
type Constraint uint
const (
anyKind constraint = iota // The rule can be found in either preamble or profile
preambleKind // The rule can only be found in the preamble
blockKind // The rule can only be found in a profile
AnyRule Constraint = iota // The rule can be found in either preamble or profile
PreambleRule // The rule can only be found in the preamble
BlockRule // The rule can only be found in a profile
)
// Kind represents an AppArmor rule kind.
@ -37,12 +37,12 @@ func (k Kind) Tok() string {
// Rule generic interface for all AppArmor rules
type Rule interface {
Kind() Kind
Constraint() constraint
String() string
Validate() error
Compare(other Rule) int
Merge(other Rule) bool
Kind() Kind // Kind of the rule
Constraint() Constraint // Where the rule can be found (preamble, profile, any)
String() string // Render the rule as a string
Validate() error // Validate the rule. Return an error if the rule is invalid
Compare(other Rule) int // Compare two rules. Return 0 if they are identical
Merge(other Rule) bool // Merge rules of same kind together. Return true if merged
}
type Rules []Rule