Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Balancer ¶
type Balancer struct {
// contains filtered or unexported fields
}
Balancer MySQL load balancer
func (*Balancer) PickServer ¶
PickServer returns the best server at a given point in time
type Config ¶
type Config struct { CheckInterval int64 StartCheck bool TraceOn bool Logger Logger ServersSettings []ServerSettings StartupWait time.Duration }
Config configuration options for the balancer
type Logger ¶
type Logger interface { Error(args ...interface{}) Errorf(format string, args ...interface{}) Printf(format string, v ...interface{}) }
Logger ...
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server server representation
func (*Server) CheckHealth ¶
CheckHealth check server's health and set it's state
func (*Server) GetConnection ¶
GetConnection returns server's connection
func (*Server) GetHealth ¶
func (s *Server) GetHealth() *ServerHealth
GetHealth returns server's health state
type ServerHealth ¶
ServerHealth represents a Server health state
func (*ServerHealth) GetErr ¶
func (h *ServerHealth) GetErr() error
GetErr returns server's last error
func (*ServerHealth) GetOpenConnections ¶
func (h *ServerHealth) GetOpenConnections() *int
GetOpenConnections returns server's open connections
func (*ServerHealth) GetRunningConnections ¶
func (h *ServerHealth) GetRunningConnections() *int
GetRunningConnections returns the number of connections that are not sleeping.
func (*ServerHealth) GetSecondsBehindMaster ¶
func (h *ServerHealth) GetSecondsBehindMaster() *int
GetSecondsBehindMaster returns server's seconds behind master
func (*ServerHealth) IORunning ¶ added in v1.1.1
func (h *ServerHealth) IORunning() bool
GetSlaveRunning returns the IO status from slave