Documentation ¶
Index ¶
- Constants
- func NewContainerStore(tx *bolt.Tx) containers.Store
- func NewImageStore(db *DB) images.Store
- func NewNamespaceStore(tx *bolt.Tx) namespaces.Store
- func WithTransactionContext(ctx context.Context, tx *bolt.Tx) context.Context
- type DB
- func (m *DB) ContentStore() content.Store
- func (m *DB) GarbageCollect(ctx context.Context) (gc.Stats, error)
- func (m *DB) Init(ctx context.Context) error
- func (m *DB) RegisterMutationCallback(fn func(bool))
- func (m *DB) Snapshotter(name string) snapshots.Snapshotter
- func (m *DB) Snapshotters() map[string]snapshots.Snapshotter
- func (m *DB) Update(fn func(*bolt.Tx) error) error
- func (m *DB) View(fn func(*bolt.Tx) error) error
- type GCStats
- type LeaseManager
Constants ¶
const ( // ResourceUnknown specifies an unknown resource ResourceUnknown gc.ResourceType = iota // ResourceContent specifies a content resource ResourceContent // ResourceSnapshot specifies a snapshot resource ResourceSnapshot // ResourceContainer specifies a container resource ResourceContainer // ResourceTask specifies a task resource ResourceTask // ResourceLease specifies a lease ResourceLease // ResourceIngest specifies a content ingest ResourceIngest )
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 ¶
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 ¶
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 ¶
NewDB creates a new metadata database using the provided bolt database, content store, and snapshotters.
func (*DB) ContentStore ¶
ContentStore returns a namespaced content store proxied to a content store.
func (*DB) GarbageCollect ¶
GarbageCollect starts garbage collection
func (*DB) Init ¶
Init ensures the database is at the correct version and performs any needed migrations.
func (*DB) RegisterMutationCallback ¶
RegisterMutationCallback registers a function to be called after a metadata mutations has been performed.
The callback function is an argument for whether a deletion has occurred since the last garbage collection.
func (*DB) Snapshotter ¶
func (m *DB) Snapshotter(name string) snapshots.Snapshotter
Snapshotter returns a namespaced content store for the requested snapshotter name proxied to a snapshotter.
func (*DB) Snapshotters ¶
func (m *DB) Snapshotters() map[string]snapshots.Snapshotter
Snapshotters returns all available snapshotters.
type GCStats ¶
type GCStats struct { MetaD time.Duration ContentD time.Duration SnapshotD map[string]time.Duration }
GCStats holds the duration for the different phases of the garbage collector
type LeaseManager ¶
type LeaseManager struct {
// contains filtered or unexported fields
}
LeaseManager manages the create/delete lifecyle of leases and also returns existing leases
func NewLeaseManager ¶
func NewLeaseManager(tx *bolt.Tx) *LeaseManager
NewLeaseManager creates a new lease manager for managing leases using the provided database transaction.