storage

package
Version: v2.0.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDir

func CreateDir(path string) error

CreateDir create a directory recursively

func GetInstancesDataPath

func GetInstancesDataPath(name string, cfg *model.Config) string

GetInstancesDataPath return the path where instance data is stored

func GetStorePath

func GetStorePath(name string, cfg *model.Config) string

GetStorePath return the path where instance data is stored

func PathExists

func PathExists(path string) (bool, error)

PathExists check if a path exists

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store abstract a simple store

func GetStore

func GetStore(collection string, cfg *model.Config) *Store

GetStore return the store instance

func NewStore

func NewStore(collection string, path string) *Store

NewStore create a new storage

func (Store) Delete

func (s Store) Delete(id string) error

Delete a record

func (Store) List

func (s Store) List() ([]string, error)

List all records

func (Store) Load

func (s Store) Load(id string, result interface{}) error

Load a record

func (Store) Save

func (s Store) Save(id string, record interface{}) error

Save a record

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL