Documentation ¶
Index ¶
- Variables
- func EnableDebugLogging()
- func WaitForFile(path string, timeout time.Duration) error
- type Buffer
- type CmdOpt
- type Harness
- func (h *Harness) Cleanup()
- func (h *Harness) Mkdirs(paths ...string)
- func (h *Harness) NewNode() *Node
- func (h *Harness) NewNodes(count int) Nodes
- func (h *Harness) Sh(expr string) RunResult
- func (h *Harness) TempFile() *os.File
- func (h *Harness) WriteFile(filename, contents string)
- func (h *Harness) WriteToTemp(contents string) string
- type Node
- func (n *Node) APIAddr() multiaddr.Multiaddr
- func (n *Node) Connect(other *Node) *Node
- func (n *Node) GetIPFSConfig(key string, val interface{})
- func (n *Node) IPFS(args ...string) RunResult
- func (n *Node) IPFSAdd(content io.Reader, args ...string) string
- func (n *Node) IPFSAddStr(content string, args ...string) string
- func (n *Node) IPFSCommands() []string
- func (n *Node) Init(ipfsArgs ...string) *Node
- func (n *Node) IsAlive() bool
- func (n *Node) PeerID() peer.ID
- func (n *Node) Peers() []multiaddr.Multiaddr
- func (n *Node) PipeStrToIPFS(s string, args ...string) RunResult
- func (n *Node) PipeToIPFS(reader io.Reader, args ...string) RunResult
- func (n *Node) ReadConfig() *config.Config
- func (n *Node) RunIPFS(args ...string) RunResult
- func (n *Node) RunPipeToIPFS(reader io.Reader, args ...string) RunResult
- func (n *Node) SetIPFSConfig(key string, val interface{}, flags ...string)
- func (n *Node) StartDaemon(ipfsArgs ...string) *Node
- func (n *Node) StopDaemon() *Node
- func (n *Node) SwarmAddrs() []multiaddr.Multiaddr
- func (n *Node) TryAPIAddr() (multiaddr.Multiaddr, error)
- func (n *Node) UpdateConfig(f func(cfg *config.Config))
- func (n *Node) WaitOnAPI() *Node
- func (n *Node) WriteConfig(c *config.Config)
- type Nodes
- type RunFunc
- type RunRequest
- type RunResult
- type Runner
Constants ¶
This section is empty.
Variables ¶
View Source
var RunFuncStart = (*exec.Cmd).Start
Functions ¶
Types ¶
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
Buffer is a thread-safe byte buffer.
type Harness ¶
Harness tracks state for a test, such as temp dirs and IFPS nodes, and cleans them up after the test.
func (*Harness) WriteFile ¶
WriteFile writes a file given a filename and its contents. The filename should be a relative path.
func (*Harness) WriteToTemp ¶
WriteToTemp writes the given contents to a guaranteed-unique temp file, returning its path.
type Node ¶
type Node struct { ID int Dir string APIListenAddr multiaddr.Multiaddr SwarmAddr multiaddr.Multiaddr EnableMDNS bool IPFSBin string Runner *Runner // contains filtered or unexported fields }
Node is a single Kubo node. Each node has its own config and can run its own Kubo daemon.
func (*Node) GetIPFSConfig ¶
func (*Node) IPFSCommands ¶
func (*Node) ReadConfig ¶
func (*Node) RunPipeToIPFS ¶
func (*Node) SetIPFSConfig ¶
func (*Node) StartDaemon ¶
func (*Node) StopDaemon ¶
func (*Node) SwarmAddrs ¶
func (n *Node) SwarmAddrs() []multiaddr.Multiaddr
func (*Node) TryAPIAddr ¶
func (*Node) UpdateConfig ¶
func (*Node) WriteConfig ¶
type Nodes ¶
type Nodes []*Node
Nodes is a collection of Kubo nodes along with operations on groups of nodes.
func (Nodes) StartDaemons ¶
func (Nodes) StopDaemons ¶
type RunRequest ¶
type Runner ¶
Runner is a process runner which can run subprocesses and aggregate output.
func (*Runner) AssertNoError ¶
func (*Runner) MustRun ¶
func (r *Runner) MustRun(req RunRequest) RunResult
MustRun runs the command and fails the test if the command fails.
func (*Runner) Run ¶
func (r *Runner) Run(req RunRequest) RunResult
Click to show internal directories.
Click to hide internal directories.