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) Valid ¶
func (cmb *BackendCombined) Valid() error
type BackendEvent ¶
type BackendEvent struct {
Action string // add/del/update
*BackendCombined
}
BackendEvent
func BuildBackendEvent ¶
func BuildBackendEvent(act, ups, alias, listen, backend, ip, ver string, port uint64, weight float64) *BackendEvent
func (*BackendEvent) Format ¶
func (ev *BackendEvent) Format()
func (*BackendEvent) String ¶
func (ev *BackendEvent) String() string
type UpsManager ¶
Type & Method Definitions ...
Click to show internal directories.
Click to hide internal directories.