Documentation ¶
Overview ¶
Package redis provides Redis client implementations.
Index ¶
- type Client
- func (this *Client) DBsize() (int, error)
- func (this *Client) Del(key any) error
- func (this *Client) Exists(keys ...any) (bool, error)
- func (this *Client) Finalize() error
- func (this *Client) FlushAll() error
- func (this *Client) FlushDB() error
- func (this *Client) Get(key any) (string, error)
- func (this *Client) Info(info string) (string, error)
- func (this *Client) Initialize(address, password string, maxConnection int, timeout time.Duration) error
- func (this *Client) MGet(keys ...any) ([]string, error)
- func (this *Client) MSet(args ...any) error
- func (this *Client) Ping() error
- func (this *Client) RandomKey() (string, error)
- func (this *Client) Rename(currentKey, newKey any) error
- func (this *Client) Select(index int) error
- func (this *Client) Set(key, value any) error
- func (this *Client) Setex(key any, second int, value any) error
- func (this *Client) Ttl(key any) (int, error)
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 struct that provides client related methods.
func (*Client) DBsize ¶
DBsize is key count in current database.
ex) keyCount, err := client.DBsize()
func (*Client) Exists ¶
Exists is returns whether the keys exists.
ex 1) existsKey, err := client.Exists("key") ex 2) existsKey, err := client.Exists("key", 1, 2, "3")
func (*Client) FlushDB ¶
FlushDB is delete all data in current database.
ex) err := client.FlushDB()
func (*Client) Info ¶
Info is get redis information.
kind : All, Server, Clients, Memory, Persistence, Stats, Replication, CPU, Cluster, Keyspace
ex) result, err := client.Info("ALL")
func (*Client) Initialize ¶
func (this *Client) Initialize(address, password string, maxConnection int, timeout time.Duration) error
Initialize is initialize.
ex) err := client.Initialize("127.0.0.1:6379", "", 10, 60)
func (*Client) RandomKey ¶
RandomKey is returns one key at random.
ex) key, err := client.RandomKey()