cache

package
v2.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2021 License: MIT Imports: 5 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

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