Documentation ¶
Index ¶
- Variables
- func RegisterDriver(name string, d DriverInitialiser)
- func RegisterDriverCmds(cmd *cobra.Command) error
- func WaitUntil(m Machine, timeout time.Duration, target *MachineState, failOn *MachineState) error
- type AttachOptions
- type Driver
- type DriverInitialiser
- type ExecOptions
- type LogOptions
- type Machine
- type MachineConfig
- type MachineInfo
- type MachineState
- type NetConfig
- type NetInfo
- type Network
- type ShellOptions
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func RegisterDriver ¶
func RegisterDriver(name string, d DriverInitialiser)
func RegisterDriverCmds ¶
func WaitUntil ¶
func WaitUntil(m Machine, timeout time.Duration, target *MachineState, failOn *MachineState) error
Types ¶
type AttachOptions ¶
type AttachOptions struct{}
type Driver ¶
type Driver interface { // Setup the driver using config map SetupDriver(conf map[string]interface{}) (err error) // Get a Machine instance within a specified namespace Machine(name, namespace string) (Machine, error) // Get a list of all machines within a specified namespace, // or all machines if all is true. // If all is true, the namespace parameter will be ignored ListMachines(namespace string, all bool) ([]MachineInfo, error) // Get a Network instance within a specified namespace Network(name, namespace string) (Network, error) // Get a list of all networks within a specified namespace, // or all networks if all is true. // If all is true, the namespace parameter will be ignored ListNetworks(namespace string, all bool) (networks []NetInfo, err error) // Return a list of all namespaces ListAllNamespaces() ([]string, error) // Return a Cobra CLI command which can be added to an existing CLI // as a subcommand GetCLICommand() (command *cobra.Command, err error) }
type DriverInitialiser ¶
type DriverInitialiser func() Driver
type ExecOptions ¶
type LogOptions ¶
type Machine ¶
type Machine interface { Name() string Id() string Exists() (bool, error) Running() bool Info() (MachineInfo, error) State() (MachineState, error) Networks() ([]Network, error) Start(*MachineConfig) error Stop(force bool) error Remove() error Attach(opts *AttachOptions) error Exec(command string, opts *ExecOptions) error Shell(opts *ShellOptions) error Logs(opts *LogOptions) error WaitUntil(timeout time.Duration, target, failOn *MachineState) error }
type MachineConfig ¶
type MachineConfig struct { Image string `default:"" mapstructure:"image,omitempty"` HostHome bool `default:"false" mapstructure:"hosthome,omitempty"` Hostlab bool `default:"" mapstructure:"hostlab,omitempty" validate:"dir"` Networks []string `default:"[]" mapstructure:"networks,omitempty"` Volumes []spec.Mount `default:"[]" mapstructure:"volumes,omitempty"` Ports []ocicni.PortMapping `default:"[]" mapstructure:"ports"` Dependencies []string `default:"[]" mapstructure:"depends_on,omitempty"` DriverExtra map[string]interface{} `default:"{}" mapstructure:"driver,omitempty"` Lab string `default:"" mapstructure:"-"` }
type MachineInfo ¶
type MachineInfo struct { Name string `json:"name"` Namespace string `json:"namespace"` Lab string `json:"lab,omitempty"` Image string `json:"image"` Pid int `json:"pid,omitempty"` State string `json:"state"` Status string `json:"status,omitempty"` Running bool `json:"running"` StartedAt time.Time `json:"started_at,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` Mounts []string `json:"mounts"` Networks []string `json:"networks"` Ports []ocicni.PortMapping `json:"ports"` Uptime string `json:"uptime,omitempty"` ExitCode int32 `json:"exit_code,omitempty"` ExitedAt int64 `json:"exited_at,omitempty"` }
Information about a machine available from the driver
type MachineState ¶
func BootedState ¶
func BootedState() *MachineState
func BootingState ¶
func BootingState() *MachineState
func ExitedState ¶
func ExitedState() *MachineState
type NetConfig ¶
type NetConfig struct { External bool `default:"false" mapstructure:"external,omitempty"` Gateway string `default:"" mapstructure:"gateway,omitempty"` IpRange string `default:"" mapstructure:"iprange,omitempty"` Subnet string `default:"" mapstructure:"subnet,omitempty"` IPv6 string `default:"" mapstructure:"ipv6,omitempty"` }
type NetInfo ¶
type NetInfo struct { Name string Namespace string External bool Gateway string IpRange string Subnet string IPv6 string }
Information about a network available from the driver
type ShellOptions ¶
Click to show internal directories.
Click to hide internal directories.