routing

package
v0.0.0-...-1f713e5 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HeaderMatcher

type HeaderMatcher struct {
	Header     string
	Value      string
	ParseError bool
}

func (*HeaderMatcher) Match

func (h *HeaderMatcher) Match(r *http.Request) bool

type HostMatcher

type HostMatcher struct {
	Host string
}

func (*HostMatcher) Match

func (h *HostMatcher) Match(r *http.Request) bool

type Matcher

type Matcher interface {
	Match(r *http.Request) bool
}

func NewHeaderMatcher

func NewHeaderMatcher(r string) Matcher

func NewHostMatcher

func NewHostMatcher(r string) Matcher

func NewMultiHostMatcher

func NewMultiHostMatcher(r string) Matcher

func NewPathPrefixMatcher

func NewPathPrefixMatcher(prefix string) Matcher

func NewPathRegexpMatcher

func NewPathRegexpMatcher(data string) Matcher

func NewPathSuffixMatcher

func NewPathSuffixMatcher(suffix string) Matcher

func NewPercentMatcher

func NewPercentMatcher(data string) Matcher

func NewQueryParamValueMatcher

func NewQueryParamValueMatcher(r string) Matcher

func NewQueryRawRegexpMatcher

func NewQueryRawRegexpMatcher(data string) Matcher

func NewStaticMatcher

func NewStaticMatcher(data string) Matcher

type MatcherFactory

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

func DefaultMatcherFactory

func DefaultMatcherFactory() *MatcherFactory

func NewMatcherFactory

func NewMatcherFactory() *MatcherFactory

func (*MatcherFactory) Make

func (f *MatcherFactory) Make(kind, value string) (Matcher, error)

func (*MatcherFactory) Register

func (f *MatcherFactory) Register(kind string, maker matcherMaker)

type MultiHostMatcher

type MultiHostMatcher struct {
	Hosts []string
}

func (*MultiHostMatcher) Match

func (m *MultiHostMatcher) Match(r *http.Request) bool

type PathPrefixMatcher

type PathPrefixMatcher struct {
	Prefix string
}

func (*PathPrefixMatcher) Match

func (p *PathPrefixMatcher) Match(r *http.Request) bool

type PathRegexpMatcher

type PathRegexpMatcher struct {
	Regexp     *regexp.Regexp
	ParseError bool
}

func (*PathRegexpMatcher) Match

func (p *PathRegexpMatcher) Match(r *http.Request) bool

type PathSuffixMatcher

type PathSuffixMatcher struct {
	Suffix string
}

func (*PathSuffixMatcher) Match

func (p *PathSuffixMatcher) Match(r *http.Request) bool

type PercentMatcher

type PercentMatcher struct {
	Fraction   float64
	ParseError bool
}

func (*PercentMatcher) Match

func (p *PercentMatcher) Match(r *http.Request) bool

type QueryParamValueMatcher

type QueryParamValueMatcher struct {
	Param      string
	Value      string
	ParseError bool
}

func (*QueryParamValueMatcher) Match

func (p *QueryParamValueMatcher) Match(r *http.Request) bool

type QueryRawRegexpMatcher

type QueryRawRegexpMatcher struct {
	Regexp     *regexp.Regexp
	ParseError bool
}

func (*QueryRawRegexpMatcher) Match

func (p *QueryRawRegexpMatcher) Match(r *http.Request) bool

type Rule

type Rule struct {
	Name    string
	Dummy   bool
	Matcher Matcher
	Next    string
	NextPtr *Trie
	Pool    string
	PoolPtr *backend.Pool
}

func DummyRule

func DummyRule(name string) *Rule

func NewRule

func NewRule(name string, matcher Matcher, next *Trie, pool *backend.Pool) *Rule

type StaticMatcher

type StaticMatcher struct {
	Val        bool
	ParseError bool
}

func (*StaticMatcher) Match

func (s *StaticMatcher) Match(r *http.Request) bool

type Trie

type Trie struct {
	Name  string
	Dummy bool
	List  []*Rule
}

func DummyTrie

func DummyTrie(name string) *Trie

func NewTrie

func NewTrie(name string, list []*Rule) *Trie

func (*Trie) UpdateRule

func (t *Trie) UpdateRule(update *Rule)

func (*Trie) Walk

func (t *Trie) Walk(r *http.Request) (*backend.Pool, *Trie)

Jump to

Keyboard shortcuts

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