unixfs_access

package
v0.51.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

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.

func ExAccessUnixFS

func ExAccessUnixFS(
	ctx context.Context,
	b bus.Bus,
	unixFsID string,
	returnIfIdle bool,
	valDisposeCb func(),
) (AccessUnixFSValue, directive.Reference, error)

ExAccessUnixFS executes the AccessUnixFS directive. if returnIfIdle is set, returns nil, nil if not found.

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.

Directories

Path Synopsis
ext

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL