conn

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CachePipel

type CachePipel interface {
	Get(key string) *redis.StringCmd
	Exec() ([]redis.Cmder, error)
	Set(key string, value interface{}, expiration time.Duration) *redis.StatusCmd
}

type RedisClient

type RedisClient interface {
	Close() error
	Ping() string
	CountKeys() (int, error)
	Get(k string) ([]byte, error)
	Set(k string, v interface{}, exp time.Duration) (string, error)
	Del(k ...string) (int64, error)
	DelKeys(pattern string) (int64, error)
	LPush(k string, v interface{}) (int64, error)
	RPop(k string) ([]byte, error)
	HGet(key string, field string) string
	HSet(key string, values map[string]string) error
	HGetAll(key string) map[string]string
	Exists(key string) bool
	Expired(key string, d time.Duration) (bool, error)
	NewPiple() CachePipel
	Keys(pattern string) ([]string, error)
	TTL(key string) (time.Duration, error)
	MGet(keys []string) ([]interface{}, error)
}

type RedisConf

type RedisConf struct {
	Host  string         `yaml:"host"`
	Pwd   string         `yaml:"pass"`
	DbMap map[string]int `yaml:"dbMap"`
}

func (*RedisConf) NewRedisDbConn

func (rc *RedisConf) NewRedisDbConn(ctx context.Context, name string) (RedisClient, error)

type RedisDI

type RedisDI interface {
	NewRedisDbConn(ctx context.Context, name string) (RedisClient, error)
}

Jump to

Keyboard shortcuts

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