storage

package
v0.0.0-...-230af76 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2015 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package storage provides the persistence services for `flagon` using BoltDB for on-disk storage.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrPathEmpty is answered when a non-empty path was expected but
	// an empty path was given.
	ErrPathEmpty = errors.New("empty path given")

	// ErrPathNotAbsolute is answered when an absolute path was
	// expected but a relative path was given.
	ErrPathNotAbsolute = errors.New("given path is not an absolute one")
)
View Source
var (
	// ErrNameEmpty is answered when an unexpected empty name is
	// provided.
	ErrNameEmpty = errors.New("empty name given")
)

Functions

func InitDB

func InitDB(p string) error

InitDB creates and initialises a database inside the given base storage directory path. This path should be an absolute path.

Types

type DB

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

DB represents a BoltDB database. All of `flagon` uses a single database.

Internally, each entity type has its own bucket per namespace in which its instances have to be stored.

func DbInstance

func DbInstance() (*DB, error)

DbInstance opens the underlying BoltDB database, and answers the singleton DB instance.

func (*DB) Close

func (db *DB) Close() error

Close closes the underlying BoltDB database.

Jump to

Keyboard shortcuts

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