db

package
v0.0.0-...-ff4f71a Latest Latest
Warning

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

Go to latest
Published: May 10, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	BasePath string
}

func Create

func Create(inPath string) (*Controller, error)

Create a new hitch db. Makes a dir; the name itself is the sigil.

func LoadByCwd

func LoadByCwd() (*Controller, error)

func LoadByPath

func LoadByPath(startPath string) (*Controller, error)

func (*Controller) LoadCatalog

func (dbctrl *Controller) LoadCatalog(catalogName api.CatalogName) (api.Catalog, error)

Load a catalog object from the db.

This only loads the core catalog data -- names, releases, items, metadata. The replay info is *null* -- the replay info is not loaded by default, because that stuff may be much larger than many callers need; use the other db methods to ask for it explicitly.

func (*Controller) SaveCatalog

func (dbctrl *Controller) SaveCatalog(catalog api.Catalog) error

Save a catalog object into the db.

If the extended fields (e.g. replay) are set, they will also be saved; if absent, those components on disk will not be modified.

type ErrorCategory

type ErrorCategory string
const (
	ErrNotFound       ErrorCategory = "ErrNotFound"
	ErrIO             ErrorCategory = "ErrIO"
	ErrStorageCorrupt ErrorCategory = "ErrStorageCorrupt"
)

Jump to

Keyboard shortcuts

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