Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendReplace ¶
AppendReplace replaces srcFilter prefix with dstFilter prefix at s, appends the result to dst and returns it.
func IsWildcardFilter ¶
IsWildcardFilter returns true if the filter ends with '*', e.g. it matches any string containing the prefix in front of '*'.
func MatchFilter ¶
MatchFilter returns true if s matches filter.
func MatchFilters ¶
MatchFilters returns true if s matches any filter from filters.
Types ¶
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
Filter allow filtering by full strings and by prefixes ending with '*'.
func GetFilter ¶
func GetFilter() *Filter
GetFilter returns Filter from the pool.
Return the filter to the pool via PutFilter when it is no longer needed.
func (*Filter) AddAllowFilter ¶
AddAllowFilter adds the given filter to allowlist at f.
The filter may end with '*'. In this case it matches all the strings starting with the prefix before '*'.
func (*Filter) AddAllowFilters ¶
AddAllowFilters adds the given filters to allowlist at f.
Every filter may end with '*'. In this case it matches all the strings starting with the prefix before '*'.
func (*Filter) AddDenyFilter ¶
AddDenyFilter adds the the given filter to denylist at f.
Every filter may end with '*'. In this case it stops matching all the strings starting with the prefix before '*'.
func (*Filter) AddDenyFilters ¶
AddDenyFilters adds the given filters to denylist at f.
Every filter may end with '*'. In this case it stops matching all the strings starting with the prefix before '*'.
func (*Filter) MatchString ¶
MatchString returns true if s matches f.