Documentation
¶
Index ¶
- type BlockStoreBuilder
- type Controller
- func (c *Controller) AddBlockStoreRef() (promise.PromiseLike[block_store.Store], *refcount.Ref[block_store.Store])
- func (c *Controller) Close() error
- func (c *Controller) Execute(ctx context.Context) error
- func (c *Controller) GetControllerInfo() *controller.Info
- func (c *Controller) HandleDirective(ctx context.Context, inst directive.Instance) ([]directive.Resolver, error)
- func (c *Controller) WaitBlockStore(ctx context.Context) (block_store.Store, *refcount.Ref[block_store.Store], error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockStoreBuilder ¶
type BlockStoreBuilder = refcount.RefCountResolver[block_store.Store]
BlockStoreBuilder builds a block store.
returns the store and an optional release function can return nil to indicate not found.
func NewBlockStoreBuilder ¶
func NewBlockStoreBuilder(store block_store.Store) BlockStoreBuilder
NewBlockStoreBuilder creates a new BlockStoreBuilder with a static block store.
func WrapVerboseBlockStoreBuilder ¶
func WrapVerboseBlockStoreBuilder(le *logrus.Entry, builder BlockStoreBuilder) BlockStoreBuilder
WrapVerboseBlockStoreBuilder wraps a BlockStoreBuilder to be verbose.
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller resolves LookupBlockStore with a block_store.Store.
func NewController ¶
func NewController( le *logrus.Entry, info *controller.Info, resolver BlockStoreBuilder, blockStoreIds []string, buildOnStart bool, bucketIDs []string, skipNotFound, verbose bool, ) *Controller
NewController constructs a new controller.
blockStoreIds is the list of block store ids to match LookupBlockStore. buildOnStart adds a reference on startup & always runs the block store. bucketIDs is a list of bucket ids to resolve LookupBlockFromNetwork directives.
func (*Controller) AddBlockStoreRef ¶
func (c *Controller) AddBlockStoreRef() (promise.PromiseLike[block_store.Store], *refcount.Ref[block_store.Store])
AddBlockStoreRef adds a reference to the block store.
func (*Controller) Close ¶
func (c *Controller) Close() error
Close releases any resources used by the controller.
func (*Controller) Execute ¶
func (c *Controller) Execute(ctx context.Context) error
Execute executes the controller.
func (*Controller) GetControllerInfo ¶
func (c *Controller) GetControllerInfo() *controller.Info
GetControllerInfo returns information about the controller.
func (*Controller) HandleDirective ¶
func (c *Controller) HandleDirective( ctx context.Context, inst directive.Instance, ) ([]directive.Resolver, error)
HandleDirective asks if the handler can resolve the directive.
func (*Controller) WaitBlockStore ¶
func (c *Controller) WaitBlockStore(ctx context.Context) (block_store.Store, *refcount.Ref[block_store.Store], error)
WaitBlockStore adds a reference to the block store and waits for it to be constructed.