Documentation ¶
Overview ¶
Package data_store provides data store functionality. The data store is kept in memory, but optionally the data store may be saved to a file to provide a perisistent data store. This uses go-cache (https://github.com/pmylund/go-cache) for storing the data.
The methods that set, get, and delete key/value pairs also take a `key_type` argument that specifies what kind of object it is.
Index ¶
- func WalkMapForNil(r interface{}) interface{}
- type DataStore
- func (ds *DataStore) Delete(key_type string, key string)
- func (ds *DataStore) Get(key_type string, key string) (interface{}, bool)
- func (ds *DataStore) GetList(key_type string) []string
- func (ds *DataStore) Load(dsFile string) error
- func (ds *DataStore) Save(dsFile string) error
- func (ds *DataStore) Set(key_type string, key string, val interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WalkMapForNil ¶ added in v0.3.0
func WalkMapForNil(r interface{}) interface{}
Walk through the given map, searching for nil slices to create. This does not handle all possible cases, but it *does* handle the cases found with the chef objects in goiardi.
Types ¶
type DataStore ¶
type DataStore struct {
// contains filtered or unexported fields
}
Main data store.
func New ¶
func New() *DataStore
Create a new data store instance, or return an already created one.
Click to show internal directories.
Click to hide internal directories.