redis

package module
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("redis: key not found")
)

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(cfg *Config) (*Client, error)

func (*Client) BFAdd added in v0.0.8

func (client *Client) BFAdd(ctx context.Context, key string, members interface{}) error

func (*Client) BFExists added in v0.0.8

func (client *Client) BFExists(ctx context.Context, key string, members interface{}) (bool, error)

func (*Client) BFMAdd added in v0.0.8

func (client *Client) BFMAdd(ctx context.Context, key string, members ...interface{}) error

func (*Client) BFMExists added in v0.0.8

func (client *Client) BFMExists(ctx context.Context, key string, members ...interface{}) ([]bool, error)

func (*Client) BFReserve added in v0.0.8

func (client *Client) BFReserve(ctx context.Context, key string, size int64, errorRate float64) error

func (*Client) Client added in v0.0.10

func (client *Client) Client() goredis.Cmdable

func (*Client) Decr added in v0.0.2

func (client *Client) Decr(ctx context.Context, key string) (int64, error)

func (*Client) DecrEx added in v0.0.2

func (client *Client) DecrEx(ctx context.Context, key string, ttl int) (int64, error)

func (*Client) Del

func (client *Client) Del(ctx context.Context, key string) error

func (*Client) Expire

func (client *Client) Expire(ctx context.Context, key string, ttl int) error

func (*Client) Get

func (client *Client) Get(ctx context.Context, key string, v interface{}) error

func (*Client) GetStr

func (client *Client) GetStr(ctx context.Context, key string) (string, error)

func (*Client) HDel added in v0.0.8

func (client *Client) HDel(ctx context.Context, key string, field string) error

func (*Client) HExists added in v0.0.8

func (client *Client) HExists(ctx context.Context, key string, field string) (bool, error)

func (*Client) HGet added in v0.0.8

func (client *Client) HGet(ctx context.Context, key string, field string) (string, error)

func (*Client) HGetAll added in v0.0.8

func (client *Client) HGetAll(ctx context.Context, key string) (map[string]string, error)

func (*Client) HGetI added in v0.0.9

func (client *Client) HGetI(ctx context.Context, key string, field string) (int64, error)

func (*Client) HIncrBy added in v0.0.8

func (client *Client) HIncrBy(ctx context.Context, key string, field string, value int64) (int64, error)

func (*Client) HKeys added in v0.0.8

func (client *Client) HKeys(ctx context.Context, key string) ([]string, error)

func (*Client) HLen added in v0.0.8

func (client *Client) HLen(ctx context.Context, key string) (int64, error)

func (*Client) HSet added in v0.0.8

func (client *Client) HSet(ctx context.Context, key string, field string, value interface{}) error

func (*Client) HSetEx added in v0.0.8

func (client *Client) HSetEx(ctx context.Context, key string, field string, value interface{}, ttl int) error

func (*Client) HSetNX added in v0.0.8

func (client *Client) HSetNX(ctx context.Context, key string, field string, value interface{}) (bool, error)

func (*Client) HSetNXEx added in v0.0.8

func (client *Client) HSetNXEx(ctx context.Context, key string, field string, value interface{}, ttl int) (bool, error)

func (*Client) Incr added in v0.0.2

func (client *Client) Incr(ctx context.Context, key string) (int64, error)

func (*Client) IncrEx added in v0.0.2

func (client *Client) IncrEx(ctx context.Context, key string, ttl int) (int64, error)

func (*Client) SAdd

func (client *Client) SAdd(ctx context.Context, key string, members ...interface{}) error

func (*Client) SCard added in v0.0.6

func (client *Client) SCard(ctx context.Context, key string) int64

func (*Client) SIsMember

func (client *Client) SIsMember(ctx context.Context, key string, member interface{}) (bool, error)

func (*Client) SMembers added in v0.0.5

func (client *Client) SMembers(ctx context.Context, key string) []string

func (*Client) SRem

func (client *Client) SRem(ctx context.Context, key string, members ...interface{}) error

func (*Client) Set

func (client *Client) Set(ctx context.Context, key string, v interface{}, ttl int) error

func (*Client) SetEx

func (client *Client) SetEx(ctx context.Context, key string, v interface{}, ttl int) (string, error)

func (*Client) SetNX added in v0.0.3

func (client *Client) SetNX(ctx context.Context, key string, v interface{}, ttl int) (bool, error)

func (*Client) SetNXEx added in v0.0.3

func (client *Client) SetNXEx(ctx context.Context, key string, v interface{}, ttl int) (bool, string, error)

func (*Client) SetNXStr

func (client *Client) SetNXStr(ctx context.Context, key string, v string, ttl int) (bool, error)

func (*Client) SetStr

func (client *Client) SetStr(ctx context.Context, key string, v string, ttl int) error

func (*Client) TTL

func (client *Client) TTL(ctx context.Context, key string) (time.Duration, error)

func (*Client) ZAddMember added in v0.0.10

func (client *Client) ZAddMember(ctx context.Context, key string, member interface{}, score float64) error

func (*Client) ZRangeWithScores added in v0.0.10

func (client *Client) ZRangeWithScores(ctx context.Context, key string, start int64, stop int64) ([]goredis.Z, error)

type Config

type Config struct {
	Addresses []string `mapstructure:"addresses" json:"addresses" yaml:"addresses"`
	Password  string   `mapstructure:"password" json:"password" yaml:"password"`
	DB        int      `mapstructure:"database" json:"database" yaml:"database"`
	Prefix    string   `mapstructure:"prefix" json:"prefix" yaml:"prefix"`
}

Jump to

Keyboard shortcuts

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