store

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

ErrNotFound indicates that key not found in the store.

Functions

This section is empty.

Types

type Store

type Store interface {
	Get(ctx context.Context, key string) ([]byte, error)
	Set(ctx context.Context, key string, data []byte) error
	Delete(ctx context.Context, key string) error
	Clear(ctx context.Context) error
}

Store is the interface implemented by types that can be data storage for cache.

func BigcacheStore added in v0.0.8

func BigcacheStore(bc *bigcache.BigCache) Store

BigcacheStore creates a Bigcache data store. See Bigcache docs https://github.com/allegro/bigcache.

func MapStore

func MapStore(size int) Store

MapStore creates a store that is like a Go map but is safe for concurrent use by multiple goroutines.

func RedisStore added in v0.0.8

func RedisStore(rdb *redis.Client) Store

RedisStore creates a Redis data store. See Redis docs https://github.com/go-redis/redis

Jump to

Keyboard shortcuts

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