Documentation ¶
Index ¶
Constants ¶
View Source
const CurrentRuleSetVersion = "1alpha2"
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 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"` RuleMatcher Matcher `json:"match" yaml:"match"` UpstreamURLFactory *UpstreamURLFactory `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" yaml:"rules"` }
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)
type UpstreamURLFactory ¶
type UpstreamURLFactory struct { Host string `json:"host" yaml:"host"` URLRewriter *URLRewriter `json:"rewrite" yaml:"rewrite"` }
func (*UpstreamURLFactory) CreateURL ¶
func (f *UpstreamURLFactory) CreateURL(value *url.URL) *url.URL
func (*UpstreamURLFactory) DeepCopyInto ¶
func (f *UpstreamURLFactory) DeepCopyInto(out *UpstreamURLFactory)
Click to show internal directories.
Click to hide internal directories.