config

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: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MaxRoutingHops = 128

Functions

This section is empty.

Types

type Config

type Config struct {
	sync.RWMutex
	MatcherFactory *routing.MatcherFactory
	Pools          map[string]*backend.Pool
	Rules          map[string]*routing.Rule
	Tries          map[string]*routing.Trie
	Ports          map[uint16]*routing.Trie
}

func NewConfig

func NewConfig(matcherFactory *routing.MatcherFactory) *Config

func (*Config) AddPool

func (c *Config) AddPool(pool Pool)

func (*Config) AddPort

func (c *Config) AddPort(port Port)

func (*Config) AddRule

func (c *Config) AddRule(rule Rule)

func (*Config) AddTrie

func (c *Config) AddTrie(trie Trie)

func (*Config) ConstructPool

func (c *Config) ConstructPool(pool Pool) *backend.Pool

func (*Config) ConstructPoolConfig

func (c *Config) ConstructPoolConfig(pool Pool) backend.PoolConfig

func (*Config) ConstructRule

func (c *Config) ConstructRule(rule Rule) *routing.Rule

func (*Config) ConstructServer

func (c *Config) ConstructServer(host Host) *backend.Server

func (*Config) ConstructTrie

func (c *Config) ConstructTrie(trie Trie) *routing.Trie

func (*Config) DelPool

func (c *Config) DelPool(name string)

func (*Config) DelPort

func (c *Config) DelPort(num uint16)

func (*Config) DelRule

func (c *Config) DelRule(name string)

func (*Config) DelTrie

func (c *Config) DelTrie(name string)

func (*Config) PrintRouting

func (c *Config) PrintRouting(port uint16, r *http.Request) string

This leaks the abstractions of routing.Trie.Walk() and config.Route() and is strictly a debugging aid.

func (*Config) RoutePort

func (c *Config) RoutePort(port uint16, r *http.Request) *backend.Pool

func (*Config) RouteTrie

func (c *Config) RouteTrie(trie *routing.Trie, r *http.Request) *backend.Pool

func (*Config) StatusZJSON

func (c *Config) StatusZJSON() (string, error)

func (*Config) UpdatePool

func (c *Config) UpdatePool(pool Pool)

func (*Config) UpdatePort

func (c *Config) UpdatePort(port Port)

func (*Config) UpdateRule

func (c *Config) UpdateRule(rule Rule)

func (*Config) UpdateTrie

func (c *Config) UpdateTrie(trie Trie)

type Host

type Host struct {
	Address string
}

func (Host) Equals

func (h Host) Equals(o Host) bool

func (Host) String

func (h Host) String() string

func (Host) StringIndent

func (h Host) StringIndent(i string) (str string)

type Pool

type Pool struct {
	Name     string
	Internal bool
	Hosts    map[string]Host
	Config   PoolConfig
}

func (Pool) Equals

func (p Pool) Equals(o Pool) bool

func (Pool) String

func (p Pool) String() string

func (Pool) StringIndent

func (p Pool) StringIndent(i string) (str string)

type PoolConfig

type PoolConfig struct {
	HealthzEvery   string
	HealthzTimeout string
	RequestTimeout string
	Status         string
}

func (PoolConfig) Equals

func (p PoolConfig) Equals(o PoolConfig) bool

func (PoolConfig) String

func (p PoolConfig) String() string

func (PoolConfig) StringIndent

func (p PoolConfig) StringIndent(i string) (str string)

type Port

type Port struct {
	Port     uint16
	Trie     string
	Internal bool
}

func (Port) Equals

func (p Port) Equals(o Port) bool

func (*Port) String

func (p *Port) String() string

func (Port) StringIndent

func (p Port) StringIndent(i string) (str string)

type Rule

type Rule struct {
	Name     string
	Type     string
	Value    string
	Next     string
	Pool     string
	Internal bool
}

func (Rule) Equals

func (r Rule) Equals(o Rule) bool

func (Rule) String

func (r Rule) String() string

func (Rule) StringIndent

func (r Rule) StringIndent(i string) (str string)

type StatusZ

type StatusZ struct {
	Pool             string `json:"pool"`
	Server           string `json:"server"`
	RequestsInFlight uint32 `json:"requests_in_flight"`
	RequestsServiced uint64 `json:"requests_serviced"`
	Status           string `json:"status"`
	StatusChanged    string `json:"status_changed"`
}

Serialization expected by the javascript which displays status information, and also by services polling /statusz to monitor health of routers and pools.

type Trie

type Trie struct {
	Name     string
	Rules    []string
	Internal bool
}

func (Trie) Equals

func (t Trie) Equals(o Trie) bool

func (*Trie) String

func (t *Trie) String() string

func (Trie) StringIndent

func (t Trie) StringIndent(i string) (str string)

Jump to

Keyboard shortcuts

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