bolt

package
v0.0.0-...-063aa45 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DS = func() *DataStore {
		dir := os.Getenv("MARGO_DATA_DIR")
		if dir == "" {
			d, err := ioutil.TempDir("", "margo.data~fallback~")
			if err != nil {
				panic("MARGO_DATA_DIR is not defined and ioutill.TempDir failed: " + err.Error())
			}
			dir = d
		}

		return &DataStore{
			Path:   filepath.Join(dir, "bolt.ds"),
			Handle: &codec.MsgpackHandle{},
			Bucket: []byte("ds"),
		}
	}()
)

Functions

This section is empty.

Types

type DataStore

type DataStore struct {
	Bucket []byte
	Handle codec.Handle
	Path   string
	// contains filtered or unexported fields
}

func (*DataStore) Delete

func (ds *DataStore) Delete(key interface{}) error

func (*DataStore) Load

func (ds *DataStore) Load(key, ptr interface{}) error

func (*DataStore) Store

func (ds *DataStore) Store(key, val interface{}) error

Jump to

Keyboard shortcuts

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