redis

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Set(ctx context.Context, key string, value interface{}, expiration time.Duration) *redis.StatusCmd
	Get(ctx context.Context, key string) *redis.StringCmd
	SetNX(ctx context.Context, key string, value interface{}, expiration time.Duration) *redis.BoolCmd
	Expire(ctx context.Context, key string, expiration time.Duration) *redis.BoolCmd
	Exists(ctx context.Context, keys ...string) *redis.IntCmd
	SetEX(ctx context.Context, key string, value interface{}, expiration time.Duration) *redis.StatusCmd
	TTL(ctx context.Context, key string) *redis.DurationCmd
	Del(ctx context.Context, keys ...string) *redis.IntCmd
}

func NewRedisClient

func NewRedisClient(client redis.Client) Client

func NewRedisClientFromOps

func NewRedisClientFromOps(ops *Option) Client

type Option

type Option struct {
	Address   string        `json:"address" yaml:"address"`
	IsCluster bool          `json:"is_cluster" yaml:"is_cluster"`
	UserName  string        `json:"user_name" yaml:"user_name"`
	Password  string        `json:"password" yaml:"password"`
	Timeout   time.Duration `json:"timeout" yaml:"timeout"`
}

Jump to

Keyboard shortcuts

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