Documentation
¶
Index ¶
- type BackendServer
- type BackendServerSlice
- type BalancingPlugin
- func (plugin *BalancingPlugin) AddBackendServer(addr string, callback protocols.FaultDetectorCallback) error
- func (plugin *BalancingPlugin) NewSession(param protocols.SessionParameter) (protocols.PluginSessionHandler, error)
- func (plugin *BalancingPlugin) Start(server *protocols.PluginServer)
- func (plugin *BalancingPlugin) Stop() error
- type BalancingPluginHandler
- type BalancingSession
- func (session *BalancingSession) Cleanup() error
- func (session *BalancingSession) LogServerError(err error)
- func (session *BalancingSession) Start(sendingSession protocols.PluginSessionHandler)
- func (session *BalancingSession) StopContainingSession() error
- func (session *BalancingSession) String() string
- func (session *BalancingSession) Tasks() []golib.Task
- type BalancingSessionHandler
- type FaultDetectorFactory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackendServer ¶
type BackendServer struct { Addr protocols.Addr Client protocols.CircuitBreaker Sessions map[*BalancingSession]bool Plugin *BalancingPlugin BackupSessions uint Load float64 // 1 per session + backup_session_weight per backup session }
func (*BackendServer) String ¶
func (server *BackendServer) String() string
type BackendServerSlice ¶
type BackendServerSlice []*BackendServer
func (BackendServerSlice) Less ¶
func (slice BackendServerSlice) Less(i, j int) bool
func (BackendServerSlice) Sort ¶
func (slice BackendServerSlice) Sort()
func (BackendServerSlice) Swap ¶
func (slice BackendServerSlice) Swap(i, j int)
type BalancingPlugin ¶
type BalancingPlugin struct { Server *protocols.PluginServer BackendServers BackendServerSlice // contains filtered or unexported fields }
func NewBalancingPlugin ¶
func NewBalancingPlugin(handler BalancingPluginHandler, make_detector FaultDetectorFactory) *BalancingPlugin
func (*BalancingPlugin) AddBackendServer ¶
func (plugin *BalancingPlugin) AddBackendServer(addr string, callback protocols.FaultDetectorCallback) error
func (*BalancingPlugin) NewSession ¶
func (plugin *BalancingPlugin) NewSession(param protocols.SessionParameter) (protocols.PluginSessionHandler, error)
func (*BalancingPlugin) Start ¶
func (plugin *BalancingPlugin) Start(server *protocols.PluginServer)
func (*BalancingPlugin) Stop ¶
func (plugin *BalancingPlugin) Stop() error
type BalancingPluginHandler ¶
type BalancingPluginHandler interface { NewClient(detector protocols.FaultDetector) (protocols.CircuitBreaker, error) Protocol() protocols.Protocol // Create and fully initialize new session. The param data is passed from // plugin to plugin, enabling one plugin to modify the input data for the next plugin. // Modify param if necessary and copy values from it. Do not store it. NewSession(balancingSession *BalancingSession, param protocols.SessionParameter) (BalancingSessionHandler, error) }
type BalancingSession ¶
type BalancingSession struct { Client string Plugin *BalancingPlugin SendingSession protocols.PluginSessionHandler Handler BalancingSessionHandler PrimaryServer *BackendServer BackupServers BackendServerSlice // contains filtered or unexported fields }
func (*BalancingSession) Cleanup ¶
func (session *BalancingSession) Cleanup() error
func (*BalancingSession) LogServerError ¶
func (session *BalancingSession) LogServerError(err error)
func (*BalancingSession) Start ¶
func (session *BalancingSession) Start(sendingSession protocols.PluginSessionHandler)
func (*BalancingSession) StopContainingSession ¶
func (session *BalancingSession) StopContainingSession() error
func (*BalancingSession) String ¶
func (session *BalancingSession) String() string
func (*BalancingSession) Tasks ¶
func (session *BalancingSession) Tasks() []golib.Task
type BalancingSessionHandler ¶
type FaultDetectorFactory ¶
type FaultDetectorFactory func(endpoint string) (protocols.FaultDetector, error)
Click to show internal directories.
Click to hide internal directories.