redis

package
v0.0.0-...-1081ff4 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const RedisPrefix = "vods-api:"

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) Get

func (r *RedisInst) Get(ctx context.Context, key string) (interface{}, 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) 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

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