Documentation
¶
Index ¶
- Constants
- func ServerHealthValid(state string) bool
- func ServerStateValid(state string) bool
- func ServerWeightValid(weight string) bool
- type Client
- func (c *Client) ExecuteRaw(command string) ([]string, error)
- func (c *Client) GetInfo() ([]models.ProcessInfoHaproxy, error)
- func (c *Client) GetStats() models.NativeStats
- func (c *Client) Init(socketPath []string, masterSocketPath string, nbproc int) error
- func (c *Client) SetFrontendMaxConn(frontend string, maxconn int) error
- func (c *Client) SetServerAddr(backend, server string, ip string, port int) error
- func (c *Client) SetServerHealth(backend, server string, health string) error
- func (c *Client) SetServerState(backend, server string, state string) error
- func (c *Client) SetServerWeight(backend, server string, weight string) error
- type SingleRuntime
- func (s *SingleRuntime) Execute(command string) error
- func (s *SingleRuntime) ExecuteRaw(command string) (string, error)
- func (s *SingleRuntime) GetInfo() (models.ProcessInfoHaproxy, error)
- func (s *SingleRuntime) GetStats() *models.NativeStatsCollection
- func (s *SingleRuntime) Init(socketPath string, worker int) error
- func (s *SingleRuntime) SetFrontendMaxConn(frontend string, maxconn int) error
- func (s *SingleRuntime) SetServerAddr(backend, server string, ip string, port int) error
- func (s *SingleRuntime) SetServerHealth(backend, server string, health string) error
- func (s *SingleRuntime) SetServerState(backend, server string, state string) error
- func (s *SingleRuntime) SetServerWeight(backend, server string, weight string) error
- type Task
- type TaskResponse
Constants ¶
const ( // DefaultSocketPath sane default for runtime API socket path DefaultSocketPath string = "/var/run/haproxy.sock" )
Variables ¶
This section is empty.
Functions ¶
func ServerHealthValid ¶
ServerHealthValid checks if server state is valid
func ServerStateValid ¶
ServerStateValid checks if server state is valid
func ServerWeightValid ¶
ServerWeightValid checks if server state is valid
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client handles multiple HAProxy clients
func DefaultClient ¶
DefaultClient return runtime Client with sane defaults
func (*Client) ExecuteRaw ¶
ExecuteRaw does not procces response, just returns its values for all processes
func (*Client) GetInfo ¶
func (c *Client) GetInfo() ([]models.ProcessInfoHaproxy, error)
GetInfo returns info from the socket
func (*Client) GetStats ¶
func (c *Client) GetStats() models.NativeStats
GetStats returns stats from the socket
func (*Client) Init ¶
Init must be given path to runtime socket and nbproc that is not 0 when in master worker mode
func (*Client) SetFrontendMaxConn ¶
SetFrontendMaxConn set maxconn for frontend
func (*Client) SetServerAddr ¶
SetServerAddr set ip [port] for server
func (*Client) SetServerHealth ¶
SetServerHealth set health for server
func (*Client) SetServerState ¶
SetServerState set state for server
type SingleRuntime ¶
type SingleRuntime struct {
// contains filtered or unexported fields
}
SingleRuntime handles one runtime API
func (*SingleRuntime) Execute ¶
func (s *SingleRuntime) Execute(command string) error
Execute executes command on runtime API
func (*SingleRuntime) ExecuteRaw ¶
func (s *SingleRuntime) ExecuteRaw(command string) (string, error)
ExecuteRaw executes command on runtime API and returns raw result
func (*SingleRuntime) GetInfo ¶
func (s *SingleRuntime) GetInfo() (models.ProcessInfoHaproxy, error)
GetInfo fetches HAProxy info from runtime API
func (*SingleRuntime) GetStats ¶
func (s *SingleRuntime) GetStats() *models.NativeStatsCollection
GetStats fetches HAProxy stats from runtime API
func (*SingleRuntime) Init ¶
func (s *SingleRuntime) Init(socketPath string, worker int) error
Init must be given path to runtime socket and worker number. If in master-worker mode, give the path to the master socket path, and non 0 number for workers.
func (*SingleRuntime) SetFrontendMaxConn ¶
func (s *SingleRuntime) SetFrontendMaxConn(frontend string, maxconn int) error
SetFrontendMaxConn set maxconn for frontend
func (*SingleRuntime) SetServerAddr ¶
func (s *SingleRuntime) SetServerAddr(backend, server string, ip string, port int) error
SetServerAddr set ip [port] for server
func (*SingleRuntime) SetServerHealth ¶
func (s *SingleRuntime) SetServerHealth(backend, server string, health string) error
SetServerHealth set health for server
func (*SingleRuntime) SetServerState ¶
func (s *SingleRuntime) SetServerState(backend, server string, state string) error
SetServerState set state for server
func (*SingleRuntime) SetServerWeight ¶
func (s *SingleRuntime) SetServerWeight(backend, server string, weight string) error
SetServerWeight set weight for server
type Task ¶
type Task struct {
// contains filtered or unexported fields
}
Task has command to execute on runtime api, and response channel for result
type TaskResponse ¶
type TaskResponse struct {
// contains filtered or unexported fields
}
TaskResponse ...