redis

package
v0.0.0-...-84b72f1 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoRows = redis.Nil
)

Functions

This section is empty.

Types

type Cache

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

func New

func New(ctx context.Context, cfg *Config) (*Cache, error)

func (*Cache) Close

func (c *Cache) Close()

func (*Cache) Del

func (c *Cache) Del(
	ctx context.Context,
	ns string,
	key string,
) *redis.IntCmd

func (*Cache) Get

func (c *Cache) Get(
	ctx context.Context,
	ns string,
	key string,
) *redis.StringCmd

func (*Cache) Set

func (c *Cache) Set(
	ctx context.Context,
	ns string,
	key string,
	value interface{},
	expiration time.Duration,
) *redis.StatusCmd

func (*Cache) TTL

func (c *Cache) TTL(
	ctx context.Context,
	ns string,
	key string,
) *redis.DurationCmd

type Config

type Config struct {
	Host        string
	Port        string
	Username    string
	Password    string
	TLSDisabled bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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