Documentation
¶
Overview ¶
Package docker provides a quick naive interface to Docker calls over ssh
Index ¶
- func Kill(client ssh.Client, node int) error
- func KillAll(client ssh.Client) error
- func Login(client ssh.Client, username string, password string) error
- func Logout(client ssh.Client) error
- func NetworkCreate(tn *testnet.TestNet, serverID int, subnetID int, node int) error
- func NetworkDestroy(client ssh.Client, node int) error
- func NetworkDestroyAll(client ssh.Client) error
- func Pull(clients []ssh.Client, image string) error
- func Run(tn *testnet.TestNet, serverID int, container Container) error
- func StartServices(tn *testnet.TestNet, services []helpers.Service) error
- func StopServices(tn *testnet.TestNet) error
- type Container
- type ContainerDetails
- func (cd *ContainerDetails) GetEnvironment() map[string]string
- func (cd *ContainerDetails) GetIP() (string, error)
- func (cd *ContainerDetails) GetImage() string
- func (cd *ContainerDetails) GetName() string
- func (cd *ContainerDetails) GetNetworkName() string
- func (cd *ContainerDetails) GetPorts() []string
- func (cd *ContainerDetails) GetResources() util.Resources
- type ContainerType
- type Network
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NetworkCreate ¶
NetworkCreate creates a docker network for a node
func NetworkDestroy ¶
NetworkDestroy tears down a single docker network
func NetworkDestroyAll ¶
NetworkDestroyAll removes all whiteblock networks on a node
func StartServices ¶
StartServices creates the service network and starts all the services on a server
func StopServices ¶
StopServices stops all services and remove the service network from a server
Types ¶
type Container ¶
type Container interface {
// GetEnvironment gives the environment variables for the container
GetEnvironment() map[string]string
// GetImage gives the image from which the container will be built
GetImage() string
// GetIP gives the IP address for the container
GetIP() (string, error)
// GetName gets the name of the container
GetName() string
// GetNetworkName gets the name of the containers network
GetNetworkName() string
// GetPorts gets the ports to open for the node, if instructed.
GetPorts() []string
// GetResources gets the maximum resource allocation of the node
GetResources() util.Resources
}
Container represents the basic functionality needed to build a container
type ContainerDetails ¶
type ContainerDetails struct {
Environment map[string]string
Image string
Node int
Resources util.Resources
SubnetID int
NetworkIndex int
Type ContainerType
}
ContainerDetails represents a docker containers details
func (*ContainerDetails) GetEnvironment ¶
func (cd *ContainerDetails) GetEnvironment() map[string]string
GetEnvironment gives the environment variables for the container
func (*ContainerDetails) GetIP ¶
func (cd *ContainerDetails) GetIP() (string, error)
GetIP gives the IP address for the container
func (*ContainerDetails) GetImage ¶
func (cd *ContainerDetails) GetImage() string
GetImage gives the image from which the container will be built
func (*ContainerDetails) GetName ¶
func (cd *ContainerDetails) GetName() string
GetName gets the name of the container
func (*ContainerDetails) GetNetworkName ¶
func (cd *ContainerDetails) GetNetworkName() string
GetNetworkName gets the name of the containers network
func (*ContainerDetails) GetPorts ¶ added in v1.8.1
func (cd *ContainerDetails) GetPorts() []string
GetPorts gets the ports to open for the node, if instructed.
func (*ContainerDetails) GetResources ¶
func (cd *ContainerDetails) GetResources() util.Resources
GetResources gets the maximum resource allocation of the node
type ContainerType ¶
type ContainerType int
ContainerType represents the type of node the container is
const ( // Node is a standard node in the network Node ContainerType = 0 // SideCar is a sidecar for a node in the network SideCar ContainerType = 1 // Service is a service node Service ContainerType = 2 )