client

package
v0.0.0-20200206 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2020 License: Apache-2.0 Imports: 12 Imported by: 55

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAlreadyConnected  = errors.New("already connected")
	ErrNotConnected      = errors.New("not connected")
	ErrHealthCheckFailed = errors.New("health check failed")
)

Functions

This section is empty.

Types

type BatchRequest

type BatchRequest struct {
	Keys   []io.Reader
	Values []io.Reader
}

type ImmuClient

type ImmuClient struct {
	Logger  logger.Logger
	Options Options
	// contains filtered or unexported fields
}

func DefaultClient

func DefaultClient() *ImmuClient

func (*ImmuClient) ByIndex

func (c *ImmuClient) ByIndex(index uint64) (*schema.Item, error)

func (*ImmuClient) Connect

func (c *ImmuClient) Connect() (err error)

func (*ImmuClient) Connected

func (c *ImmuClient) Connected(f func() (interface{}, error)) (interface{}, error)

func (*ImmuClient) Consistency

func (c *ImmuClient) Consistency(index uint64) (*schema.ConsistencyProof, error)

func (*ImmuClient) Count

func (c *ImmuClient) Count(keyReader io.Reader) (*schema.ItemsCount, error)

func (*ImmuClient) Disconnect

func (c *ImmuClient) Disconnect() error

func (*ImmuClient) Get

func (c *ImmuClient) Get(keyReader io.Reader) (*schema.Item, error)

func (*ImmuClient) GetBatch

func (c *ImmuClient) GetBatch(keyReaders []io.Reader) (*schema.ItemList, error)

func (*ImmuClient) HealthCheck

func (c *ImmuClient) HealthCheck() error

func (*ImmuClient) History

func (c *ImmuClient) History(keyReader io.Reader) (*schema.ItemList, error)

func (*ImmuClient) Inclusion

func (c *ImmuClient) Inclusion(index uint64) (*schema.InclusionProof, error)

func (*ImmuClient) Scan

func (c *ImmuClient) Scan(keyReader io.Reader) (*schema.ItemList, error)

func (*ImmuClient) Set

func (c *ImmuClient) Set(keyReader io.Reader, valueReader io.Reader) (*schema.Index, error)

func (*ImmuClient) SetBatch

func (c *ImmuClient) SetBatch(request *BatchRequest) (*schema.Index, error)

func (*ImmuClient) WithLogger

func (c *ImmuClient) WithLogger(logger logger.Logger) *ImmuClient

func (*ImmuClient) WithOptions

func (c *ImmuClient) WithOptions(options Options) *ImmuClient

type Options

type Options struct {
	Address            string
	Port               int
	DialRetries        int
	HealthCheckRetries int
}

func DefaultOptions

func DefaultOptions() Options

func (Options) Bind

func (o Options) Bind() string

func (Options) FromEnvironment

func (o Options) FromEnvironment() Options

func (Options) String

func (o Options) String() string

func (Options) WithAddress

func (o Options) WithAddress(address string) Options

func (Options) WithDialRetries

func (o Options) WithDialRetries(retries int) Options

func (Options) WithHealthCheckRetries

func (o Options) WithHealthCheckRetries(retries int) Options

func (Options) WithPort

func (o Options) WithPort(port int) Options

Jump to

Keyboard shortcuts

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