hiredis

package
v0.0.0-...-4d64e5c Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Address    string           `json:"address"`
	Net        string           `json:"net"`
	DB         int              `json:"db"`
	Password   string           `json:"password"`
	Prefix     string           `json:"prefix"`
	Suffix     string           `json:"suffix"`
	Connection ConnectionConfig `json:"connection"`
}

type ConnectionConfig

type ConnectionConfig struct {
	MaxIdleConnections   int  `json:"max_idle_connections"`
	MaxActiveConnections int  `json:"max_active_connections"`
	ConnectTimeout       int  `json:"connect_timeout"`
	ReadTimeout          int  `json:"read_timeout"`
	IdleKeepAlive        int  `json:"idle_keep_alive"`
	MaxKeepAlive         int  `json:"max_keep_alive"`
	WaitForConnection    bool `json:"wait_for_connection"`
}

type MessageHandler

type MessageHandler func(channel string, event string)

type Redis

type Redis struct {
	// contains filtered or unexported fields
}

func NewRedis

func NewRedis(config *Config) *Redis

func (*Redis) Del

func (redis *Redis) Del(pattern string) error

func (*Redis) Expire

func (redis *Redis) Expire(key string, duration time.Duration) error

func (*Redis) Get

func (redis *Redis) Get(key string) (string, error)

func (*Redis) GetConfig

func (redis *Redis) GetConfig(config string) (string, error)

func (*Redis) GetHKeys

func (redis *Redis) GetHKeys(key string) ([]string, error)

func (*Redis) GetKeys

func (redis *Redis) GetKeys(pattern string) ([]string, error)

func (*Redis) HGet

func (redis *Redis) HGet(key string, hkey string) (string, error)

func (*Redis) HSet

func (redis *Redis) HSet(key string, hkey string, value string) error

func (*Redis) Persist

func (redis *Redis) Persist(key string) error

func (*Redis) Ping

func (redis *Redis) Ping() error

func (*Redis) SAdd

func (redis *Redis) SAdd(set string, member string) error

func (*Redis) SIsMember

func (redis *Redis) SIsMember(set string, member string) (bool, error)

func (*Redis) SMembers

func (redis *Redis) SMembers(set string) ([]string, error)

func (*Redis) SRem

func (redis *Redis) SRem(set string, member string) error

func (*Redis) Set

func (redis *Redis) Set(key string, value string) error

func (*Redis) SetConfig

func (redis *Redis) SetConfig(config string, value string) error

func (*Redis) SubscribeEvent

func (redis *Redis) SubscribeEvent(pattern string, onStart func(), onMessage func(channel string, data string), onError func(err error), quit chan *sync.WaitGroup)

func (*Redis) XAdd

func (redis *Redis) XAdd(stream string, kv StreamItem) (string, error)

func (*Redis) XRead

func (redis *Redis) XRead(streamID string, lastID string) ([]StreamItem, error)

type StreamItem

type StreamItem struct {
	ID    string
	Key   string
	Value string
}

Jump to

Keyboard shortcuts

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