rediscache

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCli

func GetCli() *redis.Client

Types

type BasicCrud

type BasicCrud interface {
	Set(key string, value interface{}, timeOut time.Duration) (err error)
	Get(key string) (val string, err error)
}

func NewCRUD

func NewCRUD(ctx context.Context, cli *redis.Client) BasicCrud

type Config

type Config struct {
	Addr           string         `yaml:"host_and_port" env:"RedisHostAndPort" end-description:"redis host and port, seems like 127.0.0.1:6379"`
	Username       string         `yaml:"user_name" env:"RedisUsername"`
	Password       string         `yaml:"password" env:"RedisPassword"`
	DB             int            `yaml:"db" env:"RedisDB"`
	PoolSize       int            `yaml:"pool_size" env:"RedisPoolSize"`
	SentinelConfig sentinelConfig `yaml:"sentinel"`
	ServerType     string         `` /* 128-byte string literal not displayed */
}

func (*Config) NewRedisCli

func (c *Config) NewRedisCli(ctx context.Context) error

type RedisCrud

type RedisCrud struct {
	Ctx context.Context
	Rdb *redis.Client
}

func (*RedisCrud) Get

func (c *RedisCrud) Get(key string) (val string, err error)

func (*RedisCrud) Set

func (c *RedisCrud) Set(key string, value interface{}, timeOut time.Duration) (err error)

Jump to

Keyboard shortcuts

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