filters

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetFilter

func SetFilter(filter Filter)

SetFilter by filter name

Types

type AbstractFilter

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

AbstractFilter abstract component of visitor filter

func (*AbstractFilter) GetName

func (f *AbstractFilter) GetName() string

GetName name of filter

func (*AbstractFilter) Init

func (f *AbstractFilter) Init(name string)

Init filter

func (*AbstractFilter) MatchFilter

func (f *AbstractFilter) MatchFilter(name string) bool

MatchFilter if the name mathes self filter name

type Filter

type Filter interface {
	GetName() string
	Filter(events.Event) (bool, error)
	MatchFilter(name string) bool
}

Filter interface of visitor filter

func GetFilter

func GetFilter(name string) Filter

GetFilter by filter name

func NewValidateFilter

func NewValidateFilter() Filter

NewValidateFilter new validate filter

type FilterOperator

type FilterOperator interface {
	AttachFilter(filter Filter) FiltersResponsibilityChain
	Filter(events.Event) (bool, error)
	InitializeFilters(from string)
}

FilterOperator interface for controller operation

type FiltersChain

type FiltersChain struct {
	AbstractFilter
	// contains filtered or unexported fields
}

FiltersChain responsibility chain of filters

func NewFilterChain

func NewFilterChain(name string) *FiltersChain

NewFilterChain responsibility chain of filters

func (*FiltersChain) AsFilter

func (c *FiltersChain) AsFilter() Filter

AsFilter as filter

func (*FiltersChain) AttachFilter

func (c *FiltersChain) AttachFilter(filter Filter) FiltersResponsibilityChain

AttachFilter on filter responsibility chain

func (*FiltersChain) Filter

func (c *FiltersChain) Filter(event events.Event) (bool, error)

Filter call filter responsibility chain

func (*FiltersChain) GetFilters

func (c *FiltersChain) GetFilters() []Filter

GetFilters of filter responsibility chain

func (*FiltersChain) InitializeFilters

func (c *FiltersChain) InitializeFilters(from string)

InitializeFilters called from controller analyzement on loading

func (*FiltersChain) MatchFilter

func (c *FiltersChain) MatchFilter(name string) bool

MatchFilter if the name mathes self filter chain

type FiltersResponsibilityChain

type FiltersResponsibilityChain interface {
	AttachFilter(filter Filter) FiltersResponsibilityChain
	GetFilters() []Filter
	AsFilter() Filter
	MatchFilter(name string) bool
}

FiltersResponsibilityChain

func GetDefaultFiltersChain

func GetDefaultFiltersChain() FiltersResponsibilityChain

GetDefaultFiltersChain for each controllers default filter

type FiltersStrategy

type FiltersStrategy interface {
	Filters() []Filter
}

FiltersStrategy interface of filters strategy

Jump to

Keyboard shortcuts

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