mirror of
https://github.com/daeuniverse/dae.git
synced 2025-01-05 13:08:57 +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) {
|
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
|
// Example
|
||||||
// filter: name(regex:'^.*hk.*$', keyword:'sg') && name(keyword:'disney')
|
// filter: name(regex:'^.*hk.*$', keyword:'sg') && name(keyword:'disney')
|
||||||
// filter: !name(regex: 'HK|TW|SG') && name(keyword: disney)
|
// filter: !name(regex: 'HK|TW|SG') && name(keyword: disney)
|
||||||
|
@ -32,7 +32,7 @@ type Group struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type GroupParam struct {
|
type GroupParam struct {
|
||||||
Filter []*config_parser.Function `mapstructure:"filter" required:""`
|
Filter []*config_parser.Function `mapstructure:"filter"`
|
||||||
Policy interface{} `mapstructure:"policy" required:""`
|
Policy interface{} `mapstructure:"policy" required:""`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user