client

package
v0.0.0-...-3d85bc3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2016 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(params Params) (*Client, error)

func (*Client) Close

func (cli *Client) Close() error

func (*Client) GetConfiguration

func (cli *Client) GetConfiguration() (*pb.ClientResponse, error)

func (*Client) GetConfigurationAsync

func (cli *Client) GetConfigurationAsync(callback func(*pb.ClientResponse, error))

func (*Client) Query

func (cli *Client) Query(command []byte) (*pb.ClientResponse, error)

func (*Client) QueryAsync

func (cli *Client) QueryAsync(command []byte, callback func(*pb.ClientResponse, error))

func (*Client) SetConfiguration

func (cli *Client) SetConfiguration(cfg *pb.Configuration) (*pb.ClientResponse, error)

func (*Client) SetConfigurationAsync

func (cli *Client) SetConfigurationAsync(cfg *pb.Configuration, callback func(*pb.ClientResponse, error))

func (*Client) Write

func (cli *Client) Write(command []byte) (*pb.ClientResponse, error)

func (*Client) WriteAsync

func (cli *Client) WriteAsync(command []byte, callback func(*pb.ClientResponse, error))

type DefaultRetryPolicy

type DefaultRetryPolicy struct{}

func (DefaultRetryPolicy) GetTimeout

func (_ DefaultRetryPolicy) GetTimeout(retrynum uint) time.Duration

func (DefaultRetryPolicy) ShouldRetry

func (_ DefaultRetryPolicy) ShouldRetry(retrynum uint, err error) bool

type Params

type Params struct {
	ClusterUUID    string
	ClusterAddr    string
	Bind           string
	RandomSource   rand.Source
	SecretsManager rpc.SecretsManager
	SecretNum      uint32
	RetryPolicy    RetryPolicy
}

type RetryPolicy

type RetryPolicy interface {
	GetTimeout(retrynum uint) time.Duration
	ShouldRetry(retrynum uint, err error) bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL