Documentation ¶
Overview ¶
Package bolt implements inmem resource collection backing store in BoltDB (github.com/etcd-io/bbolt).
Example ¶
Output: example-resource-id error getting resource: resource testResource(persistent/non-existent-resource@undefined) doesn't exist
Index ¶
- type BackingStore
- type NamespacedBackingStore
- func (store *NamespacedBackingStore) Destroy(_ context.Context, resourceType resource.Type, ptr resource.Pointer) error
- func (store *NamespacedBackingStore) Load(_ context.Context, handler inmem.LoadHandler) error
- func (store *NamespacedBackingStore) Put(_ context.Context, resourceType resource.Type, res resource.Resource) error
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackingStore ¶
type BackingStore struct {
// contains filtered or unexported fields
}
BackingStore implements inmem.BackingStore using BoltDB.
Layout of the database:
-> top-level bucket: $namespace -> bucket: $resourceType -> key: $resourceID -> value: marshaled resource
func NewBackingStore ¶
func NewBackingStore(opener func() (*bbolt.DB, error), marshaler store.Marshaler) (*BackingStore, error)
NewBackingStore opens the BoltDB store with the given marshaler.
func (*BackingStore) WithNamespace ¶
func (store *BackingStore) WithNamespace(namespace resource.Namespace) *NamespacedBackingStore
WithNamespace returns an implementation of inmem.BackingStore interface for a given namespace.
type NamespacedBackingStore ¶
type NamespacedBackingStore struct {
// contains filtered or unexported fields
}
NamespacedBackingStore implements inmem.BackingStore for a given namespace.
func (*NamespacedBackingStore) Destroy ¶
func (store *NamespacedBackingStore) Destroy(_ context.Context, resourceType resource.Type, ptr resource.Pointer) error
Destroy implements inmem.BackingStore.
func (*NamespacedBackingStore) Load ¶
func (store *NamespacedBackingStore) Load(_ context.Context, handler inmem.LoadHandler) error
Load implements inmem.BackingStore.
Click to show internal directories.
Click to hide internal directories.