redis

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(rdc *redis.Client) cache.Cache

Types

type Redis

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

func (*Redis) ClearAll added in v0.0.6

func (e *Redis) ClearAll(ctx context.Context) error

func (*Redis) Decr added in v0.0.6

func (e *Redis) Decr(ctx context.Context, key string) error

Decrement a cached int value by key, as a counter.

func (*Redis) Delete

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

Delete removes a key from cache.

func (*Redis) Fetch added in v0.0.6

func (e *Redis) Fetch(ctx context.Context, key []string) ([]any, error)

Batch of get

func (*Redis) Get

func (e *Redis) Get(ctx context.Context, key string) (any, error)

func (*Redis) Incr added in v0.0.6

func (e *Redis) Incr(ctx context.Context, key string) error

func (*Redis) IsExist added in v0.0.6

func (e *Redis) IsExist(ctx context.Context, key string) (bool, error)

func (*Redis) Put

func (e *Redis) Put(ctx context.Context, key string, value any, timeout ...time.Duration) error

Jump to

Keyboard shortcuts

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