metadata

package
v1.0.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2017 License: Apache-2.0, CC-BY-SA-4.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResourceUnknown gc.ResourceType = iota
	ResourceContent
	ResourceSnapshot
	ResourceContainer
	ResourceTask
)

Variables

This section is empty.

Functions

func NewContainerStore

func NewContainerStore(tx *bolt.Tx) containers.Store

NewContainerStore returns a Store backed by an underlying bolt DB

func NewImageStore

func NewImageStore(tx *bolt.Tx) images.Store

NewImageStore returns a store backed by a bolt DB

func NewNamespaceStore

func NewNamespaceStore(tx *bolt.Tx) namespaces.Store

NewNamespaceStore returns a store backed by a bolt DB

func WithTransactionContext

func WithTransactionContext(ctx context.Context, tx *bolt.Tx) context.Context

WithTransactionContext returns a new context holding the provided bolt transaction. Functions which require a bolt transaction will first check to see if a transaction is already created on the context before creating their own.

Types

type DB

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

DB represents a metadata database backed by a bolt database. The database is fully namespaced and stores image, container, namespace, snapshot, and content data while proxying data shared across namespaces to backend datastores for content and snapshots.

func NewDB

func NewDB(db *bolt.DB, cs content.Store, ss map[string]snapshot.Snapshotter) *DB

NewDB creates a new metadata database using the provided bolt database, content store, and snapshotters.

func (*DB) ContentStore

func (m *DB) ContentStore() content.Store

ContentStore returns a namespaced content store proxied to a content store.

func (*DB) GarbageCollect

func (m *DB) GarbageCollect(ctx context.Context) error

func (*DB) Init

func (m *DB) Init(ctx context.Context) error

Init ensures the database is at the correct version and performs any needed migrations.

func (*DB) Snapshotter

func (m *DB) Snapshotter(name string) snapshot.Snapshotter

Snapshotter returns a namespaced content store for the requested snapshotter name proxied to a snapshotter.

func (*DB) Update

func (m *DB) Update(fn func(*bolt.Tx) error) error

Update runs a writable transation on the metadata store.

func (*DB) View

func (m *DB) View(fn func(*bolt.Tx) error) error

View runs a readonly transaction on the metadata store.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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