redis

package
v0.0.0-...-a65505b Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

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) 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) (interface{}, error)

func (*RedisInst) Ping

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

func (*RedisInst) Publish

func (r *RedisInst) Publish(ctx context.Context, channel string, content string) error

func (*RedisInst) RawClient

func (r *RedisInst) RawClient() *redis.Client

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 string, ttl time.Duration) error

func (*RedisInst) SetNX

func (r *RedisInst) SetNX(ctx context.Context, key string, value string, 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