pluginlocalfilecoin

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: Apache-2.0, MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// AttrLogLevel is the key used to set the log level through NewNode attrs
	AttrLogLevel = "logLevel"

	// AttrLogJSON is the key used to set the node to output json logs
	AttrLogJSON = "logJSON"
)
View Source
var DefaultDockerEntryPoint = []string{"/usr/local/bin/venus"}

DefaultDockerEntryPoint is the entrypoint to run when starting the container.

View Source
var DefaultDockerHost = client.DefaultDockerHost

DefaultDockerHost is the hostname used when connecting to a docker daemon.

View Source
var DefaultDockerImage = "venus"

DefaultDockerImage is the image name the plugin will use when deploying a container>

View Source
var DefaultDockerUser = "filecoin"

DefaultDockerUser is the user that will run the command(s) inside the container.

View Source
var DefaultDockerVolumePrefix = ""

DefaultDockerVolumePrefix is a prefix added when using docker volumes e.g. when running against a remote docker daemon a prefix like `/var/iptb/` is usful wrt permissions

View Source
var DefaultLogJSON = "false"

DefaultLogJSON is the value that will be used for GO_FILECOIN_LOG_JSON

View Source
var DefaultLogLevel = "3"

DefaultLogLevel is the value that will be used for GO_FILECOIN_LOG_LEVEL

View Source
var NewNode testbedi.NewNodeFunc // nolint: golint
View Source
var PluginName = "dockerfilecoin"

PluginName is the name of the plugin.

Functions

func Exec

func Exec(ctx context.Context, cli client.APIClient, containerID string, detach bool, repoDir string, args ...string) (testbedi.Output, error)

Exec executes a command inside a container, returning the result containing stdout, stderr, and exit code. Note:

  • this is a synchronous operation;
  • cmd stdin is closed.

Types

type Dockerfilecoin

type Dockerfilecoin struct {
	Image        string
	ID           string
	Host         string
	User         string
	EntryPoint   []string
	VolumePrefix string
	// contains filtered or unexported fields
}

Dockerfilecoin represents attributes of a dockerized filecoin node.

func (*Dockerfilecoin) APIAddr

func (l *Dockerfilecoin) APIAddr() (string, error)

APIAddr returns the api address of the node.

func (*Dockerfilecoin) Connect

func (l *Dockerfilecoin) Connect(ctx context.Context, n testbedi.Core) error

Connect connects the node to another testbed node.

func (*Dockerfilecoin) Dir

func (l *Dockerfilecoin) Dir() string

Dir returns the directory the node is using.

func (*Dockerfilecoin) Errorf

func (l *Dockerfilecoin) Errorf(format string, args ...interface{})

Errorf writes an error log.

func (*Dockerfilecoin) Events

func (l *Dockerfilecoin) Events() (io.ReadCloser, error)

Events not implemented

func (*Dockerfilecoin) GetClient

func (l *Dockerfilecoin) GetClient() (*client.Client, error)

GetClient creates a new docker sdk client

func (*Dockerfilecoin) GetConfig

func (l *Dockerfilecoin) GetConfig() (interface{}, error)

GetConfig returns the nodes config.

func (*Dockerfilecoin) GetMetricDesc

func (l *Dockerfilecoin) GetMetricDesc(key string) (string, error)

GetMetricDesc not implemented

func (*Dockerfilecoin) GetMetricList

func (l *Dockerfilecoin) GetMetricList() []string

GetMetricList not implemented

func (*Dockerfilecoin) GetPeerID

func (l *Dockerfilecoin) GetPeerID() (cid.Cid, error)

GetPeerID returns the nodes peerID by running its `id` command. TODO this a temp fix, should read the nodes keystore instead

func (*Dockerfilecoin) Heartbeat

func (l *Dockerfilecoin) Heartbeat() (map[string]string, error)

Heartbeat not implemented

func (*Dockerfilecoin) Infof

func (l *Dockerfilecoin) Infof(format string, args ...interface{})

Infof writes an info log.

func (*Dockerfilecoin) Init

func (l *Dockerfilecoin) Init(ctx context.Context, args ...string) (testbedi.Output, error)

Init runs the node init process.

func (*Dockerfilecoin) Metric

func (l *Dockerfilecoin) Metric(key string) (string, error)

Metric not implemented

func (*Dockerfilecoin) PeerID

func (l *Dockerfilecoin) PeerID() (string, error)

PeerID returns the nodes peerID.

func (*Dockerfilecoin) RunCmd

func (l *Dockerfilecoin) RunCmd(ctx context.Context, stdin io.Reader, args ...string) (testbedi.Output, error)

RunCmd runs a command in the context of the node.

func (*Dockerfilecoin) Shell

func (l *Dockerfilecoin) Shell(ctx context.Context, ns []testbedi.Core) error

Shell starts a shell in the context of a node.

func (*Dockerfilecoin) Start

func (l *Dockerfilecoin) Start(ctx context.Context, wait bool, args ...string) (testbedi.Output, error)

Start starts the node process.

func (*Dockerfilecoin) StderrReader

func (l *Dockerfilecoin) StderrReader() (io.ReadCloser, error)

StderrReader provides an io.ReadCloser to the running daemons stderr

func (*Dockerfilecoin) StdoutReader

func (l *Dockerfilecoin) StdoutReader() (io.ReadCloser, error)

StdoutReader provides an io.ReadCloser to the running daemons stdout

func (*Dockerfilecoin) Stop

func (l *Dockerfilecoin) Stop(ctx context.Context) error

Stop stops the node process.

func (*Dockerfilecoin) String

func (l *Dockerfilecoin) String() string

String implements the stringer interface.

func (*Dockerfilecoin) SwarmAddrs

func (l *Dockerfilecoin) SwarmAddrs() ([]string, error)

SwarmAddrs returns the addresses a node is listening on for swarm connections.

func (*Dockerfilecoin) Type

func (l *Dockerfilecoin) Type() string

Type returns the type of the node.

func (*Dockerfilecoin) WriteConfig

func (l *Dockerfilecoin) WriteConfig(cfg interface{}) error

WriteConfig writes a nodes config file.

type ExecResult

type ExecResult struct {
	ExitCode int
	// contains filtered or unexported fields
}

ExecResult represents a result returned from Exec()

func (*ExecResult) Combined

func (res *ExecResult) Combined() string

Combined returns combined stdout and stderr output of a command run by Exec()

func (*ExecResult) Stderr

func (res *ExecResult) Stderr() string

Stderr returns stderr output of a command run by Exec()

func (*ExecResult) Stdout

func (res *ExecResult) Stdout() string

Stdout returns stdout output of a command run by Exec()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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