matcher

package
v0.6.1-alpha Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeCIDRMatcherHookFunc

func DecodeCIDRMatcherHookFunc() mapstructure.DecodeHookFunc

func DecodeErrorTypeMatcherHookFunc

func DecodeErrorTypeMatcherHookFunc() mapstructure.DecodeHookFunc

Types

type CIDRMatcher

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

func NewCIDRMatcher

func NewCIDRMatcher(cidrs []string) (*CIDRMatcher, error)

func (*CIDRMatcher) Match

func (c *CIDRMatcher) Match(ips ...string) bool

type ErrorConditionMatcher

type ErrorConditionMatcher struct {
	Error   *ErrorMatcher  `mapstructure:"error"`
	CIDR    *CIDRMatcher   `mapstructure:"request_cidr"`
	Headers *HeaderMatcher `mapstructure:"request_headers"`
}

func (ErrorConditionMatcher) Match

func (ecm ErrorConditionMatcher) Match(ctx heimdall.Context, err error) bool

type ErrorDescriptor

type ErrorDescriptor struct {
	Errors    []error
	HandlerID string
}

func (ErrorDescriptor) Matches

func (ed ErrorDescriptor) Matches(err error) bool

type ErrorMatcher

type ErrorMatcher []ErrorDescriptor

func (ErrorMatcher) Match

func (etm ErrorMatcher) Match(err error) bool

type HeaderMatcher

type HeaderMatcher map[string][]string

func (HeaderMatcher) Match

func (hm HeaderMatcher) Match(headers map[string]string) bool

Jump to

Keyboard shortcuts

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