Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
Client is a customizable abstraction for calling FLW protocol functions.
func (*Client) Cons ¶
func (c *Client) Cons(server string) ([]*ServerClient, error)
Cons is a FourLetterWord helper function. In particular, this function pulls the "cons" output from a server. As with Srvr, the error value indicates whether the request had an issue.
func (*Client) Ruok ¶
Ruok is a FourLetterWord helper function. In particular, this function pulls the "ruok" output of a server.
func (*Client) Srvr ¶
func (c *Client) Srvr(server string) (*ServerStats, error)
Srvr is a FourLetterWord helper function. In particular, this function pulls the "srvr" output from the zookeeper instance and parses the output. A *ServerStats struct is returned as well as an error value to indicate whether this function processed successfully.
type Mode ¶
type Mode uint8
Mode is used to build custom server modes (leader|follower|standalone).
These constants represent the possible modes that a Zookeeper server can run in. A Zookeeper server can run in leader, follower or standalone mode. ModeUnknown is used when the mode cannot be recognized from the response.
type ServerClient ¶
type ServerClient struct { Queued int64 Received int64 Sent int64 SessionID int64 Lcxid int64 Lzxid int64 Timeout int32 LastLatency int32 MinLatency int32 AvgLatency int32 MaxLatency int32 Established time.Time LastResponse time.Time Addr string LastOperation string // maybe? }
ServerClient is the information for a single Zookeeper client and its session. This is used to parse/extract the output of the `cons` command.
func Cons ¶
func Cons(server string) ([]*ServerClient, error)
Cons executes the cons FLW protocol function using the default client.
type ServerStats ¶
type ServerStats struct { Sent int64 Received int64 NodeCount int64 MinLatency int64 AvgLatency float64 MaxLatency int64 Connections int64 Outstanding int64 Epoch int32 Counter int32 BuildTime time.Time Mode Mode Version string }
ServerStats is the information pulled from the Zookeeper `stat` command.
func Srvr ¶
func Srvr(server string) (*ServerStats, error)
Srvr executes the srvr FLW protocol function using the default client.