mirror of
https://github.com/daeuniverse/dae.git
synced 2025-01-03 13:31:00 +07:00
feat: support no group filter
This commit is contained in:
parent
a10a8fd643
commit
448debd620
@ -51,6 +51,11 @@ func NewDialerSetFromLinks(option *dialer.GlobalOption, tagToNodeList map[string
|
||||
}
|
||||
|
||||
func (s *DialerSet) filterHit(dialer *dialer.Dialer, filters []*config_parser.Function) (hit bool, err error) {
|
||||
if len(filters) == 0 {
|
||||
// No filter.
|
||||
return true, nil
|
||||
}
|
||||
|
||||
// Example
|
||||
// filter: name(regex:'^.*hk.*$', keyword:'sg') && name(keyword:'disney')
|
||||
// filter: !name(regex: 'HK|TW|SG') && name(keyword: disney)
|
||||
|
@ -32,7 +32,7 @@ type Group struct {
|
||||
}
|
||||
|
||||
type GroupParam struct {
|
||||
Filter []*config_parser.Function `mapstructure:"filter" required:""`
|
||||
Filter []*config_parser.Function `mapstructure:"filter"`
|
||||
Policy interface{} `mapstructure:"policy" required:""`
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user