storage

package
v0.0.0-...-71c1a82 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	KeyNotFound = errors.New("key not found")
	KeyExpired  = errors.New("key has expired")
)

Functions

This section is empty.

Types

type Store

type Store interface {
	Get(key string) (string, uint64, error)

	Set(key string, value string) error
	SetExpiring(key string, value string, lifetime time.Duration) error

	Delete(key string) error

	Len() int
	Keys(callback func(key string) bool)
}

func NewBadgerDb

func NewBadgerDb(logger badger.Logger, storagePath string) (Store, error)

func NewSyncMap

func NewSyncMap(logger *log.Logger) Store

Jump to

Keyboard shortcuts

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