Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Upstream ¶
type Upstream struct { // The upstream host to connect to Host string // The port on the upstream host Port int // Default 60 seconds Timeout time.Duration // Will ignore https on the incoming request and always upstream http ForceHttp bool // Ping URL Path-only for checking upness PingPath string // Rewrite the Host in the request RewriteHost bool // contains filtered or unexported fields }
func NewUpstream ¶
func (*Upstream) FilterRequest ¶
func (*Upstream) SetPoolSize ¶
Alter the number of connections to multiplex with
type UpstreamEntry ¶
type UpstreamEntryConfig ¶
type UpstreamPool ¶
type UpstreamPool struct { Name string // contains filtered or unexported fields }
An UpstreamPool is a list of upstream servers which are considered functionally equivalent. The pool will round-robin the requests to the servers.
func NewUpstreamPool ¶
func NewUpstreamPool(name string, config []UpstreamEntryConfig) *UpstreamPool
The config consists of a map of the servers in the pool in the format host_or_ip:port where port is optional and defaults to 80. The map value is an int with the weight only 0 and 1 are supported weights (0 disables a server and 1 enables it)
func (UpstreamPool) FilterRequest ¶
func (up UpstreamPool) FilterRequest(req *falcore.Request) (res *http.Response)
func (UpstreamPool) LogStatus ¶
func (up UpstreamPool) LogStatus()
func (UpstreamPool) Next ¶
func (up UpstreamPool) Next() *UpstreamEntry
func (UpstreamPool) Shutdown ¶
func (up UpstreamPool) Shutdown()
This should only be called if the upstream pool is no longer active or this may deadlock
Click to show internal directories.
Click to hide internal directories.