redis

package
v0.0.0-...-d5ac831 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NodeType    = "ClusterType"
	ClusterType = "Type"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	red.Cmdable
	io.Closer
}

Client interface represents a redis node.

type Hook

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

func (*Hook) AfterProcess

func (h *Hook) AfterProcess(ctx context.Context, cmd redis.Cmder) error

func (*Hook) AfterProcessPipeline

func (h *Hook) AfterProcessPipeline(_ context.Context, _ []redis.Cmder) error

func (*Hook) BeforeProcess

func (h *Hook) BeforeProcess(ctx context.Context, _ redis.Cmder) (context.Context, error)

func (*Hook) BeforeProcessPipeline

func (h *Hook) BeforeProcessPipeline(ctx context.Context, _ []redis.Cmder) (context.Context, error)

type Option

type Option func(opt *option)

func WithClusterType

func WithClusterType() Option

func WithNodeType

func WithNodeType() Option

type Redis

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

func New

func New(addr string, opts ...Option) *Redis

New returns a Redis with given options.

func (*Redis) Close

func (r *Redis) Close() error

func (*Redis) Del

func (r *Redis) Del(ctx context.Context, keys ...string) (val int, err error)

Del deletes keys.

func (*Redis) Hdel

func (r *Redis) Hdel(ctx context.Context, key string, fields ...string) (val bool, err error)

Hdel is the implementation of redis hdel command.

func (*Redis) Hgetall

func (r *Redis) Hgetall(ctx context.Context, key string) (val map[string]string, err error)

Hgetall is the implementation of redis hgetall command.

func (*Redis) Hmget

func (r *Redis) Hmget(ctx context.Context, key string, fields ...string) (val []interface{}, err error)

Hmget is the implementation of redis hmget command.

func (*Redis) Hmset

func (r *Redis) Hmset(ctx context.Context, key string, fieldsAndValues map[string]interface{}) error

Hmset is the implementation of redis hmset command.

func (*Redis) Hscan

func (r *Redis) Hscan(ctx context.Context, key string, cursor uint64, match string, count int64) (keys []string, cur uint64, err error)

Hscan is the implementation of redis hscan command.

func (*Redis) Hset

func (r *Redis) Hset(ctx context.Context, key, field string, value interface{}) error

Hset is the implementation of redis hset command.

func (*Redis) Llen

func (r *Redis) Llen(ctx context.Context, key string) (val int, err error)

Llen is the implementation of redis llen command.

func (*Redis) Lrange

func (r *Redis) Lrange(ctx context.Context, key string, start, stop int) (val []string, err error)

Lrange is the implementation of redis lrange command.

func (*Redis) Lrem

func (r *Redis) Lrem(ctx context.Context, key string, count int, value interface{}) (val int, err error)

Lrem is the implementation of redis lrem command.

func (*Redis) Lset

func (r *Redis) Lset(ctx context.Context, key string, index int64, value interface{}) (val string, err error)

Lset is the implementation of redis lset command.

func (*Redis) Ping

func (r *Redis) Ping(ctx context.Context) error

func (*Redis) Rpush

func (r *Redis) Rpush(ctx context.Context, key string, values ...interface{}) (val int, err error)

Rpush is the implementation of redis rpush command.

func (*Redis) Scan

func (r *Redis) Scan(ctx context.Context, cursor uint64, match string, count int64) (keys []string, cur uint64, err error)

Scan is the implementation of redis scan command.

type Type

type Type string

func (Type) String

func (r Type) String() string

Jump to

Keyboard shortcuts

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