client

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: MIT Imports: 4 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
}

Client is a client for the cache server.

func New

func New(endpoint string) (*Client, error)

New creates a new client.

func (*Client) Close

func (c *Client) Close() error

Close closes the connection.

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, key []byte) error

Delete sends a delete command to the server.

func (*Client) Get

func (c *Client) Get(ctx context.Context, key []byte) ([]byte, error)

Get sends a get command to the server.

func (*Client) Set

func (c *Client) Set(ctx context.Context, key, value []byte, ttl int) error

Set sends a set command to the server. ttl is in seconds.

func (Client) String

func (c Client) String() string

String returns the string representation of the client which is the client's address.

Jump to

Keyboard shortcuts

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