Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrMaxRetries = errors.New("connection failed after max retries")
ErrMaxRetries is used to differentiate retryable from non-retryable errors in the client.
Functions ¶
func ReadRecord ¶
func ReadRecord(r io.Reader) (*proto.RequestHeader, jute.RecordReader, error)
ReadRecord reads the request header and body depending on the opcode. It returns the serialized request header and body, or an error if it occurs.
func WriteRecords ¶
func WriteRecords(w io.Writer, generated ...jute.RecordWriter) error
WriteRecords takes in one or more RecordWriter instances, serializes them to a byte array and writes them to the provided io.Writer.
Types ¶
type Client ¶
type Client struct { // Dialer is a function to be used to establish a connection to a single host. Dialer func(ctx context.Context, network, addr string) (net.Conn, error) SessionTimeout time.Duration MaxRetries int Network string Ensemble string // contains filtered or unexported fields }
Client represents a Zookeeper client abstraction with additional configuration parameters.
func (*Client) DialContext ¶
DialContext connects the ZK client to the specified Zookeeper server. The provided context is used to determine the dial lifetime.
func (*Client) GetChildren ¶
GetChildren uses the retryable client to call GetChildren on a Zookeeper server.
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn represents a client connection to a Zookeeper server and parameters needed to handle its lifetime.
func DialContext ¶
DialContext connects to the ZK server using the default client.
func (*Conn) GetChildren ¶
GetChildren returns all children of a node at the given path, if they exist.