allowdenylist

package
v2.0.0-beta.0...-3bc1883 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 24, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL