store

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2022 License: MIT Imports: 8 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.

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.

func SQLiteStore added in v0.1.0

func SQLiteStore(ctx context.Context, db *sql.DB) (Store, error)

SQLiteStore creates a SQLite data store.

Jump to

Keyboard shortcuts

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