filter

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeReason    = "reason"
	TypeNamespace = "namespace"
	TypeJSONPath  = "jsonpath"
	TypeLabel     = "labels"
	TypeAny       = "any"
)

Variables

This section is empty.

Functions

func ApplyFilter

func ApplyFilter(f Filter, obj interface{}) (bool, error)

func IsFiltersMatched

func IsFiltersMatched(service Service, requiredFilters []string, data interface{}, logger logger.Logger) bool

IsFiltersMatched Go over all filters and apply each one on on data Return true is the data matched to all the filters

Types

type Factory added in v0.0.5

type Factory interface {
	Build(map[string]interface{}, Service, kube.Kube) (Filter, error)
}

Factory interface builds filters

func NewFactory added in v0.0.5

func NewFactory(logger logger.Logger) Factory

NewFactory create new factory

type Filter

type Filter interface {
	GetName() string
	Apply(interface{}) (bool, error)
	GetType() string
}

type Service

type Service interface {
	GetFilterByName(string) (Filter, error)
}

Service is the service of the filter package

func NewService

func NewService(factory Factory, filterArray []map[string]interface{}, k kube.Kube, logger logger.Logger) Service

NewService - creates net Dal from json array of filters

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳