cache

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Nil = errors.New("key does not exist in cache")

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Set(ctx context.Context, key string, value interface{}, expiration time.Duration) error
	Get(ctx context.Context, key string) (interface{}, error)
	Del(ctx context.Context, key string) error
}

func NewRedisCache

func NewRedisCache(connURL string) (Cache, error)

type RedisCache

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

func (*RedisCache) Del

func (rc *RedisCache) Del(ctx context.Context, key string) error

func (*RedisCache) Get

func (rc *RedisCache) Get(ctx context.Context, key string) (interface{}, error)

func (*RedisCache) Set

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

Directories

Path Synopsis
Package mockcache is a generated GoMock package.
Package mockcache is a generated GoMock package.

Jump to

Keyboard shortcuts

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