redis

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	cache.Cache
	Exists(key string) (bool, error)
	SetOpt(key string, value interface{}, options SetOptions) (bool, error)
	Del(key string) error
	Incr(key string) (int64, error)
}

func New

func New(conf RedisConfig) Cache

type PubSub

type PubSub interface {
	Cache
	PSubscribe(patterns []string) (SubChan, error)
	PUnsubscribe(sub SubChan) error
	Publish(key string, data []byte) error
}

func NewPubSub

func NewPubSub(conf RedisConfig) (PubSub, error)

type RedisConfig

type RedisConfig struct {
	Endpoint       string
	ClusterMode    bool
	KeyNamespace   string
	TimeTracker    TimeTracker
	MaxIdleConns   int
	MaxActiveConns int
}

type SetOptions

type SetOptions struct {
	ExpireIn   time.Duration
	IfNotExist bool
}

type SubChan

type SubChan <-chan []byte

type TimeTracker

type TimeTracker func(kpiName string, startTime time.Time)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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