v3

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RedisClusterSlots = 16384
)
View Source
const (
	SetNXCmdName = "SETNX"
)

Variables

View Source
var (
	ErrNil         = goredis.Nil
	ErrInvalidType = errors.New("redis: invalid type")
)

Functions

This section is empty.

Types

type Client

type Client interface {
	Close() error
	Check(context.Context) health.Status
	Stats() redis.PoolStats
	Scan(cursor uint64, key string, count int64) (uint64, []string, error)
	Get(key string) ([]byte, error)
	GetMulti(keys []string, ignoreNotFound bool) ([]interface{}, error)
	Set(key string, val interface{}, expiration time.Duration) error
	PFAdd(key string, els ...string) (int64, error)
	PFCount(keys ...string) (int64, error)
	PFMerge(dest string, expiration time.Duration, keys ...string) error
	IncrByFloat(key string, value float64) (float64, error)
	Del(key string) error
	Incr(key string) (int64, error)
	Pipeline(tx bool) PipeClient
	Expire(key string, expiration time.Duration) (bool, error)
	SetNX(ctx context.Context, key string, value interface{}, expiration time.Duration) (bool, error)
	Eval(ctx context.Context, script string, keys []string, args ...interface{}) *goredis.Cmd
	Dump(key string) (string, error)
	Restore(key string, ttl int64, value string) error
	Exists(key string) (int64, error)
}

func NewClient

func NewClient(addr string, opts ...Option) (Client, error)

type ClientType added in v0.4.9

type ClientType int
const (
	ClientTypeStandard ClientType = iota
	ClientTypeCluster
)

type Option

type Option func(*options)

func WithDialTimeout

func WithDialTimeout(dialTimeout time.Duration) Option

func WithLogger

func WithLogger(logger *zap.Logger) Option

func WithMaxRetries

func WithMaxRetries(maxRetries int) Option

func WithMetrics

func WithMetrics(r metrics.Registerer) Option

func WithMinIdleConns

func WithMinIdleConns(minIdleConns int) Option

func WithPassword

func WithPassword(password string) Option

func WithPoolSize

func WithPoolSize(poolSize int) Option

func WithPoolTimeout

func WithPoolTimeout(poolTimeout time.Duration) Option

func WithServerName

func WithServerName(serverName string) Option

type PipeClient added in v0.2.0

type PipeClient interface {
	PFAdd(key string, els ...string) *goredis.IntCmd
	Incr(key string) *goredis.IntCmd
	TTL(key string) *goredis.DurationCmd
	Exec() ([]goredis.Cmder, error)
	PFCount(keys ...string) *goredis.IntCmd
	Get(key string) *goredis.StringCmd
	Del(keys string) *goredis.IntCmd
}

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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