ipfsfetcher

package
v0.10.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2021 License: Apache-2.0, MIT, Apache-2.0, + 1 more Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IpfsFetcher

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

func NewIpfsFetcher

func NewIpfsFetcher(distPath string, fetchLimit int64, repoRoot *string) *IpfsFetcher

NewIpfsFetcher creates a new IpfsFetcher

Specifying "" for distPath sets the default IPNS path. Specifying 0 for fetchLimit sets the default, -1 means no limit.

Bootstrap and peer information in read from the IPFS config file in repoRoot, unless repoRoot is nil. If repoRoot is empty (""), then read the config from the default IPFS directory.

func (*IpfsFetcher) AddrInfo

func (f *IpfsFetcher) AddrInfo() peer.AddrInfo

func (*IpfsFetcher) Close

func (f *IpfsFetcher) Close() error

func (*IpfsFetcher) Fetch

func (f *IpfsFetcher) Fetch(ctx context.Context, filePath string) (io.ReadCloser, error)

Fetch attempts to fetch the file at the given path, from the distribution site configured for this HttpFetcher. Returns io.ReadCloser on success, which caller must close.

func (*IpfsFetcher) FetchedPaths

func (f *IpfsFetcher) FetchedPaths() []ipath.Path

FetchedPaths returns the IPFS paths of all items fetched by this fetcher

Jump to

Keyboard shortcuts

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