redis

package
v0.0.0-...-ab943b8 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Set

func Set(name string, client *Client)

注册

Types

type Client

type Client struct {
	Pool *redis.Pool
}

func Get

func Get(name string) *Client

获取

func NewClient

func NewClient(host string, port int, db int, password string) *Client

func (*Client) Exec

func (o *Client) Exec(cmd string, key interface{}, args ...interface{}) (interface{}, error)

func (*Client) Get

func (o *Client) Get(key string) string

func (*Client) HGetAll

func (o *Client) HGetAll(key string) map[string]string

type RedisService

type RedisService struct {
	Conn        redis.Conn
	PubSubConn  redis.PubSubConn
	PubSubCbMap map[string]func(channel, message string)
}

func NewRedisService

func NewRedisService() *RedisService

func (*RedisService) Startup

func (o *RedisService) Startup(ip string, port int32) error

func (*RedisService) Subscribe

func (o *RedisService) Subscribe(channel interface{}, cb func(channel, message string)) error

Jump to

Keyboard shortcuts

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