redis

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrKeyNotFound = errors.New("key not found")

Functions

This section is empty.

Types

type Redis

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

func NewClient

func NewClient(ctx context.Context, url string) (*Redis, error)

func (*Redis) Delete

func (r *Redis) Delete(ctx context.Context, key string) error

Delete deletes a value by the key.

func (*Redis) Get

func (r *Redis) Get(ctx context.Context, key string, receiver interface{}) error

Get reads a value by the key.

func (*Redis) IsAvailable

func (r *Redis) IsAvailable(ctx context.Context) bool

func (*Redis) Reconnect

func (r *Redis) Reconnect(ctx context.Context, host string) error

func (*Redis) Set

func (r *Redis) Set(ctx context.Context, key string, value interface{}, expiration time.Duration) error

Set sets a vlue by the key.

Jump to

Keyboard shortcuts

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