redis

package
v0.0.0-...-7c3836c Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RedisCluster = "cluster"
	RedisSingle  = "single"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisInterface

type RedisInterface interface {
	Set(k string, v interface{}, expir ...time.Duration) (err error)
	Get(k string) (v string, err error)
	Del(k string) (err error)
	HSet(k string, field string, v interface{}) (err error)
	HGet(k string, field string) (res string, err error)
	HDelAll(k string) (err error)
	HDel(k string, field string) (err error)
	Close() error
	Subscribe(channels ...string) *redis.PubSub
	Publish(channel string, message interface{}) error
}

func NewRedisClient

func NewRedisClient(cf *config.Config) (RedisInterface, error)

func NewRedisCluster

func NewRedisCluster(hosts []string, password string) RedisInterface

func NewRedisSingle

func NewRedisSingle(host, password string, db int) RedisInterface

Jump to

Keyboard shortcuts

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