Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllSessions ¶
func RemoveBackend ¶
func RemoveBackend(cmb *BackendCombined) (onLast bool)
func UpsertBackend ¶
func UpsertBackend(cmb *BackendCombined) (onFirst bool, err error)
Types ¶
type Backend ¶
type Backend struct {
ID string `json:"id"` // backend server id(name)
IP string `json:"ip"` // backend server ip
Port uint64 `json:"port"` // backend server port
Scheme string `json:"scheme"` // http / https, auto detect & setup by httpProxy
Version string `json:"version"`
Weight float64 `json:"weihgt"`
CleanName string `json:"clean_name"` // backend server clean id(name)
}
Backend
func GetBackend ¶
type BackendCombined ¶
BackendCombined
func Lookup ¶
func Lookup(remoteIP, ups, backend string) *BackendCombined
lookup select a suitable backend according by sessions & balancer
func LookupAlias ¶
func LookupAlias(remoteIP, alias string) *BackendCombined
similar as lookup, but by upstream alias
func LookupListen ¶
func LookupListen(remoteIP, listen string) *BackendCombined
similar as lookup, but by upstream listen
func (*BackendCombined) Format ¶ added in v0.2.1
func (cmb *BackendCombined) Format()
func (*BackendCombined) String ¶ added in v0.2.1
func (cmb *BackendCombined) String() string
func (*BackendCombined) Valid ¶
func (cmb *BackendCombined) Valid() error
type UpsManager ¶
Type & Method Definitions ...
type Upstream ¶
type Upstream struct {
Name string `json:"name"` // uniq name
Alias string `json:"alias"` // advertised url
Listen string `json:"listen"` // listen addr
Sticky bool `json:"sticky"` // session sticky enabled (default no)
Backends []*Backend `json:"backends"` // backend servers
// contains filtered or unexported fields
}
func GetUpstream ¶
Click to show internal directories.
Click to hide internal directories.