Documentation ¶
Index ¶
- Constants
- type Cluster
- func (c *Cluster) Create() error
- func (c *Cluster) CreateMachine(machine *Machine, i int) error
- func (c *Cluster) Delete() error
- func (c *Cluster) DeleteMachine(machine *Machine, i int) error
- func (c *Cluster) Inspect(hostnames []string) ([]*Machine, error)
- func (c *Cluster) Name() string
- func (c *Cluster) NewMachine(spec *config.Machine) *Machine
- func (c *Cluster) SSH(nodename string, username string, remoteArgs ...string) error
- func (c *Cluster) Save(path string) error
- func (c *Cluster) SetKeyStore(keyStore *KeyStore) *Cluster
- func (c *Cluster) Start(machineNames []string) error
- func (c *Cluster) StartMachines(machineNames []string) error
- func (c *Cluster) Stop(machineNames []string) error
- type Container
- type Formatter
- type JSONFormatter
- type KeyStore
- type Machine
- type MachineStatus
- type RuntimeNetwork
- type TableFormatter
Constants ¶
const ( // NotCreated status of a machine NotCreated = "Not created" // Stopped status of a machine Stopped = "Stopped" // Running status of a machine Running = "Running" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct {
// contains filtered or unexported fields
}
Cluster is a running cluster.
func New ¶
New creates a new cluster. It takes as input the description of the cluster and its machines.
func NewFromFile ¶
NewFromFile creates a new Cluster from a YAML serialization of its configuration available in the provided file.
func NewFromYAML ¶
NewFromYAML creates a new Cluster from a YAML serialization of its configuration available in the provided string.
func (*Cluster) CreateMachine ¶
CreateMachine creates and starts a new machine in the cluster.
func (*Cluster) DeleteMachine ¶
DeleteMachine remove a Machine from the cluster.
func (*Cluster) NewMachine ¶
NewMachine creates a new Machine in the cluster.
func (*Cluster) SetKeyStore ¶
SetKeyStore provides a store where to persist public keys for this Cluster.
func (*Cluster) StartMachines ¶
StartMachines starts specific machines(s) in cluster
type JSONFormatter ¶
type JSONFormatter struct{}
JSONFormatter formats a slice of machines into a JSON and outputs it to stdout.
func (JSONFormatter) Format ¶
func (JSONFormatter) Format(w io.Writer, machines []*Machine) error
Format will output to stdout in JSON format.
func (JSONFormatter) FormatSingle ¶
func (JSONFormatter) FormatSingle(w io.Writer, m *Machine) error
FormatSingle is a json formatter for a single machine.
type KeyStore ¶
type KeyStore struct {
// contains filtered or unexported fields
}
KeyStore is a store for public keys.
type Machine ¶
type Machine struct {
// contains filtered or unexported fields
}
Machine is a single machine.
func (*Machine) ContainerName ¶
ContainerName is the name of the running container corresponding to this Machine.
func (*Machine) HostPort ¶
HostPort returns the host port corresponding to the given container port.
func (*Machine) IsCreated ¶
IsCreated returns if a machine is has been created. A created machine could either be running or stopped.
func (*Machine) Status ¶
func (m *Machine) Status() *MachineStatus
Status returns the machine status.
type MachineStatus ¶
type MachineStatus struct { Container string `json:"container"` State string `json:"state"` Spec *config.Machine `json:"spec,omitempty"` Ports []port `json:"ports"` Hostname string `json:"hostname"` Image string `json:"image"` Command string `json:"cmd"` IP string `json:"ip"` RuntimeNetworks []*RuntimeNetwork `json:"runtimeNetworks,omitempty"` }
MachineStatus is the runtime status of a Machine.
type RuntimeNetwork ¶
type RuntimeNetwork struct { // Name of the network Name string `json:"name,omitempty"` // IP of the container IP string `json:"ip,omitempty"` // Mask of the network Mask string `json:"mask,omitempty"` // Gateway of the network Gateway string `json:"gateway,omitempty"` }
RuntimeNetwork contains information about the network
func NewRuntimeNetworks ¶
func NewRuntimeNetworks(networks map[string]*network.EndpointSettings) []*RuntimeNetwork
NewRuntimeNetworks returns a slice of networks
type TableFormatter ¶
type TableFormatter struct{}
TableFormatter formats a slice of machines into a colored table like output and prints that to stdout.