Fix constraints and add doc
This commit is contained in:
parent
89fc835bb2
commit
a882a9d79f
4 changed files with 89 additions and 44 deletions
|
@ -139,6 +139,13 @@ func (c *Constraint) String() string {
|
|||
return c.Key + "!=" + c.Regex
|
||||
}
|
||||
|
||||
// UnmarshalText define how unmarshal in TOML parsing
|
||||
func (c *Constraint) UnmarshalText(text []byte) error {
|
||||
constraint, err := NewConstraint(string(text))
|
||||
*c = *constraint
|
||||
return err
|
||||
}
|
||||
|
||||
// MatchConstraintWithAtLeastOneTag tests a constraint for one single service
|
||||
func (c *Constraint) MatchConstraintWithAtLeastOneTag(tags []string) bool {
|
||||
for _, tag := range tags {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue