store

package
v0.0.0-...-817c61a Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2018 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LocalStore

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

LocalStore is a local disk store

func NewLocalStore

func NewLocalStore(root string) (*LocalStore, error)

NewLocalStore returns a local store based at the root directory

func (*LocalStore) Load

func (m *LocalStore) Load(key string, thing interface{}) error

Load loads data from the key

func (*LocalStore) Save

func (m *LocalStore) Save(key string, data interface{}) error

Save saves the data at the key

type MemStore

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

MemStore is a simple in memory key value store

func NewMemStore

func NewMemStore() *MemStore

NewMemStore returns an initialised MemStore

func (*MemStore) Load

func (m *MemStore) Load(key string, thing interface{}) error

Load loads data from the key

func (*MemStore) Save

func (m *MemStore) Save(key string, data interface{}) error

Save saves the data at the key

type Store

type Store interface {
	Save(key string, data interface{}) error
	Load(key string, thing interface{}) error
}

Store links events to the config rules

Jump to

Keyboard shortcuts

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