redis

package
v0.0.0-...-f537024 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const RedisPrefix = "discord-bot:"

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, opts SetupOptions) (instance.Redis, error)

Types

type RedisInst

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

func (*RedisInst) Del

func (r *RedisInst) Del(ctx context.Context, key string) (int, error)

func (*RedisInst) Exists

func (r *RedisInst) Exists(ctx context.Context, key string) (bool, error)

func (*RedisInst) Expire

func (r *RedisInst) Expire(ctx context.Context, key string, ttl time.Duration) error

func (*RedisInst) Get

func (r *RedisInst) Get(ctx context.Context, key string) (string, error)

func (*RedisInst) Ping

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

func (*RedisInst) Pipeline

func (r *RedisInst) Pipeline(ctx context.Context) redis.Pipeliner

func (*RedisInst) SAdd

func (r *RedisInst) SAdd(ctx context.Context, key string, value string) error

func (*RedisInst) Set

func (r *RedisInst) Set(ctx context.Context, key string, value string) error

func (*RedisInst) SetEX

func (r *RedisInst) SetEX(ctx context.Context, key string, value interface{}, ttl time.Duration) error

func (*RedisInst) SetNX

func (r *RedisInst) SetNX(ctx context.Context, key string, value interface{}, ttl time.Duration) (bool, error)

func (*RedisInst) Subscribe

func (r *RedisInst) Subscribe(ctx context.Context, ch chan string, subscribeTo ...string)

Subscribe to a channel on Redis

func (*RedisInst) TTL

func (r *RedisInst) TTL(ctx context.Context, key string) (time.Duration, error)

type SetupOptions

type SetupOptions struct {
	Username   string
	Password   string
	MasterName string
	Database   int

	Addresses []string
	Sentinel  bool
}

Jump to

Keyboard shortcuts

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