sdk

package
v0.0.0-...-1d7f72f Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrKeyAlreadyExists = errors.New("key already exists")
	ErrKeyDoesNotExist  = errors.New("key does not exist")
)
View Source
var (
	ErrElementNotInSource           = errors.New("no element in source")
	ErrElementNotAddedInDestination = errors.New("could not add element to destination")
)

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(db executers.Executer) *Client

func (*Client) AddInt

func (c *Client) AddInt(ctx context.Context, name string, add int64) (int64, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) DBSize

func (c *Client) DBSize(ctx context.Context) (int64, error)

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, name string) (bool, error)

func (*Client) Exists

func (c *Client) Exists(ctx context.Context, name string) (bool, error)

func (*Client) Expire

func (c *Client) Expire(ctx context.Context, name string, ttl time.Duration) error

func (*Client) FlushDB

func (c *Client) FlushDB(ctx context.Context) error

func (*Client) Get

func (c *Client) Get(ctx context.Context, name string) (*string, error)

func (*Client) GetSet

func (c *Client) GetSet(ctx context.Context, name string, value string) (string, error)

func (*Client) Keys

func (c *Client) Keys(ctx context.Context, glob string) ([]string, error)

func (*Client) ListAt

func (c *Client) ListAt(ctx context.Context, name string, index int64) (string, error)

func (*Client) ListLength

func (c *Client) ListLength(ctx context.Context, name string) (int64, error)

func (*Client) ListPop

func (c *Client) ListPop(ctx context.Context, name string, length int64) ([]string, error)

func (*Client) ListPush

func (c *Client) ListPush(ctx context.Context, name string, values ...string) (int64, error)

func (*Client) ListRange

func (c *Client) ListRange(ctx context.Context, name string, start int64, end int64) ([]string, error)

func (*Client) ListRemove

func (c *Client) ListRemove(ctx context.Context, name string, count int64, element string) (int64, error)

func (*Client) ListSet

func (c *Client) ListSet(ctx context.Context, name string, index int64, element string) error

func (*Client) ListShift

func (c *Client) ListShift(ctx context.Context, name string, length int64) ([]string, error)

func (*Client) ListSort

func (c *Client) ListSort(ctx context.Context, name string) ([]string, error)

func (*Client) ListTrim

func (c *Client) ListTrim(ctx context.Context, name string, start int64, end int64) error

func (*Client) ListUnshift

func (c *Client) ListUnshift(ctx context.Context, name string, values ...string) (int64, error)

func (*Client) MGet

func (c *Client) MGet(ctx context.Context, names ...string) ([]*string, error)

func (*Client) MSet

func (c *Client) MSet(ctx context.Context, pairs ...[2]string) error

func (*Client) RandomKey

func (c *Client) RandomKey(ctx context.Context) (string, error)

func (*Client) Rename

func (c *Client) Rename(ctx context.Context, current string, next string) error

func (*Client) RenameIfNotExists

func (c *Client) RenameIfNotExists(ctx context.Context, current string, next string) error

func (*Client) Set

func (c *Client) Set(ctx context.Context, name string, value any, ttl time.Duration) error

func (*Client) SetAdd

func (c *Client) SetAdd(ctx context.Context, name string, values ...string) (int64, error)

func (*Client) SetContains

func (c *Client) SetContains(ctx context.Context, name string, element string) (bool, error)

func (*Client) SetDiff

func (c *Client) SetDiff(ctx context.Context, names ...string) ([]string, error)

func (*Client) SetDiffAndStore

func (c *Client) SetDiffAndStore(ctx context.Context, name string, names ...string) (int64, error)

func (*Client) SetIfNotExists

func (c *Client) SetIfNotExists(ctx context.Context, name string, value any) error

func (*Client) SetIntersect

func (c *Client) SetIntersect(ctx context.Context, names ...string) ([]string, error)

func (*Client) SetIntersectAndStore

func (c *Client) SetIntersectAndStore(ctx context.Context, name string, names ...string) (int64, error)

func (*Client) SetLength

func (c *Client) SetLength(ctx context.Context, name string) (int64, error)

func (*Client) SetMembers

func (c *Client) SetMembers(ctx context.Context, name string) ([]string, error)

func (*Client) SetMove

func (c *Client) SetMove(ctx context.Context, destination string, source string, element string) error

func (*Client) SetPop

func (c *Client) SetPop(ctx context.Context, name string, count int64) ([]string, error)

func (*Client) SetRandomMember

func (c *Client) SetRandomMember(ctx context.Context, name string, length int64) ([]string, error)

func (*Client) SetRemove

func (c *Client) SetRemove(ctx context.Context, name string, values ...string) (int64, error)

func (*Client) SetUnion

func (c *Client) SetUnion(ctx context.Context, names ...string) ([]string, error)

func (*Client) SetUnionAndStore

func (c *Client) SetUnionAndStore(ctx context.Context, name string, names ...string) (int64, error)

func (*Client) Substr

func (c *Client) Substr(ctx context.Context, name string, start int64, end int64) (string, error)

func (*Client) TTL

func (c *Client) TTL(ctx context.Context, name string) (*time.Duration, error)

func (*Client) Type

func (c *Client) Type(ctx context.Context, name string) (Type, error)

type Type

type Type int
const (
	StringType Type = Type(1)
	ListType   Type = Type(2)
	SetType    Type = Type(3)
)

func (Type) String

func (t Type) String() string

Jump to

Keyboard shortcuts

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