feat(aa): add missing methods for the Link struct.

This commit is contained in:
Alexandre Pujol 2024-06-29 22:52:31 +01:00
parent 8377dde5d2
commit 7c5ba70b40
No known key found for this signature in database
GPG Key ID: C5469996F0DF68EC

View File

@ -284,3 +284,21 @@ func (r *Link) Compare(other Rule) int {
func (r *Link) Merge(other Rule) bool { func (r *Link) Merge(other Rule) bool {
return false // Never merge link return false // Never merge link
} }
func (r *Link) Lengths() []int {
return []int{
r.Qualifier.getLenAudit(),
r.Qualifier.getLenAccess(),
length("owner", r.Owner),
length("subset", r.Subset),
length("", r.Path),
length("", r.Target),
}
}
func (r *Link) setPaddings(max []int) {
r.Paddings = append(r.Qualifier.setPaddings(max[:2]), setPaddings(
max[2:], []string{"owner", "subset", "", ""},
[]any{r.Owner, r.Subset, r.Path, r.Target})...,
)
}