Documentation
¶
Index ¶
- Variables
- func BindFlag(confKey string, f *flag.Flag)
- func MachineInfoToStringArr(machines []driver.MachineInfo, showNS bool) (mlist [][]string, headers []string)
- func NetInfoToStringArr(networks []driver.NetInfo, showLab bool) (nlist [][]string, headers []string)
- func Reexec()
- func RenderTable(headers []string, list [][]string)
- func SaveLab(lab *Lab) error
- type Config
- type DriverConfig
- type InitOpts
- type Koble
- func (nk *Koble) AddMachineToLab(name string, conf driver.MachineConfig) error
- func (nk *Koble) AddNetworkToLab(name string, conf driver.NetConfig) error
- func (nk *Koble) AttachToMachine(machine, term string) error
- func (nk *Koble) Cleanup() (err error)
- func (nk *Koble) DestroyMachine(machine string, out io.Writer) error
- func (nk *Koble) Exec(machine, command, user string, detach bool, workdir string) error
- func (nk *Koble) ForMachine(headerFunc func(string) string, titlePref string, filterList []string, ...) error
- func (nk *Koble) GetMachineList(mlist []string, all bool) (machines []driver.Machine, err error)
- func (nk *Koble) InitLab(options InitOpts) error
- func (nk *Koble) LabDestroy(mlist []string) error
- func (nk *Koble) LabInfo() error
- func (nk *Koble) LabRemove(mlist []string) error
- func (nk *Koble) LabStart(mlist []string) error
- func (nk *Koble) LabStop(mlist []string, force bool) error
- func (nk *Koble) LaunchInTerm(machine, terminal, command string) error
- func (nk *Koble) ListMachines(all, json bool) error
- func (nk *Koble) ListNetworks(all, json bool) error
- func (nk *Koble) MachineInfo(name string, json bool) error
- func (nk *Koble) MachineLogs(machine string, follow bool, tail int) error
- func (nk *Koble) NetworkInfo(name string, json bool) error
- func (nk *Koble) RemoveMachine(name string, out io.Writer) error
- func (nk *Koble) Shell(machine, user, workdir string) error
- func (nk *Koble) StartMachine(name string, conf driver.MachineConfig, attachTerm string, out io.Writer) error
- func (nk *Koble) StartNetwork(name string, conf driver.NetConfig) error
- func (nk *Koble) StopMachine(name string, force bool, out io.Writer) error
- type Lab
- type LaunchConfig
- type LaunchOptions
- type MachineConfig
- type TermConfig
- type Terminal
Constants ¶
This section is empty.
Variables ¶
View Source
var DEFAULT_STARTUP = `#!/bin/bash
# Machine.startup - generated by koble machine add
# This is a script that will run when the machine boots
`
View Source
var (
Koanf = koanf.New(".")
)
View Source
var MAXPRINTWIDTH = 100
View Source
var SHARED_STARTUP = `` /* 180-byte string literal not displayed */
View Source
var VERSION = "0.0.1"
Functions ¶
func MachineInfoToStringArr ¶
func MachineInfoToStringArr(machines []driver.MachineInfo, showNS bool) (mlist [][]string, headers []string)
func NetInfoToStringArr ¶
func RenderTable ¶
Types ¶
type Config ¶
type Config struct { // Driver options Driver DriverConfig `koanf:"driver"` // Verbose (loglevel = Debug) Verbosity int `koanf:"verbose"` // Quiet (loglevel = error) Quiet bool `koanf:"quiet"` // Terminal to use, additional terminals and options Terminal TermConfig `koanf:"terminal"` // Term option overrides TermOpts map[string]string `koanf:"term_opts"` // whether to launch machines for machine / lab start Launch LaunchConfig `koanf:"launch"` // Use plain output, e.g. no spinners, no prompts // default is false NonInteractive bool `koanf:"noninteractive"` // Do not use colour in output // default is false NoColor bool `koanf:"nocolor"` // namespace to use when not in a lab // default is "GLOBAL" Namespace string `koanf:"namespace" validate:"alphanum,max=32"` // Wait (if -1 no wait, run in background) is how long in seconds to wait // for machines to startup / exit before giving timeout error // default is 300 Wait time.Duration `koanf:"wait"` // Amount of memory in MB to use for each machine // default is 128 Machine MachineConfig `koanf:"machine"` }
type DriverConfig ¶
type Koble ¶
type Koble struct { Lab Lab LabRoot string InitialWorkDir string Config Config Driver driver.Driver }
func (*Koble) AddMachineToLab ¶
func (nk *Koble) AddMachineToLab(name string, conf driver.MachineConfig) error
func (*Koble) AddNetworkToLab ¶
redo with new viper config
func (*Koble) AttachToMachine ¶
func (*Koble) ForMachine ¶
func (*Koble) GetMachineList ¶
func (*Koble) LabDestroy ¶
func (*Koble) LaunchInTerm ¶
func (*Koble) ListMachines ¶
func (*Koble) ListNetworks ¶
func (*Koble) MachineLogs ¶
func (*Koble) StartMachine ¶
func (*Koble) StartNetwork ¶
type Lab ¶
type Lab struct { Name string `koanf:"-" validate:"alphanum,max=30"` Directory string `koanf:"-"` CreatedAt string `koanf:"created_at" validate:"datetime=02-01-2006"` KobleVersion string `koanf:"koble_version"` Description string `koanf:"description"` Authors []string `koanf:"authors"` Emails []string `koanf:"emails" validate:"dive,email"` Webs []string `koanf:"web" validate:"dive,url"` Machines map[string]driver.MachineConfig `koanf:"machines"` Networks map[string]driver.NetConfig `koanf:"networks" mapstructure:"networks"` }
type LaunchConfig ¶
type LaunchOptions ¶
type MachineConfig ¶
type MachineConfig struct { // Amount of memory in MB to use for each machine // default is 128 MachineMemory int `koanf:"memory"` }
type TermConfig ¶
type TermConfig struct { // name of default terminal to open // by default this is gnome Default string `koanf:"default"` // name of terminal to use for attach commands // by default this uses the terminal set for 'default' Attach string `koanf:"attach"` // name of terminal to use for shell commands // by default this uses the terminal set for 'default' Shell string `koanf:"shell"` // name of terminal to use for shell commands // by default this is set to 'this' (no terminal) Exec string `koanf:"exec"` // name of terminal to use for attaching on machine start // by default this uses the terminal set for 'default' MachineStart string `koanf:"machine_start"` // name of terminal to use for attaching on lab start // by default this uses the terminal set for 'default' LabStart string `koanf:"lab_start"` // extra terminal command and option definitions Terminals map[string]Terminal `koanf:"terminals,remain"` }
Click to show internal directories.
Click to hide internal directories.