Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HostHeader ¶ added in v1.3.0
type HostHeader struct { Behavior HostHeaderBehavior Override string }
type HostHeaderBehavior ¶ added in v1.3.0
type HostHeaderBehavior int
const ( HostHeaderDefault HostHeaderBehavior = iota HostHeaderOriginal HostHeaderOverride HostHeaderDestination )
type Router ¶
Router is the meat of rrrouter
type Rule ¶
type Rule struct {
// contains filtered or unexported fields
}
Rule describes a single forwarding rule
type RuleMatchResults ¶
type RuleMatchResults struct {
// contains filtered or unexported fields
}
RuleMatchResults represents a possible matching rule
func (*RuleMatchResults) String ¶
func (res *RuleMatchResults) String() string
type RuleSource ¶
type RuleSource struct { Methods []string `json:"methods"` Pattern string `json:"pattern"` Destination string `json:"destination"` Internal bool `json:"internal"` Type *string `json:"type"` HostHeader string `json:"hostheader"` Recompression bool `json:"recompression"` }
RuleSource is a source of rules, e.g. a JSON file
type Rules ¶
type Rules struct {
// contains filtered or unexported fields
}
Rules is a list of rules... and a logger?
func NewRules ¶
func NewRules(ruleSources []RuleSource, logger *apexlog.Logger) (*Rules, error)
NewRules builds a new rules list
func ParseRules ¶
ParseRules parses a YAML or JSON byte slice into a list of rules
func (*Rules) Match ¶
func (rs *Rules) Match(s string, method string) (*RuleMatchResults, error)
Match matches the path and method against the Rules list and returns RuleMatchResults
Click to show internal directories.
Click to hide internal directories.