proxy

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

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

type Router interface {
	RouteRequest(*http.Request) (*requestResult, error)
}

Router is the meat of rrrouter

func NewRouter

func NewRouter(rules *Rules, logger *apexlog.Logger, conf *config.Config) Router

NewRouter creates a new router with given Rules

func NewRouterWithPerformer

func NewRouterWithPerformer(rules *Rules, logger *apexlog.Logger, conf *config.Config, performer requestPerformer) Router

NewRouterWithPerformer is NewRouter with a specific requestPerformer

type Rule

type Rule struct {
	// contains filtered or unexported fields
}

Rule describes a single forwarding rule

func NewRule

func NewRule(pattern, destination string, internal bool, methods map[string]bool, ruleType ruleType, hostHeader HostHeader, recompression bool) (*Rule, error)

NewRule builds a new Rule

func (*Rule) String

func (r *Rule) String() string

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

func ParseRules(rcfg []byte, logger *apexlog.Logger) (*Rules, error)

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

func (*Rules) RuleList

func (rs *Rules) RuleList() []Rule

RuleList makes a rule list from the Rules rule list

func (*Rules) String

func (rs *Rules) String() string

Jump to

Keyboard shortcuts

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