badgerrediscache

package
v0.0.0-...-7e31768 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2017 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PluginConfig = &badgerRedisCacheConfig{
		done: make(chan struct{}),
	}
)

Config ...

Functions

This section is empty.

Types

type Cache

type Cache struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Cache stores and retrieves data using Badger KV.

func Mount

func Mount(client *badger.DB) *Cache

func New

func New(config *Config) (*Cache, error)

func (*Cache) Close

func (c *Cache) Close() error

Close closes the underlying boltdb database.

func (*Cache) Delete

func (c *Cache) Delete(key string)

Delete key from the cache

func (*Cache) Get

func (c *Cache) Get(key string) (resp []byte, ok bool)

func (*Cache) Set

func (c *Cache) Set(key string, resp []byte)

Set stores a response to the cache at the given key.

type Config

type Config struct {
	StoragePath string
	ValueDir    string
	SyncWrites  bool
	Debug       bool
}

Jump to

Keyboard shortcuts

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