redis

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: MIT Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisCacher

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

func NewRedisCacher

func NewRedisCacher(client redis.UniversalClient) *RedisCacher

func (*RedisCacher) Bytes

func (c *RedisCacher) Bytes(ctx context.Context, key string) (bytes []byte, err error)

Bytes implements cache.Cacher

func (*RedisCacher) BytesMany

func (c *RedisCacher) BytesMany(
	ctx context.Context,
	keys ...string,
) (map[string][]byte, error)

BytesMany implements cache.Cacher

func (*RedisCacher) Close

func (c *RedisCacher) Close() (err error)

Close implements cache.Cacher

func (*RedisCacher) Delete

func (c *RedisCacher) Delete(ctx context.Context, key string) (err error)

Delete implements cache.Cacher

func (*RedisCacher) DeleteMany

func (c *RedisCacher) DeleteMany(ctx context.Context, keys ...string) (err error)

func (*RedisCacher) Exists

func (c *RedisCacher) Exists(ctx context.Context, key string) (has bool, err error)

Exists implements cache.Cacher

func (*RedisCacher) Instance

func (c *RedisCacher) Instance() redis.UniversalClient

Instance returns the underlying cache interface.

func (*RedisCacher) Set

func (c *RedisCacher) Set(
	ctx context.Context,
	key string,
	bytes []byte,
	duration time.Duration,
) (err error)

Set implements cache.Cacher

func (*RedisCacher) SetMany

func (c *RedisCacher) SetMany(
	ctx context.Context,
	items map[string][]byte,
) (err error)

SetMany implements cache.Cacher

func (*RedisCacher) SetManyExp

func (c *RedisCacher) SetManyExp(
	ctx context.Context,
	items map[string][]byte,
	duration time.Duration,
) (err error)

SetManyExp implements cache.Cacher

Jump to

Keyboard shortcuts

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