bsfetcher

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: Apache-2.0, MIT Imports: 12 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultPrototypeChooser = func(lnk ipld.Link, lnkCtx ipld.LinkContext) (ipld.NodePrototype, error) {
	if tlnkNd, ok := lnkCtx.LinkNode.(schema.TypedLinkNode); ok {
		return tlnkNd.LinkTargetNodePrototype(), nil
	}
	return basicnode.Prototype.Any, nil
}

DefaultPrototypeChooser supports choosing the prototype from the link and falling back to a basicnode.Any builder

Functions

This section is empty.

Types

type FetcherConfig

type FetcherConfig struct {
	NodeReifier      ipld.NodeReifier
	PrototypeChooser traversal.LinkTargetNodePrototypeChooser
	// contains filtered or unexported fields
}

FetcherConfig defines a configuration object from which Fetcher instances are constructed

func NewFetcherConfig

func NewFetcherConfig(blockService blockservice.BlockService) FetcherConfig

NewFetcherConfig creates a FetchConfig from which session may be created and nodes retrieved.

func (FetcherConfig) FetcherWithSession

func (fc FetcherConfig) FetcherWithSession(ctx context.Context, s *blockservice.Session) fetcher.Fetcher

func (FetcherConfig) NewSession

func (fc FetcherConfig) NewSession(ctx context.Context) fetcher.Fetcher

NewSession creates a session from which nodes may be retrieved. The session ends when the provided context is canceled.

func (FetcherConfig) WithReifier

func (fc FetcherConfig) WithReifier(nr ipld.NodeReifier) fetcher.Factory

WithReifier derives a different fetcher factory from the same source but with a chosen NodeReifier for pathing semantics.

Jump to

Keyboard shortcuts

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