store

package
v1.0.12-rc1 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2018 License: MIT Imports: 7 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Errors returned by KeyValueStore methods.
	ErrKeyNotFound    = fmt.Errorf("Key not found")
	ErrStoreLocked    = fmt.Errorf("Store is locked")
	ErrStoreNotLocked = fmt.Errorf("Store is not locked")
)

Functions

This section is empty.

Types

type KeyValueStore

type KeyValueStore interface {
	Read(key string, value interface{}) error
	Write(key string, value interface{}) error
	Flush() error
	Lock(block bool) error
	Unlock() error
	GetModificationTime() (time.Time, error)
}

KeyValueStore represents a persistent store of (key,value) pairs.

func NewJsonFileStore

func NewJsonFileStore(fileName string) (KeyValueStore, error)

NewJsonFileStore creates a new jsonFileStore object, accessed as a KeyValueStore.

Jump to

Keyboard shortcuts

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