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 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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