feat(aa): add initial profile validation structure.
This commit is contained in:
parent
2dd6046697
commit
92641e7e28
20 changed files with 222 additions and 2 deletions
|
|
@ -5,6 +5,7 @@
|
|||
package aa
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"slices"
|
||||
)
|
||||
|
||||
|
|
@ -39,6 +40,13 @@ func newCapabilityFromLog(log map[string]string) Rule {
|
|||
}
|
||||
}
|
||||
|
||||
func (r *Capability) Validate() error {
|
||||
if err := validateValues(r.Kind(), "name", r.Names); err != nil {
|
||||
return fmt.Errorf("%s: %w", r, err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *Capability) Less(other any) bool {
|
||||
o, _ := other.(*Capability)
|
||||
for i := 0; i < len(r.Names) && i < len(o.Names); i++ {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue