Documentation
¶
Index ¶
- Variables
- type AccessBlockStoreFunc
- type Constructor
- type LookupBlockStore
- type LookupBlockStoreValue
- func ExLookupBlockStores(ctx context.Context, b bus.Bus, blockStoreId string, waitOne bool) ([]LookupBlockStoreValue, directive.Instance, directive.Reference, error)
- func ExLookupFirstBlockStore(ctx context.Context, b bus.Bus, blockStoreId string, returnIfIdle bool, ...) (LookupBlockStoreValue, directive.Instance, directive.Reference, error)
- type Store
Constants ¶
This section is empty.
Variables ¶
var ( // ErrBlockStoreIDEmpty is returned if the block store id was empty. ErrBlockStoreIDEmpty = errors.New("block store id cannot be empty") // ErrBlockStoreNotFound is returned if the block store was not found. ErrBlockStoreNotFound = errors.New("block store not found") // ErrReadOnly is returned if the block store is not writable. ErrReadOnly = errors.New("block store is read-only") )
Functions ¶
This section is empty.
Types ¶
type AccessBlockStoreFunc ¶
AccessBlockStoreFunc is a function to access a BlockStoreHandle. Optionally pass a released function that may be called when the handle was released. Returns a release function.
func NewAccessBlockStoreViaBusFunc ¶
func NewAccessBlockStoreViaBusFunc(b bus.Bus, blockStoreID string, returnIfIdle bool) AccessBlockStoreFunc
NewAccessBlockStoreViaBusFunc builds a new func which accesses the BlockStore on the given bus using the LookupBlocKStore directive.
If returnIfIdle is set: ErrBlockStoreNotFound is returned if not found.
type Constructor ¶
Constructor constructs a block store with common parameters.
type LookupBlockStore ¶
type LookupBlockStore interface {
// Directive indicates LookupBlockStore is a directive.
directive.Directive
// LookupBlockStoreId is the block store id to lookup.
// If empty, returns all block stores on the bus.
LookupBlockStoreId() string
}
LookupBlockStore is a directive to lookup a block store.
func NewLookupBlockStore ¶
func NewLookupBlockStore(blockStoreId string) LookupBlockStore
NewLookupBlockStore constructs a new LookupBlockStore directive.
type LookupBlockStoreValue ¶
type LookupBlockStoreValue = Store
LookupBlockStoreValue is the result type for LookupBlockStore. Multiple results may be pushed to the directive.
func ExLookupBlockStores ¶
func ExLookupBlockStores( ctx context.Context, b bus.Bus, blockStoreId string, waitOne bool, ) ([]LookupBlockStoreValue, directive.Instance, directive.Reference, error)
ExLookupBlockStores executes the LookupBlockStore directive. If waitOne is set, waits for at least one value before returning.
func ExLookupFirstBlockStore ¶
func ExLookupFirstBlockStore( ctx context.Context, b bus.Bus, blockStoreId string, returnIfIdle bool, valDisposeCb func(), ) (LookupBlockStoreValue, directive.Instance, directive.Reference, error)
ExLookupFirstBlockStore waits for the first block store to be returned. if returnIfIdle is set and the directive becomes idle, returns nil, nil, nil,