Documentation
¶
Index ¶
- func NewAccessUnixFSFuncFSCursorGetter(access AccessUnixFSFunc) func(ctx context.Context) (unixfs.FSCursor, error)
- type AccessUnixFS
- type AccessUnixFSFunc
- type AccessUnixFSValue
- type Controller
- func (c *Controller) AccessUnixFS(ctx context.Context, released func()) (*unixfs.FSHandle, func(), error)
- func (c *Controller) Close() error
- func (c *Controller) Execute(rctx context.Context) (rerr error)
- func (c *Controller) GetControllerInfo() *controller.Info
- func (c *Controller) HandleDirective(ctx context.Context, inst directive.Instance) ([]directive.Resolver, error)
- func (c *Controller) ResolveAccessUnixFS(ctx context.Context, di directive.Instance, d AccessUnixFS) (directive.Resolver, error)
- type FSCursor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAccessUnixFSFuncFSCursorGetter ¶
func NewAccessUnixFSFuncFSCursorGetter(access AccessUnixFSFunc) func(ctx context.Context) (unixfs.FSCursor, error)
NewAccessUnixFSFuncFSCursorGetter returns a FSCursorGetter bound to a AccessUnixFSFunc.
Types ¶
type AccessUnixFS ¶
type AccessUnixFS interface {
// Directive indicates AccessUnixFS is a directive.
directive.Directive
// AccessUnixFSID returns the filesystem ID to load.
// Cannot be empty.
AccessUnixFSID() string
}
AccessUnixFS is a directive to access a unix filesystem. Multiple results may be pushed to the directive.
func NewAccessUnixFS ¶
func NewAccessUnixFS(unixFsID string) AccessUnixFS
NewAccessUnixFS constructs a new AccessUnixFS directive.
type AccessUnixFSFunc ¶
type AccessUnixFSFunc = func(ctx context.Context, released func()) (*unixfs.FSHandle, func(), error)
AccessUnixFSFunc is a function to access a UnixFS. Optionally pass a released function that may be called when the handle was released. Returns a release function.
func NewAccessUnixFSFunc ¶
func NewAccessUnixFSFunc(handle *unixfs.FSHandle) AccessUnixFSFunc
NewAccessUnixFSFunc constructs a AccessUnixFSFunc from a FSHandle.
func NewAccessUnixFSViaBusFunc ¶
func NewAccessUnixFSViaBusFunc(b bus.Bus, unixfsID string, returnIfIdle bool) AccessUnixFSFunc
NewAccessUnixFSViaBusFunc builds a new func which accesses the UnixFS on the given bus using the AccessUnixFS directive.
If returnIfIdle is set: ErrFsNotFound is returned if not found.
type AccessUnixFSValue ¶
type AccessUnixFSValue = AccessUnixFSFunc
AccessUnixFSValue is the result type for AccessUnixFS. Optionally pass a released function that may be called when the handle was released. Returns a release function.
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller wraps a handle constructor to resolve AccessUnixFS.
func NewController ¶
func NewController( le *logrus.Entry, b bus.Bus, info *controller.Info, fsIds []string, cb AccessUnixFSValue, ) *Controller
NewController constructs a new controller.
func NewControllerWithHandle ¶
func NewControllerWithHandle( le *logrus.Entry, b bus.Bus, info *controller.Info, fsIds []string, handle *unixfs.FSHandle, ) *Controller
NewControllerWithHandle builds a new Controller which calls Clone on an existing handle.
func (*Controller) AccessUnixFS ¶
func (c *Controller) AccessUnixFS(ctx context.Context, released func()) (*unixfs.FSHandle, func(), error)
AccessUnixFS accesses the filesystem.
func (*Controller) Close ¶
func (c *Controller) Close() error
Close releases any resources used by the controller. Error indicates any issue encountered releasing.
func (*Controller) Execute ¶
func (c *Controller) Execute(rctx context.Context) (rerr error)
Execute executes the controller. Returning nil ends execution.
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) ResolveAccessUnixFS ¶
func (c *Controller) ResolveAccessUnixFS( ctx context.Context, di directive.Instance, d AccessUnixFS, ) (directive.Resolver, error)
ResolveAccessUnixFS resolves an AccessUnixFS directive if the fs id matches.
type FSCursor ¶
type FSCursor = unixfs.FSCursorGetter
FSCursor attaches a cursor to a UnixFS access function.
When the cursor is resolved with GetProxyCursor we call and wait for the access func.
func NewFSCursor ¶
func NewFSCursor( access AccessUnixFSFunc, ) *FSCursor
NewFSCursor constructs a new FSCursor with a world object ref.