Documentation ¶
Index ¶
Constants ¶
View Source
const CurrentRuleSetVersion = "1alpha3"
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") )
View Source
var ErrEmptyRuleSet = errors.New("empty rule set")
Functions ¶
func DecodeConfig ¶
Types ¶
type Backend ¶
type Backend struct { Host string `json:"host" yaml:"host"` URLRewriter *URLRewriter `json:"rewrite" yaml:"rewrite"` }
func (*Backend) DeepCopyInto ¶
type EncodedSlashesHandling ¶
type EncodedSlashesHandling string
const ( EncodedSlashesOff EncodedSlashesHandling = "off" EncodedSlashesOn EncodedSlashesHandling = "on" EncodedSlashesNoDecode EncodedSlashesHandling = "no_decode" )
type Matcher ¶
type Matcher struct { URL string `json:"url" yaml:"url"` Strategy string `json:"strategy" yaml:"strategy"` }
func (*Matcher) UnmarshalJSON ¶
type PrefixAdder ¶
type PrefixAdder string
func (PrefixAdder) AddTo ¶
func (a PrefixAdder) AddTo(value string) string
type PrefixCutter ¶
type PrefixCutter string
func (PrefixCutter) CutFrom ¶
func (c PrefixCutter) CutFrom(value string) string
type QueryParamsRemover ¶
type QueryParamsRemover []string
func (QueryParamsRemover) RemoveFrom ¶
func (r QueryParamsRemover) RemoveFrom(value string) string
type Rule ¶
type Rule struct { ID string `json:"id" yaml:"id"` EncodedSlashesHandling EncodedSlashesHandling `json:"allow_encoded_slashes" yaml:"allow_encoded_slashes" validate:"omitempty,oneof=off on no_decode"` //nolint:lll,tagalign RuleMatcher Matcher `json:"match" yaml:"match"` Backend *Backend `json:"forward_to" yaml:"forward_to"` Methods []string `json:"methods" yaml:"methods"` Execute []config.MechanismConfig `json:"execute" yaml:"execute"` ErrorHandler []config.MechanismConfig `json:"on_error" yaml:"on_error"` }
func (*Rule) DeepCopyInto ¶
type RuleSet ¶
type RuleSet struct { MetaData Version string `json:"version" yaml:"version"` Name string `json:"name" yaml:"name"` Rules []Rule `json:"rules" validate:"dive" yaml:"rules"` }
func ParseRules ¶
func (RuleSet) VerifyPathPrefix ¶
type URLRewriter ¶
type URLRewriter struct { Scheme string `json:"scheme" yaml:"scheme"` PathPrefixToCut PrefixCutter `json:"strip_path_prefix" yaml:"strip_path_prefix"` PathPrefixToAdd PrefixAdder `json:"add_path_prefix" yaml:"add_path_prefix"` QueryParamsToRemove QueryParamsRemover `json:"strip_query_parameters" yaml:"strip_query_parameters"` }
func (*URLRewriter) Rewrite ¶
func (r *URLRewriter) Rewrite(value *url.URL)
Click to show internal directories.
Click to hide internal directories.