cache

package
v0.0.0-...-f65745d Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2022 License: Unlicense Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Redis

type Redis struct {
	*redis.Client
}

Redis contains objects for database communication.

func NewRedis

func NewRedis(config *RedisConfig) (*Redis, error)

NewRedis create new cache instance.

func (*Redis) DeleteKeys

func (cache *Redis) DeleteKeys(keys ...string) error

func (*Redis) ExpireKey

func (cache *Redis) ExpireKey(key string) error

ExpireKey .

func (*Redis) FlushData

func (cache *Redis) FlushData() error

func (*Redis) GetInstance

func (cache *Redis) GetInstance() *redis.Client

GetInstance .

func (*Redis) GetValue

func (cache *Redis) GetValue(key string) (string, error)

GetValue run sql query

func (*Redis) SetValue

func (cache *Redis) SetValue(key string, value interface{}, expiration time.Duration) error

SetValue run sql query

type RedisConfig

type RedisConfig struct {
	Addr     string
	Port     string
	Password string
}

RedisConfig contains the configurations for cache.

func NewRedisConfig

func NewRedisConfig() *RedisConfig

NewRedisConfig load the configuration for database.

Jump to

Keyboard shortcuts

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