raphanusclient

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2021 License: MIT Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (

	// APIVersion - prefix for path in URL
	APIVersion = "/v1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cfg

type Cfg struct {
	Address  string
	User     string
	Password string
}

Cfg - config for New()

type Client

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

Client - client object

func New

func New(configs ...Cfg) Client

New - get new client

func (*Client) DecrInt

func (cli *Client) DecrInt(key string) (err error)

DecrInt - decrement int value by key

func (*Client) GetDict

func (cli *Client) GetDict(key string) (result raphanuscommon.DictValue, err error)

GetDict - get dict value by key

func (*Client) GetDictItem

func (cli *Client) GetDictItem(key string, dkey string) (result string, err error)

GetDictItem - get item form dict value by key and dict key

func (*Client) GetInt

func (cli *Client) GetInt(key string) (int64, error)

GetInt - get int value by key

func (*Client) GetList

func (cli *Client) GetList(key string) (result raphanuscommon.ListValue, err error)

GetList - get list value by key

func (*Client) GetListItem

func (cli *Client) GetListItem(key string, idx int) (result string, err error)

GetListItem - get item in list value by key and index

func (*Client) GetStr

func (cli *Client) GetStr(key string) (string, error)

GetStr - get string value by key

func (*Client) IncrInt

func (cli *Client) IncrInt(key string) (err error)

IncrInt - increment int value by key

func (*Client) Keys

func (cli *Client) Keys() (result []string, err error)

Keys - get all keys from cache (response may be too large)

func (*Client) Length

func (cli *Client) Length() (int, error)

Length - get count of keys

func (*Client) Remove

func (cli *Client) Remove(key string) (err error)

Remove - remove key from cache

func (*Client) RemoveDictItem

func (cli *Client) RemoveDictItem(key string, dkey string) (err error)

RemoveDictItem - remove one item from dict value by key and dict key

func (*Client) SetDict

func (cli *Client) SetDict(key string, value raphanuscommon.DictValue, ttl int) (err error)

SetDict - set dict value by key

func (*Client) SetDictItem

func (cli *Client) SetDictItem(key string, dkey string, value string) (err error)

SetDictItem - set item in dict value by key and dict key

func (*Client) SetInt

func (cli *Client) SetInt(key string, value int64, ttl int) (err error)

SetInt - set int value by key

func (*Client) SetList

func (cli *Client) SetList(key string, value raphanuscommon.ListValue, ttl int) (err error)

SetList - set list value by key

func (*Client) SetListItem

func (cli *Client) SetListItem(key string, idx int, value string) (err error)

SetListItem - set item in list value by key and index

func (*Client) SetStr

func (cli *Client) SetStr(key string, value string, ttl int) (err error)

SetStr - set string value by key

func (*Client) Stat

func (cli *Client) Stat() (result raphanuscommon.Stat, err error)

Stat - get some stat from server: version, memory, GC, etc

func (*Client) UpdateDict

func (cli *Client) UpdateDict(key string, value raphanuscommon.DictValue) (err error)

UpdateDict - update dict value by key

func (*Client) UpdateInt

func (cli *Client) UpdateInt(key string, value int64) (err error)

UpdateInt - update int value by key

func (*Client) UpdateList

func (cli *Client) UpdateList(key string, value raphanuscommon.ListValue) (err error)

UpdateList - update list value by key

func (*Client) UpdateStr

func (cli *Client) UpdateStr(key string, value string) (err error)

UpdateStr - update string value by key

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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