lib

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: MIT Imports: 20 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApiShell added in v1.7.0

func ApiShell(ipfsDir string) (*api.Shell, string, error)

ApiShell creates a new ipfs api shell and checks that it is up. If the shell is available, then the shell and ipfs version are returned.

func CurrentIpfsVersion added in v1.7.0

func CurrentIpfsVersion() (string, error)

CurrentIpfsVersion returns the version of the currently running or installed ipfs executable.

func InstallBinaryTo

func InstallBinaryTo(nbin, nloc string) error

func SelectRevertBin

func SelectRevertBin() (string, error)

func StashOldBinary

func StashOldBinary(tag string, keep bool) (string, error)

StashOldBinary moves the existing ipfs binary to a backup directory and returns the path to the original location of the old binary

Types

type Install

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

func NewInstall

func NewInstall(target string, nocheck, downgrade bool, fetcher migrations.Fetcher) *Install

func (*Install) Run

func (i *Install) Run(ctx context.Context) error

type IpfsFetcher added in v1.7.0

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

func NewIpfsFetcher added in v1.7.0

func NewIpfsFetcher(distPath string, fetchLimit int64) *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.

func (*IpfsFetcher) Close added in v1.8.0

func (f *IpfsFetcher) Close() error

func (*IpfsFetcher) Fetch added in v1.7.0

func (f *IpfsFetcher) Fetch(ctx context.Context, filePath string) ([]byte, 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.

Jump to

Keyboard shortcuts

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