cache

package
v0.0.0-...-94f544f Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultExpiration = 24 * time.Hour

Variables

This section is empty.

Functions

func Init

func Init()

func NewRedisClients

func NewRedisClients(clients map[RDB]*Client)

Types

type Client

type Client struct {
	C   *redis.Client
	Ctx context.Context
}
var Cache *Client

func NewRedisClient

func NewRedisClient(n int) *Client

func (Client) ClientGetName

func (c Client) ClientGetName() *redis.StringCmd

ClientGetName returns the name of the connection.

func (Client) Del

func (c Client) Del(keys ...string) *redis.IntCmd

func (Client) Dump

func (c Client) Dump(key string) *redis.StringCmd

func (Client) Echo

func (c Client) Echo(message interface{}) *redis.StringCmd

func (Client) Exists

func (c Client) Exists(keys ...string) *redis.IntCmd

func (Client) Expire

func (c Client) Expire(key string, expiration time.Duration) *redis.BoolCmd

func (Client) ExpireAt

func (c Client) ExpireAt(key string, tm time.Time) *redis.BoolCmd

func (Client) ExpireGT

func (c Client) ExpireGT(key string, expiration time.Duration) *redis.BoolCmd

func (Client) ExpireLT

func (c Client) ExpireLT(key string, expiration time.Duration) *redis.BoolCmd

func (Client) ExpireNX

func (c Client) ExpireNX(key string, expiration time.Duration) *redis.BoolCmd

func (Client) ExpireTime

func (c Client) ExpireTime(key string) *redis.DurationCmd

func (Client) ExpireXX

func (c Client) ExpireXX(key string, expiration time.Duration) *redis.BoolCmd

func (Client) Get

func (c Client) Get(key string) *redis.StringCmd

func (Client) HGet

func (c Client) HGet(key, field string) *redis.StringCmd

func (Client) HGetAll

func (c Client) HGetAll(key string) *redis.MapStringStringCmd

func (Client) HMGet

func (c Client) HMGet(key string, fields ...string) *redis.SliceCmd

func (Client) HMSet

func (c Client) HMSet(key string, fields map[string]interface{}) *redis.BoolCmd

func (Client) HSet

func (c Client) HSet(key, field string, value interface{}) *redis.IntCmd

func (Client) Ping

func (c Client) Ping() *redis.StatusCmd

func (Client) SAdd

func (c Client) SAdd(key string, members ...interface{}) *redis.IntCmd

func (Client) SIsMember

func (c Client) SIsMember(key string, member interface{}) *redis.BoolCmd

func (Client) SMembers

func (c Client) SMembers(key string) *redis.StringSliceCmd

func (Client) SRem

func (c Client) SRem(key string, members ...interface{}) *redis.IntCmd

func (Client) Set

func (c Client) Set(key string, value interface{}, expiration time.Duration) *redis.StatusCmd
func (c Client) Unlink(keys ...string) *redis.IntCmd

func (Client) ZAddNX

func (c Client) ZAddNX(key string, members ...redis.Z) *redis.IntCmd

func (Client) ZRange

func (c Client) ZRange(key string, start, stop int64) *redis.StringSliceCmd

func (Client) ZRemRangeByScore

func (c Client) ZRemRangeByScore(key, min, max string) *redis.IntCmd

type RDB

type RDB uint8

Jump to

Keyboard shortcuts

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