whiteblacklist

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WhiteBlackList

type WhiteBlackList struct {
	// contains filtered or unexported fields
}

WhiteBlackList encapsulates the logic needed to filter based on a string.

func New

func New(w, b map[string]struct{}) (*WhiteBlackList, error)

New constructs a new WhtieBlackList based on a white- and a blacklist. Only one of them can be not empty.

func (*WhiteBlackList) Exclude

func (l *WhiteBlackList) Exclude(items []string)

Exclude excludes the given items from the list.

func (*WhiteBlackList) Include

func (l *WhiteBlackList) Include(items []string)

Include includes the given items in the list.

func (*WhiteBlackList) IsExcluded

func (l *WhiteBlackList) IsExcluded(item string) bool

IsExcluded returns if the given item is excluded.

func (*WhiteBlackList) IsIncluded

func (l *WhiteBlackList) IsIncluded(item string) bool

IsIncluded returns if the given item is included.

func (*WhiteBlackList) Status

func (l *WhiteBlackList) Status() string

Status returns the status of the WhtieBlackList 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