common

package
v0.0.0-...-345c7ae Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2019 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger interface {
	Log(args ...interface{})
	Logf(format string, args ...interface{})
}

Logger a general logger interface

type SimulatorAPI

type SimulatorAPI interface {
	//Retrieve docker daemon info
	GetDockerInfo() (*docker.DockerInfo, error)
	//Get a specific client's IP
	GetClientIP(string) (*string, error)
	//Get a specific client's enode
	GetClientEnode(string) (*string, error)
	//Get all client types available to this simulator run
	//this depends on both the available client set
	//and the command line filters
	GetClientTypes() ([]string, error)
	//Start a new node (or other container) with the specified parameters
	//One parameter must be named CLIENT and should contain one of the
	//returned client types from GetClientTypes
	//The input is used as environment variables in the new container
	//Returns container id
	StartNewNode(map[string]string) (*string, error)
	//Submit log info to the simulator log
	Log(string) error
	//Submit node test results
	//	Success flag
	//	Node id
	//  Details
	AddResults(bool, string, string, string, time.Duration) error
	//Stop and delete the specified container
	KillNode(string) error
}

SimulatorAPI The simulator host remote API

type SimulatorHost

type SimulatorHost struct {
	HostURI *string
}

SimulatorHost A simulator host

func (SimulatorHost) AddResults

func (sim SimulatorHost) AddResults(success bool, nodeID string, name string, errMsg string, duration time.Duration) error

AddResults //Submit node test results

	Success flag
	Node id
 Details

func (SimulatorHost) GetClientEnode

func (sim SimulatorHost) GetClientEnode(node string) (*string, error)

GetClientEnode Get the client enode for the specified container id

func (SimulatorHost) GetClientIP

func (sim SimulatorHost) GetClientIP(node string) (*string, error)

GetClientIP Get the client IP

func (SimulatorHost) GetClientTypes

func (sim SimulatorHost) GetClientTypes() (availableClients []string, err error)

GetClientTypes Get all client types available to this simulator run this depends on both the available client set and the command line filters

func (SimulatorHost) GetDockerInfo

func (sim SimulatorHost) GetDockerInfo() (*docker.DockerInfo, error)

GetDockerInfo Get the host's docker daemon info

func (SimulatorHost) KillNode

func (sim SimulatorHost) KillNode(string) error

KillNode Stop and delete the specified container

func (SimulatorHost) Log

func (sim SimulatorHost) Log(string) error

Log Submit log info to the simulator log

func (SimulatorHost) StartNewNode

func (sim SimulatorHost) StartNewNode(parms map[string]string) (*string, error)

StartNewNode Start a new node (or other container) with the specified parameters One parameter must be named CLIENT and should contain one of the returned client types from GetClientTypes The input is used as environment variables in the new container Returns container id

Jump to

Keyboard shortcuts

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