client

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisClient

type RedisClient struct {
	*redis.Client
	Name string
}

RedisClient - Redis Client structure

func Connect

func Connect(connName string, config config.Cache) *RedisClient

Connect - Connects to DB.

func (*RedisClient) Close

func (rdb *RedisClient) Close() error

Close - Closes the connection.

func (*RedisClient) Decode

func (rdb *RedisClient) Decode(encoded string, obj interface{}) error

Decode - Decodes an object with msgpack.

func (*RedisClient) Del

func (rdb *RedisClient) Del(key string) error

Del - Removes a key.

func (*RedisClient) DelWildcard

func (rdb *RedisClient) DelWildcard(key string) (int, error)

DelWildcard - Removes the matching keys based on a pattern.

func (*RedisClient) Encode

func (rdb *RedisClient) Encode(obj interface{}) (string, error)

Encode - Encodes an object with msgpack.

func (*RedisClient) Expire

func (rdb *RedisClient) Expire(key string, expiration time.Duration) error

Expire - Sets a TTL on a key.

func (*RedisClient) Get

func (rdb *RedisClient) Get(key string) (string, error)

Get - Gets a key.

func (*RedisClient) List

func (rdb *RedisClient) List(key string) ([]string, error)

List - Returns the values in a list.

func (*RedisClient) Ping

func (rdb *RedisClient) Ping() bool

Ping - Tests the connection.

func (*RedisClient) PurgeAll

func (rdb *RedisClient) PurgeAll() (bool, error)

PurgeAll - Purges all the existing keys on a DB.

func (*RedisClient) Push

func (rdb *RedisClient) Push(key string, values []string) error

Push - Append values to a list.

func (*RedisClient) Set

func (rdb *RedisClient) Set(key string, value string, expiration time.Duration) (bool, error)

Set - Sets a key, with certain value, with TTL for expiring.

Jump to

Keyboard shortcuts

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