Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AllowDenyList ¶
type AllowDenyList struct {
// contains filtered or unexported fields
}
AllowDenyList encapsulates the logic needed to filter based on a string.
func New ¶
func New(allow, deny map[string]struct{}) (*AllowDenyList, error)
New constructs a new AllowDenyList based on a allow- and a denylist. Only one of them can be not empty.
func (*AllowDenyList) Exclude ¶
func (l *AllowDenyList) Exclude(items []string)
Exclude excludes the given items from the list.
func (*AllowDenyList) Include ¶
func (l *AllowDenyList) Include(items []string)
Include includes the given items in the list.
func (*AllowDenyList) IsExcluded ¶
func (l *AllowDenyList) IsExcluded(item string) bool
IsExcluded returns if the given item is excluded.
func (*AllowDenyList) IsIncluded ¶
func (l *AllowDenyList) IsIncluded(item string) bool
IsIncluded returns if the given item is included.
func (*AllowDenyList) Parse ¶
func (l *AllowDenyList) Parse() error
Parse parses and compiles all of the regexes in the allowDenyList.
func (*AllowDenyList) Status ¶
func (l *AllowDenyList) Status() string
Status returns the status of the AllowDenyList that can e.g. be passed into a logger.
Click to show internal directories.
Click to hide internal directories.