matchers

package
v0.0.0-...-ebc7474 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IMatcher

type IMatcher interface {
	Match(ctx context.Context, record shared.Record) (bool, error)
	Name() string
	String() string
}

type Matcher

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

func NewMatcher

func NewMatcher(name string, setters ...MatcherOption) Matcher

func (*Matcher) Match

func (m *Matcher) Match(ctx context.Context, record shared.Record) (bool, error)

func (*Matcher) Name

func (m *Matcher) Name() string

func (*Matcher) String

func (m *Matcher) String() string

type MatcherConstructor

type MatcherConstructor func(config map[string]string) (IMatcher, error)

type MatcherError

type MatcherError struct {
	Message string
}

MatcherError custom error for Matcher

func (*MatcherError) Error

func (e *MatcherError) Error() string

type MatcherOption

type MatcherOption func(*Matcher)

func Description

func Description(description string) MatcherOption

func Disabled

func Disabled(disabled bool) MatcherOption

func ID

func ID(id string) MatcherOption

func Name

func Name(name string) MatcherOption

type MatcherRepository

type MatcherRepository struct {
	Matchers map[string]IMatcher
	// contains filtered or unexported fields
}

func GetMatcherRepository

func GetMatcherRepository() *MatcherRepository

func NewMatcherRepository

func NewMatcherRepository() MatcherRepository

func (*MatcherRepository) GetMatcher

func (apr *MatcherRepository) GetMatcher(name string) (IMatcher, error)

func (*MatcherRepository) HasMatcher

func (apr *MatcherRepository) HasMatcher(name string) bool

func (*MatcherRepository) LoadMatchers

func (apr *MatcherRepository) LoadMatchers(path string) error

func (*MatcherRepository) RegisterMatcher

func (apr *MatcherRepository) RegisterMatcher(matcher IMatcher) error

Jump to

Keyboard shortcuts

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