Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractKuboBinary ¶
func ExtractKuboBinary(r io.Reader, checksum []byte) io.ReadCloser
ExtractKuboBinary extracts the kubo binary from a dist archive, also checking the given archive checksum in the process.
Types ¶
type DistFetcher ¶
DistFetcher fetches the given Kubo version binary from dist.ipfs.io, optionally caching it on the local disk. Caching is useful to avoid downloading the binary for every test run.
func (*DistFetcher) Fetch ¶
func (r *DistFetcher) Fetch(ctx context.Context) (io.ReadCloser, error)
type DockerImageFetcher ¶
type DockerImageFetcher struct {
Image string
}
DockerImageFetcher fetches a Kubo binary by extracting it from a Docker image.
func (*DockerImageFetcher) Fetch ¶
func (r *DockerImageFetcher) Fetch(ctx context.Context) (io.ReadCloser, error)
type Fetcher ¶
type Fetcher interface { // Fetch fetches a Kubo binary. If this returns no error, then the caller should close the reader to prevent leaks. Fetch(context.Context) (io.ReadCloser, error) Version(context.Context) (string, error) }
Fetcher fetches a Kubo binary and provides a reader for the binary data.
type FetchingLoader ¶
FetchingLoader loads a Kubo archive by having each node download the specified version from dist.ipfs.io. For remote clusters, this is much faster than sending the archive to each one from the test runner.
type Loader ¶
type Loader interface { Load(ctx context.Context, destFile string) error Version(context.Context) (string, error) }
Loader loads a Kubo bin into the given file on a node.
type LocalFetcher ¶
type LocalFetcher struct {
BinPath string
}
LocalFetcher fetches a Kubo archive from a local file. This is useful if you are testing against some unreleased Kubo binary.
func (*LocalFetcher) Fetch ¶
func (l *LocalFetcher) Fetch(ctx context.Context) (io.ReadCloser, error)
type RemoteFetcher ¶
type RemoteFetcher struct { }
RemoteFetcher fetches a Kubo binary from one of multiple remote sources. The source used depends on the version passed, which can be of the following schemes:
- dist:<semver> the binary is loaded from dist.ipfs.io according to the semver, such as v0.18.0 or v0.18.0-rc1 - dist:latest the latest semver will be loaded from dist.ipfs.io (including RCs) - dist:latest-release the latest release will be loaded from dist.ipfs.io - docker:latest the binary is loaded from the latest Docker image - docker:<commit hash> the binary is loaded from the first Docker image that matches the hash
type SendingLoader ¶
type SendingLoader struct { Node node Fetcher Fetcher }
SendingLoader loads a Kubo binary by sending it to the node from the test runner. This can be slower but sometimes is necessary if e.g. testing an unreleased binary when developing.
type Versions ¶
type Versions struct {
// contains filtered or unexported fields
}
func LoadVersions ¶
LoadVersions fetches and caches version metadata from dist.ipfs.io about all Kubo release versions. Subsequent calls use the in-memory cached metadata.