services

package
v1.8.16 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2019 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetServiceIps

func GetServiceIps(services []Service) (map[string]string, error)

GetServiceIps creates a map of the service names to their ip addresses. Useful for determining the ip address of a service.

Types

type GanacheService

type GanacheService struct {
	SimpleService
}

GanacheService represents the Ganache service

func (GanacheService) GetCommand

func (p GanacheService) GetCommand() string

GetCommand get the ganache command line options

func (GanacheService) Prepare

func (p GanacheService) Prepare(client ssh.Client, tn *testnet.TestNet) error

Prepare prepares the ganache service

type PrometheusService

type PrometheusService struct {
	SimpleService
}

PrometheusService represents the Prometheus service

func (PrometheusService) Prepare

func (p PrometheusService) Prepare(client ssh.Client, tn *testnet.TestNet) error

Prepare prepares the prometheus service

type Service

type Service interface {
	// Prepare prepares the service
	Prepare(client ssh.Client, tn *testnet.TestNet) error

	// GetName gets the name of service
	GetName() string

	// GetImage gets the image of service
	GetImage() string

	// GetEnv gets the environment variables of service
	GetEnv() map[string]string

	// GetNetwork gets the network of the service
	GetNetwork() string

	// GetPorts gets the ports published by the service
	GetPorts() []string

	// GetVolumes gets the volumes mounted on the service container
	GetVolumes() []string

	// GetCommand gets the command to run for the service with Docker.
	GetCommand() string
}

Service represents a service

func RegisterGanache

func RegisterGanache() Service

RegisterGanache exposes a Ganache service on the testnet.

func RegisterPrometheus

func RegisterPrometheus() Service

RegisterPrometheus exposes a Prometheus service on the testnet.

func RegisterSysethereum

func RegisterSysethereum() Service

RegisterSysethereum exposes a Sysethereum service on the testnet.

type SimpleService

type SimpleService struct {
	Name    string            `json:"name"`
	Image   string            `json:"image"`
	Env     map[string]string `json:"env"`
	Network string            `json:"network"`
	Ports   []string          `json:"ports"`
	Volumes []string          `json:"volumes"`
}

SimpleService represents a service for a blockchain. All env variables will be passed to the container.

func (SimpleService) GetCommand

func (s SimpleService) GetCommand() string

GetCommand gets the command to run for the service with Docker.

func (SimpleService) GetEnv

func (s SimpleService) GetEnv() map[string]string

GetEnv gets the environment variables of service

func (SimpleService) GetImage

func (s SimpleService) GetImage() string

GetImage gets the image of service

func (SimpleService) GetName

func (s SimpleService) GetName() string

GetName gets the name of service

func (SimpleService) GetNetwork

func (s SimpleService) GetNetwork() string

GetNetwork gets the network of the service

func (SimpleService) GetPorts

func (s SimpleService) GetPorts() []string

GetPorts gets the ports published by the service

func (SimpleService) GetVolumes

func (s SimpleService) GetVolumes() []string

GetVolumes gets the volumes mounted on the service container

func (SimpleService) Prepare

func (s SimpleService) Prepare(client ssh.Client, tn *testnet.TestNet) error

Prepare just returns nil. Simple service has no prepare step

type SysethereumService

type SysethereumService struct {
	SimpleService
}

SysethereumService represents the SysethereumService service

func (SysethereumService) GetCommand

func (p SysethereumService) GetCommand() string

GetCommand gets the command flags

func (SysethereumService) Prepare

func (p SysethereumService) Prepare(client ssh.Client, tn *testnet.TestNet) error

Prepare prepares the sysethereum service

Jump to

Keyboard shortcuts

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