lassie

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: Apache-2.0, MIT Imports: 13 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Lassie

type Lassie struct {
	// contains filtered or unexported fields
}

func NewLassie

func NewLassie(ctx context.Context, opts ...LassieOption) (*Lassie, error)

func NewLassieWithConfig

func NewLassieWithConfig(ctx context.Context, cfg *LassieConfig) (*Lassie, error)

func (*Lassie) Fetch

func (l *Lassie) Fetch(ctx context.Context, rootCid cid.Cid, linkSystem linking.LinkSystem) (types.RetrievalID, *types.RetrievalStats, error)

func (*Lassie) RegisterSubscriber

func (l *Lassie) RegisterSubscriber(subscriber types.RetrievalEventSubscriber) func()

func (*Lassie) Retrieve added in v0.4.0

func (l *Lassie) Retrieve(ctx context.Context, request types.RetrievalRequest) (*types.RetrievalStats, error)

type LassieConfig

type LassieConfig struct {
	Finder          retriever.CandidateFinder
	Host            host.Host
	ProviderTimeout time.Duration
	GlobalTimeout   time.Duration
	Libp2pOptions   []libp2p.Option
}

type LassieOption

type LassieOption func(cfg *LassieConfig)

func WithFinder

func WithFinder(finder retriever.CandidateFinder) LassieOption

func WithGlobalTimeout added in v0.4.0

func WithGlobalTimeout(timeout time.Duration) LassieOption

func WithHost added in v0.4.0

func WithHost(host host.Host) LassieOption

func WithLibp2pOpts added in v0.4.4

func WithLibp2pOpts(libp2pOptions ...libp2p.Option) LassieOption

func WithProviderTimeout added in v0.4.0

func WithProviderTimeout(timeout time.Duration) LassieOption

Jump to

Keyboard shortcuts

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