kubo

package module
v0.0.0-...-508b737 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2023 License: MIT Imports: 23 Imported by: 0

README

clustertest-kubo

This is a library for testing Kubo using clustertest. It builds on top of clustertest to provide testing primitives for interacting with clusters of Kubo nodes.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsLoopback

func IsLoopback(ma multiaddr.Multiaddr) (bool, error)

func MultiaddrContains

func MultiaddrContains(ma multiaddr.Multiaddr, component *multiaddr.Component) (bool, error)

func Must

func Must(err error)

func Must2

func Must2[V any](v V, err error) V

func ProcMust

func ProcMust(res *cluster.ProcessResult, err error) error

func RemoveLocalAddrs

func RemoveLocalAddrs(ai *peer.AddrInfo) error

Types

type Cluster

type Cluster struct {
	*basic.Cluster
	Ctx context.Context
}

func New

func New(bc *basic.Cluster) *Cluster

func (*Cluster) Context

func (c *Cluster) Context(ctx context.Context) *Cluster

func (*Cluster) MustNewNodes

func (c *Cluster) MustNewNodes(n int) []*Node

func (*Cluster) NewNodes

func (c *Cluster) NewNodes(n int) ([]*Node, error)

type Daemon

type Daemon struct {
	Proc   *basic.Process
	Stdout *bytes.Buffer
	Stderr *bytes.Buffer
}

func (*Daemon) Stop

func (d *Daemon) Stop() error

type Node

type Node struct {
	*basic.Node

	Ctx        context.Context
	Log        *zap.SugaredLogger
	HTTPClient *http.Client
	BinLoader  bin.Loader
	// contains filtered or unexported fields
}

func (*Node) APIAddr

func (n *Node) APIAddr() (multiaddr.Multiaddr, error)

func (*Node) AddrInfo

func (n *Node) AddrInfo() (*peer.AddrInfo, error)

func (*Node) ConfigureForLocal

func (n *Node) ConfigureForLocal() error

func (*Node) ConfigureForRemote

func (n *Node) ConfigureForRemote() error

func (*Node) Context

func (n *Node) Context(ctx context.Context) *Node

func (*Node) GatewayURL

func (n *Node) GatewayURL() (*url.URL, error)

func (*Node) IPFSBin

func (n *Node) IPFSBin() string

func (*Node) IPFSPath

func (n *Node) IPFSPath() string

func (*Node) Init

func (n *Node) Init() error

func (*Node) LoadBinary

func (n *Node) LoadBinary() error

func (*Node) MustVersion

func (n *Node) MustVersion() string

func (*Node) RPCAPIClient

func (n *Node) RPCAPIClient() (*shell.Shell, error)

RPCClient returns an RPC client configured for this node (https://github.com/ipfs/go-ipfs-api) We call this the "API Client" to distinguish it from the "HTTP Client". Both are very similar, but slightly different.

func (*Node) RPCHTTPClient

func (n *Node) RPCHTTPClient() (*httpapi.HttpApi, error)

RPCHTTPClient returns an HTTP RPC client configured for this node (https://github.com/ipfs/go-ipfs-http-client) We call this the "HTTP Client" to distinguish it from the "API Client". Both are very similar, but slightly different.

func (*Node) ReadConfig

func (n *Node) ReadConfig() (*config.Config, error)

func (*Node) RemoteAddrInfo

func (n *Node) RemoteAddrInfo() (*peer.AddrInfo, error)

func (*Node) RunKubo

func (*Node) SetConfig

func (n *Node) SetConfig(cfg map[string]string) error

func (*Node) StartDaemon

func (n *Node) StartDaemon() (*Daemon, error)

func (*Node) StartDaemonAndWaitForAPI

func (n *Node) StartDaemonAndWaitForAPI() (*Daemon, error)

func (*Node) StartKubo

func (n *Node) StartKubo(req cluster.StartProcRequest) (*basic.Process, error)

func (*Node) UpdateConfig

func (n *Node) UpdateConfig(f func(cfg *config.Config)) error

func (*Node) Version

func (n *Node) Version() (string, error)

func (*Node) WaitOnAPI

func (n *Node) WaitOnAPI() error

func (*Node) WithKuboVersion

func (n *Node) WithKuboVersion(version string) *Node

WithKuboVersion configures the node to use a specific version of Kubo from dist.ipfs.io.

func (*Node) WithLocalKuboBin

func (n *Node) WithLocalKuboBin(binPath string) *Node

WithLocalKuboBin configures the node to use a Kubo binary on the local filesystem.

func (*Node) WithNodeLogger

func (n *Node) WithNodeLogger(l *zap.SugaredLogger) *Node

func (*Node) WriteConfig

func (n *Node) WriteConfig(c *config.Config) error

type StopFunc

type StopFunc func()

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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