Documentation ¶
Index ¶
- Constants
- type Advanced
- type AdvancedCPU
- type Bridge
- type Build
- type Config
- func (c *Config) AddInstance(name string, instance *Instance)
- func (c *Config) AllocatedDataPlaneListenPorts() []int
- func (c *Config) AllocatedHostSideNatPorts() []int
- func (c *Config) AllocatedInstanceIDs() []int
- func (c *Config) AllocatedMonitorPorts() []int
- func (c *Config) AllocatedSerialPorts() []int
- func (c *Config) DeleteInstance(name string)
- func (c *Config) Dump(f string) error
- func (c *Config) Validate() error
- type Credentials
- type DataPlaneIntf
- type GlobalOptions
- type Hardware
- type Instance
- type MgmtIntf
- type Nat
- type NatPortPair
- type Platform
- type Profile
- type ProfileHardware
- type Qemu
- type SocketConnectPair
Constants ¶
const ( // MAXINSTANCES is the maximum number of instances boxen can allocate. MAXINSTANCES = 255 // MONITORPORTBASE is the starting port ID for qemu monitor ports. MONITORPORTBASE = 4000 // SERIALPORTBASE is the starting port ID for serial ports. SERIALPORTBASE = 5000 // SERIALPORTLOW is the first possible serial port ID. SERIALPORTLOW = 5001 // SERIALPORTHI is the last possible serial port ID. SERIALPORTHI = 5999 // MGMTNATLOW is the first possible "management NAT" port ID. MGMTNATLOW = 30001 // MGMTNATHI is the last possible "management NAT" port ID. MGMTNATHI = 39999 // SOCKETLISTENPORTLOW is the starting port ID for "data plane" listening ports. SOCKETLISTENPORTLOW = 40000 // SOCKETLISTENPORTHI is the last possible port ID for "data plane" listening ports. SOCKETLISTENPORTHI = 65535 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced struct { Display string `yaml:"display,omitempty"` Machine string `yaml:"machine,omitempty"` CPU *AdvancedCPU `yaml:"cpu,omitempty"` }
type AdvancedCPU ¶
type Config ¶
type Config struct { Options *GlobalOptions `yaml:"options,omitempty"` Instances map[string]*Instance `yaml:"instances,omitempty"` InstanceGroups map[string][]string `yaml:"groups,omitempty"` Platforms map[string]*Platform `yaml:"platforms,omitempty"` // contains filtered or unexported fields }
Config is a struct representing boxen configuration data.
func NewConfigFromFile ¶
NewConfigFromFile returns an instantiated Config object loaded from a YAML file.
func NewPackageConfig ¶
func NewPackageConfig() *Config
NewPackageConfig returns a new instantiated config object specifically for use during "packaging" this is mostly the same as normal, but omits the global config options (which include qemu path and available acceleration).
func (*Config) AddInstance ¶
AddInstance safely (with a lock) adds an instance to the config object Instances map.
func (*Config) AllocatedDataPlaneListenPorts ¶
AllocatedDataPlaneListenPorts returns a slice of integers of all currently allocated "listen" ports in the local boxen config. These ports are the ephemeral range ports that get applied to the qemu udp listen ports for the "dataplane" ports of the virtual machines.
func (*Config) AllocatedHostSideNatPorts ¶
AllocatedHostSideNatPorts returns a slice of integers of all currently allocated "host side" nat ports in the local boxen config. These ports are the ephemeral range ports that get applied to the qemu hostfwd nat directives for the local virtual machines.
func (*Config) AllocatedInstanceIDs ¶
AllocatedInstanceIDs returns a slice of integers of all currently allocated instance IDs in the local boxen config.
func (*Config) AllocatedMonitorPorts ¶
AllocatedMonitorPorts returns a slice of integers of all currently allocated monitor port IDs in the local boxen config.
func (*Config) AllocatedSerialPorts ¶
AllocatedSerialPorts returns a slice of integers of all currently allocated serial port IDs in the local boxen config.
func (*Config) DeleteInstance ¶
DeleteInstance safely (with a lock) deletes an instance from the config object Instances map.
type Credentials ¶
type Credentials struct { Username string `yaml:"username,omitempty"` Password string `yaml:"password,omitempty"` }
func NewDefaultCredentials ¶
func NewDefaultCredentials() *Credentials
NewDefaultCredentials returns a Credentials object with the boxen default creds set.
type DataPlaneIntf ¶
type DataPlaneIntf struct {
SocketConnectMap map[int]*SocketConnectPair `yaml:"socket_connect_map,omitempty"`
}
type GlobalOptions ¶
type GlobalOptions struct { Credentials *Credentials `yaml:"credentials,omitempty"` Qemu *Qemu `yaml:"qemu,omitempty"` Build *Build `yaml:"build,omitempty"` }
type Hardware ¶
type Hardware struct { Memory int `yaml:"memory,omitempty"` Acceleration []string `yaml:"acceleration,omitempty"` MonitorPort int `yaml:"monitor_port,omitempty"` SerialPorts []int `yaml:"serial_ports,omitempty"` NicType string `yaml:"nic_type,omitempty"` NicCount int `yaml:"nic_count,omitempty"` NicPerBus int `yaml:"nic_per_bus,omitempty"` }
type Instance ¶
type Instance struct { Name string `yaml:"name"` PlatformType string `yaml:"platform_type"` Disk string `yaml:"source_disk"` ID int `yaml:"id,omitempty"` PID int `yaml:"pid,omitempty"` Profile string `yaml:"profile,omitempty"` Credentials *Credentials `yaml:"credentials,omitempty"` Hardware *Hardware `yaml:"hardware,omitempty"` MgmtIntf *MgmtIntf `yaml:"mgmt_interface,omitempty"` DataPlaneIntf *DataPlaneIntf `yaml:"data_plane_interfaces,omitempty"` Advanced *Advanced `yaml:"advanced,omitempty"` BootDelay int `yaml:"boot-delay,omitempty"` StartupConfig string `yaml:"startup-config,omitempty"` }
Instance is a struct that represents a qemu virtual machine instance in the boxen configuration.
type Nat ¶
type Nat struct { TCP []*NatPortPair `yaml:"tcp,omitempty"` UDP []*NatPortPair `yaml:"udp,omitempty"` }
type NatPortPair ¶
type NatPortPair struct { InstanceSide int `yaml:"instance_side,omitempty"` HostSide int `yaml:"host_side,omitempty"` }
func (*NatPortPair) String ¶ added in v0.0.4
func (n *NatPortPair) String() string
type Platform ¶
type Platform struct { SourceDisks []string `yaml:"source_disks,omitempty"` Profiles map[string]*Profile `yaml:"profiles,omitempty"` }
Platform contains information about a given platform -- i.e. Arista vEOS -- that is stored in the boxen configuration this includes the available hardware profiles and source disks that have been "installed".
type Profile ¶
type Profile struct { Hardware *ProfileHardware `yaml:"hardware,omitempty"` Advanced *Advanced `yaml:"advanced,omitempty"` TPCNatPorts []int `yaml:"tcp_nat_ports,omitempty"` UDPNatPorts []int `yaml:"udp_nat_ports,omitempty"` }
Profile is a struct containing information about the virtual machine hardware and port allocation as stored in the boxen configuration.
type ProfileHardware ¶
type ProfileHardware struct { Memory int `yaml:"memory,omitempty"` Acceleration []string `yaml:"acceleration,omitempty"` SerialPortCount int `yaml:"serial_port_count,omitempty"` NicType string `yaml:"nic_type,omitempty"` NicCount int `yaml:"nic_count,omitempty"` NicPerBus int `yaml:"nic_per_bus,omitempty"` }
func (*ProfileHardware) ToHardware ¶
func (p *ProfileHardware) ToHardware() *Hardware