runner

package
v0.0.0-...-09e74c9 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2020 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBinaryNotFound                          = errors.New("binary not found")
	ErrCannotStartStateTransactionWhileRunning = errors.New("state transaction cannot begin when running")
	ErrInitNodeBeforeConfigValueSet            = errors.New("node must be initialized before setting config values")
)

Functions

This section is empty.

Types

type OpenBazaarRunner

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

OpenBazaarRunner is reponsible for the runtime operations of the openbazaar-go binary

func FromBinaryPath

func FromBinaryPath(path string) (*OpenBazaarRunner, error)

FromBinaryPath will return an OpenBazaarRunner which uses the binary located at the path provided.

func (*OpenBazaarRunner) AsyncStart

func (r *OpenBazaarRunner) AsyncStart() *OpenBazaarRunner

AsyncStart will return immediately to allow other tasks to continue while running.

func (*OpenBazaarRunner) BeginNodeStateTransaction

func (r *OpenBazaarRunner) BeginNodeStateTransaction() error

func (*OpenBazaarRunner) Cleanup

func (r *OpenBazaarRunner) Cleanup() error

Cleanup ensures all resources which require cleaning are given an opportunity. It is the responsibility of the consumer to ensure Cleanup is called when the runner is no longer used.

func (*OpenBazaarRunner) ExitCodeAndErr

func (r *OpenBazaarRunner) ExitCodeAndErr() (int, error)

ExitCodeAndErr returns the exit code and error state of the executed binary

func (*OpenBazaarRunner) Init

Init will synchronously initialize the node

func (*OpenBazaarRunner) Kill

func (r *OpenBazaarRunner) Kill() error

Kill will ensure the binary process is stopped

func (*OpenBazaarRunner) RunStart

func (r *OpenBazaarRunner) RunStart() *OpenBazaarRunner

RunStart will run synchronously and will return when the process finishes running.

func (*OpenBazaarRunner) SetConfigValue

func (r *OpenBazaarRunner) SetConfigValue(path string, value interface{}) error

SetConfigValue will follow a dot-separated string pointing to the nested config key to change, and change it to the provided string value

func (*OpenBazaarRunner) SetCustomDataPath

func (r *OpenBazaarRunner) SetCustomDataPath(path string) error

SetCustomDataPath will ensure the running binary starts using the state data found at the path provided.

func (*OpenBazaarRunner) SetTestnetMode

func (r *OpenBazaarRunner) SetTestnetMode(enabled bool) error

SetTestnetMode will ensure the running binary starts using the testnet flag

func (*OpenBazaarRunner) SplitOutput

func (r *OpenBazaarRunner) SplitOutput() io.ReadCloser

SplitOutput returns a io.ReadCloser which has the stdout and stderr streams being sent to its in-memory pipe buffer immediately after being started.

func (*OpenBazaarRunner) Version

func (r *OpenBazaarRunner) Version() (string, error)

Version returns the version of the running binary

func (*OpenBazaarRunner) WithArgs

func (r *OpenBazaarRunner) WithArgs(args []string) *OpenBazaarRunner

WithArgs adds additional arguments for the running binary to recieve

Jump to

Keyboard shortcuts

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