client

package
v0.0.0-...-a83588d Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTimeout = errors.New("operation failed: client-specified timeout elapsed")

ErrTimeout is an error returned when the client is unable to succesfully complete the operation within the specified timeout.

Functions

This section is empty.

Types

type Client

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

Client is a client of the key-value store.

func NewClient

func NewClient(nodes map[string]string) (*Client, error)

NewClient creates a new instance of a client.

func (*Client) Get

func (c *Client) Get(key string, timeout time.Duration) (string, error)

Get gets the value associated with the provided key and returns it. An error is returned if the client is unable to complete the operation within the provided timeout.

func (*Client) Put

func (c *Client) Put(key string, value string, timeout time.Duration) (string, error)

Put sets the value of the provided key. An error is returned if the client is unable to complete the operation within the provided timeout. Note that, if the operation times out, the operation may or may not have been executed.

Jump to

Keyboard shortcuts

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