data_store

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2014 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Data store functionality. For now, we're just keeping in memory, but optional use of a persistent storage backend eventually is on the list of things to do down the road. Using go-cache (https://github.com/pmylund/go-cache) for storing our data - might be worth using for normal caching later as well.

Index

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

func (*DataStore) Delete

func (ds *DataStore) Delete(key_type string, key string)

func (*DataStore) Get

func (ds *DataStore) Get(key_type string, key string) (interface{}, bool)

func (*DataStore) GetList

func (ds *DataStore) GetList(key_type string) []string

Return a list of all objects of the given type.

func (*DataStore) Load added in v0.3.0

func (ds *DataStore) Load(dsFile string) error

Load the frozen data store from disk.

func (*DataStore) Save added in v0.3.0

func (ds *DataStore) Save(dsFile string) error

Freeze and save the data store to disk.

func (*DataStore) Set

func (ds *DataStore) Set(key_type string, key string, val interface{})

Jump to

Keyboard shortcuts

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