client

package
v0.0.0-...-63beb8f Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Deserialize

func Deserialize(inp []byte, obj interface{}) error

Deserialize decodes recieved gob encoded data and writes to input object by reference

func Serialize

func Serialize(obj interface{}) ([]byte, error)

Serialize dumps object to byte array via gob encoder

Types

type Client

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

Client holds client connection

func New

func New(address string, timeout int) *Client

New instantiates rpc client

func (*Client) Close

func (c *Client) Close() error

Close terminates the underlying client

func (*Client) Del

func (c *Client) Del(key string) error

Del makes RPC for deleting any record from the bucket by a given key

func (*Client) DelAll

func (c *Client) DelAll() error

DestroyAll makes RPC for deleting entire db

func (*Client) Get

func (c *Client) Get(key string) ([]byte, bool)

Get makes RPC that returns value by key from one of the buckets

func (*Client) Has

func (c *Client) Has(key string) bool

Get makes RPC that returns value by key from one of the buckets

func (*Client) Open

func (c *Client) Open() error

Open creates connection to the rpc server

func (*Client) Set

func (c *Client) Set(key string, val []byte, ttl int) error

Set makes RPC for creating the new key value pair in specified bucket

func (*Client) Size

func (c *Client) Size() (uint64, error)

Size requests number of elements in the storage

Jump to

Keyboard shortcuts

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