Documentation ¶
Index ¶
- type Route
- type Servers
- type Slashquery
- func (sq *Slashquery) Balancer(name, network, port string) (net.Conn, error)
- func (sq *Slashquery) Debug() bool
- func (sq *Slashquery) Proxy(r string) *httputil.ReverseProxy
- func (sq *Slashquery) ResolveUpstream(upstream string)
- func (sq *Slashquery) ResolveUpstreams()
- func (sq *Slashquery) Setup() error
- type Upstream
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Route ¶
type Route struct { // URL of the upstream, if set, Scheme, Host, Path and Upstream // will be set from it, the upstream will named has the host // after parsing the URL URL string // Scheme http or https Scheme string // Host hostname to use when doing the request Host string // Path to use when doing the request Path string // Upstream identifier to use Upstream string // Methods list of allowed methods, example: GET, POST, HEAD Methods []string // Plugins list of plugins to use (middleware) Plugins []string // Insecure is set to yes will skip the certificate verification Insecure bool // DisableKeepAlive if set to yes won't cache/reuse the connections DisableKeepAlive bool // contains filtered or unexported fields }
Route define an upstream
type Servers ¶
type Servers struct { Addresses []string Expire time.Time // contains filtered or unexported fields }
Servers keep IP's from upstreams (needs a resolver)
type Slashquery ¶
type Slashquery struct { Config map[string]string Plugins map[string][]string Resolver *resolver.Resolver Routes map[string]*Route Servers map[string]*Servers Upstreams map[string]*Upstream }
Slashquery structure
func (*Slashquery) Balancer ¶
func (sq *Slashquery) Balancer(name, network, port string) (net.Conn, error)
Balancer round-robin the upstreams
func (*Slashquery) Debug ¶
func (sq *Slashquery) Debug() bool
Debug enable/disable based on config["debug"] value
func (*Slashquery) Proxy ¶
func (sq *Slashquery) Proxy(r string) *httputil.ReverseProxy
Proxy return instances of httputil.ReverseProxy
func (*Slashquery) ResolveUpstream ¶
func (sq *Slashquery) ResolveUpstream(upstream string)
ResolveUpstream get IP's for specified upstream
func (*Slashquery) ResolveUpstreams ¶
func (sq *Slashquery) ResolveUpstreams()
ResolveUpstreams get IP's of servers
Source Files ¶
Click to show internal directories.
Click to hide internal directories.