feat(aa): add a string method to all rule struct.
This commit is contained in:
parent
e9fa0660f8
commit
5483668574
20 changed files with 337 additions and 34 deletions
|
|
@ -8,6 +8,13 @@ import (
|
|||
"slices"
|
||||
"strings"
|
||||
)
|
||||
|
||||
const (
|
||||
tokMOUNT = "mount"
|
||||
tokREMOUNT = "remount"
|
||||
tokUMOUNT = "umount"
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
type MountConditions struct {
|
||||
|
|
@ -75,6 +82,10 @@ func (r *Mount) Equals(other any) bool {
|
|||
r.Qualifier.Equals(o.Qualifier)
|
||||
}
|
||||
|
||||
func (r *Mount) String() string {
|
||||
return renderTemplate(tokMOUNT, r)
|
||||
}
|
||||
|
||||
type Umount struct {
|
||||
RuleBase
|
||||
Qualifier
|
||||
|
|
@ -109,6 +120,10 @@ func (r *Umount) Equals(other any) bool {
|
|||
r.Qualifier.Equals(o.Qualifier)
|
||||
}
|
||||
|
||||
func (r *Umount) String() string {
|
||||
return renderTemplate(tokUMOUNT, r)
|
||||
}
|
||||
|
||||
type Remount struct {
|
||||
RuleBase
|
||||
Qualifier
|
||||
|
|
@ -142,3 +157,7 @@ func (r *Remount) Equals(other any) bool {
|
|||
r.MountConditions.Equals(o.MountConditions) &&
|
||||
r.Qualifier.Equals(o.Qualifier)
|
||||
}
|
||||
|
||||
func (r *Remount) String() string {
|
||||
return renderTemplate(tokREMOUNT, r)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue