1
0
Fork 0
forked from External/ergo

persist and load channel mask lists

This commit is contained in:
Jeremy Latt 2014-03-07 18:14:02 -08:00
parent 04c30c8c9b
commit cf76d2bd77
5 changed files with 61 additions and 11 deletions

View file

@ -219,6 +219,16 @@ func (set *UserMaskSet) Match(userhost string) bool {
return set.regexp.MatchString(userhost)
}
func (set *UserMaskSet) String() string {
masks := make([]string, len(set.masks))
index := 0
for mask := range set.masks {
masks[index] = mask
index += 1
}
return strings.Join(masks, " ")
}
func (set *UserMaskSet) setRegexp() {
if len(set.masks) == 0 {
set.regexp = nil