Documentation ¶
Index ¶
- func ExampleConfig() string
- type Environment
- func (e *Environment) AddBridgeAddress() error
- func (e *Environment) BridgeUp() error
- func (e *Environment) CheckBridge() error
- func (e *Environment) CreateBridge() error
- func (e *Environment) CreateTap(tapName string) error
- func (e *Environment) DelBridgeAddress() error
- func (e *Environment) DeleteBridge() error
- func (e *Environment) DeleteTap(tapName string) error
- func (e *Environment) EnableNat() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Environment ¶
type Environment struct { // Host configuration Interface string `json:"interface"` // Bridge configuration BridgeName string `json:"bridgeName"` BridgeAddress string `json:"bridgeAddress"` // Used during runtime BridgeLink netlink.Link `json:"-"` // VM Nic configuration NicPrefix string `json:"nicPrefix"` NicMacPrefix string `json:"nicMacPrefix"` }
Environment defines the configuration of the shack environment
func OpenFile ¶
func OpenFile(path string) (*Environment, error)
OpenFile will open an file and parse the contents
func (*Environment) AddBridgeAddress ¶
func (e *Environment) AddBridgeAddress() error
AddBridgeAddress will add an address to an existing bridge
func (*Environment) BridgeUp ¶
func (e *Environment) BridgeUp() error
BridgeUp sets the bridge to an enabled state
func (*Environment) CheckBridge ¶
func (e *Environment) CheckBridge() error
CheckBridge will examine the bridge for its status
func (*Environment) CreateBridge ¶
func (e *Environment) CreateBridge() error
CreateBridge will create a new Layer 2 bridge, and configure it
func (*Environment) CreateTap ¶
func (e *Environment) CreateTap(tapName string) error
CreateTap will create a tap device for qemu
func (*Environment) DelBridgeAddress ¶
func (e *Environment) DelBridgeAddress() error
DelBridgeAddress will delete an address on an existing bridge
func (*Environment) DeleteBridge ¶
func (e *Environment) DeleteBridge() error
DeleteBridge will remove an existing bridge
func (*Environment) DeleteTap ¶
func (e *Environment) DeleteTap(tapName string) error
DeleteTap will remove a tap device from qemu and the bridge
func (*Environment) EnableNat ¶
func (e *Environment) EnableNat() error
EnableNat will configure the kernel to enable natting
Click to show internal directories.
Click to hide internal directories.