cache

package
v2.0.10 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	ClusterClient *redis.ClusterClient
}

func NewClusterClient

func NewClusterClient(addr []string, password string) Cluster

func NewClusterWithCfg

func NewClusterWithCfg(cfg ClusterConfig) Cluster

func (*Cluster) Del

func (r *Cluster) Del(key string) error

func (*Cluster) DelByPattern

func (r *Cluster) DelByPattern(pattern string) error

func (*Cluster) FindByPattern

func (r *Cluster) FindByPattern(pattern string) (map[string]interface{}, error)

func (*Cluster) Flush

func (r *Cluster) Flush() error

func (*Cluster) FlushByPattern

func (r *Cluster) FlushByPattern(pattern string) error

func (*Cluster) Get

func (r *Cluster) Get(key string, v interface{}) error

func (*Cluster) IsKeyNotFound

func (r *Cluster) IsKeyNotFound(err error) bool

func (*Cluster) Ping

func (r *Cluster) Ping() error

func (*Cluster) Set

func (r *Cluster) Set(key string, v interface{}, timeout time.Duration) error

func (*Cluster) SetExpire

func (r *Cluster) SetExpire(key string, expiration time.Duration) bool

func (*Cluster) SetExpireAt

func (r *Cluster) SetExpireAt(key string, expireAt time.Time) bool

type ClusterConfig

type ClusterConfig struct {
	Addr     string // e.g. 10.0.0.1:6379,10.0.0.2:6379
	Password string
}

type Config

type Config struct {
	Host     string
	Port     string
	Password string
	Db       int
}

type Redis

type Redis struct {
	Client *redis.Client
}

func New

func New(host string, port string, password string, db int) Redis

func NewWithCfg

func NewWithCfg(cfg Config) Redis

func (*Redis) Del

func (r *Redis) Del(key string) error

func (*Redis) DelByPattern

func (r *Redis) DelByPattern(pattern string) error

func (*Redis) FindByPattern

func (r *Redis) FindByPattern(pattern string) (map[string]interface{}, error)

func (*Redis) Flush

func (r *Redis) Flush() error

func (*Redis) FlushByPattern

func (r *Redis) FlushByPattern(pattern string) error

func (*Redis) Get

func (r *Redis) Get(key string, v interface{}) error

func (*Redis) IsKeyNotFound

func (r *Redis) IsKeyNotFound(err error) bool

func (*Redis) Ping

func (r *Redis) Ping() error

func (*Redis) Set

func (r *Redis) Set(key string, v interface{}, timeout time.Duration) error

func (*Redis) SetExpire

func (r *Redis) SetExpire(key string, expiration time.Duration) bool

func (*Redis) SetExpireAt

func (r *Redis) SetExpireAt(key string, expireAt time.Time) bool

Jump to

Keyboard shortcuts

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