rule

package
v0.6.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrURLMissing          = errors.New("url property not present")
	ErrURLType             = errors.New("bad url type")
	ErrStrategyType        = errors.New("bad strategy type")
	ErrUnsupportedStrategy = errors.New("unsupported strategy")
)

Functions

func DecodeConfig

func DecodeConfig(input any, output any) error

Types

type Configuration

type Configuration struct {
	ID           string                   `json:"id" yaml:"id"`
	RuleMatcher  Matcher                  `json:"match" yaml:"match"`
	Upstream     string                   `json:"upstream" yaml:"upstream"`
	Methods      []string                 `json:"methods" yaml:"methods"`
	Execute      []config.MechanismConfig `json:"execute" yaml:"execute"`
	ErrorHandler []config.MechanismConfig `json:"on_error" yaml:"on_error"`
}

func (*Configuration) DeepCopy

func (in *Configuration) DeepCopy() *Configuration

func (*Configuration) DeepCopyInto

func (in *Configuration) DeepCopyInto(out *Configuration)

type Matcher

type Matcher struct {
	URL      string `json:"url" yaml:"url"`
	Strategy string `json:"strategy" yaml:"strategy"`
}

func (*Matcher) UnmarshalJSON

func (m *Matcher) UnmarshalJSON(data []byte) error

type Rule

type Rule interface {
	ID() string
	SrcID() string
	Execute(heimdall.Context) (*url.URL, error)
	MatchesURL(*url.URL) bool
	MatchesMethod(string) bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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