Documentation
¶
Index ¶
- Constants
- Variables
- func DecodeConfig(app app.Context, input any, output any) error
- type Backend
- type EncodedSlashesHandling
- type HostMatcher
- type Matcher
- type MetaData
- type ParameterMatcher
- type PrefixAdder
- type PrefixCutter
- type QueryParamsRemover
- type Route
- type Rule
- type RuleSet
- type URLRewriter
Constants ¶
View Source
const CurrentRuleSetVersion = "1alpha4"
Variables ¶
View Source
var ErrEmptyRuleSet = errors.New("empty rule set")
Functions ¶
Types ¶
type Backend ¶
type Backend struct {
Host string `json:"host" yaml:"host" validate:"required"` //nolint:tagalign,lll
ForwardHostHeader *bool `json:"forward_host_header" yaml:"forward_host_header"`
URLRewriter *URLRewriter `json:"rewrite" yaml:"rewrite" validate:"omitnil"` //nolint:tagalign,lll
}
func (*Backend) DeepCopyInto ¶
func (*Backend) IsInsecure ¶ added in v0.16.0
type EncodedSlashesHandling ¶
type EncodedSlashesHandling string
const ( EncodedSlashesOff EncodedSlashesHandling = "off" EncodedSlashesOn EncodedSlashesHandling = "on" EncodedSlashesOnNoDecode EncodedSlashesHandling = "no_decode" )
type HostMatcher ¶
type Matcher ¶
type Matcher struct {
Routes []Route `json:"routes" yaml:"routes" validate:"required,dive"` //nolint:lll,tagalign
BacktrackingEnabled *bool `json:"backtracking_enabled" yaml:"backtracking_enabled"` //nolint:lll,tagalign
Scheme string `json:"scheme" yaml:"scheme" validate:"omitempty,oneof=http https"` //nolint:lll,tagalign
Methods []string `json:"methods" yaml:"methods" validate:"omitempty,dive,required"` //nolint:lll,tagalign
Hosts []HostMatcher `json:"hosts" yaml:"hosts" validate:"omitempty,dive,required"` //nolint:lll,tagalign
}
func (*Matcher) DeepCopyInto ¶
type ParameterMatcher ¶
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 Route ¶
type Route struct {
Path string `json:"path" yaml:"path" validate:"required"` //nolint:lll,tagalign
PathParams []ParameterMatcher `json:"path_params" yaml:"path_params" validate:"omitempty,dive,required"` //nolint:lll,tagalign
}
func (*Route) DeepCopyInto ¶
type Rule ¶
type Rule struct {
ID string `json:"id" yaml:"id" validate:"required"` //nolint:lll,tagalign
EncodedSlashesHandling EncodedSlashesHandling `json:"allow_encoded_slashes" yaml:"allow_encoded_slashes" validate:"omitempty,oneof=off on no_decode"` //nolint:lll,tagalign
Matcher Matcher `json:"match" yaml:"match" validate:"required"` //nolint:lll,tagalign
Backend *Backend `json:"forward_to" yaml:"forward_to" validate:"omitnil"` //nolint:lll,tagalign
Execute []config.MechanismConfig `json:"execute" yaml:"execute" validate:"gt=0,dive,required"` //nolint:lll,tagalign
ErrorHandler []config.MechanismConfig `json:"on_error" yaml:"on_error"`
}
func (*Rule) DeepCopyInto ¶
type RuleSet ¶
type URLRewriter ¶
type URLRewriter struct {
Scheme string `json:"scheme" yaml:"scheme" validate:"omitempty,enforced=https"` //nolint: lll,tagalign
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) DeepCopyInto ¶ added in v0.16.0
func (r *URLRewriter) DeepCopyInto(out *URLRewriter)
func (*URLRewriter) Rewrite ¶
func (r *URLRewriter) Rewrite(value *url.URL)
Click to show internal directories.
Click to hide internal directories.