Documentation ¶
Index ¶
- Constants
- func ConfigFile() (string, error)
- func Sock(name string) (string, error)
- func Sudoers() (string, error)
- func Usernet(name string) (bool, error)
- func VDESock(name string) (string, error)
- type Network
- type Paths
- type YAML
- func (config *YAML) Check(name string) error
- func (config *YAML) DaemonPath(daemon string) (string, error)
- func (config *YAML) IsDaemonInstalled(daemon string) (bool, error)
- func (config *YAML) LogFile(name, daemon, stream string) string
- func (config *YAML) MkdirCmd() string
- func (config *YAML) PIDFile(name, daemon string) string
- func (config *YAML) Sock(name string) string
- func (config *YAML) StartCmd(name, daemon string) string
- func (config *YAML) StopCmd(name, daemon string) string
- func (config *YAML) User(daemon string) (osutil.User, error)
- func (config *YAML) Usernet(name string) (bool, error)
- func (config *YAML) VDESock(name string) string
- func (config *YAML) Validate() error
- func (config *YAML) VerifySudoAccess(sudoersFile string) error
Constants ¶
View Source
const ( VDESwitch = "vde_switch" // Deprecated VDEVMNet = "vde_vmnet" // Deprecated SocketVMNet = "socket_vmnet" )
View Source
const ( SlirpNICName = "eth0" // CIDR is intentionally hardcoded to 192.168.5.0/24, as each of QEMU has its own independent slirp network. SlirpNetwork = "192.168.5.0/24" SlirpGateway = "192.168.5.2" SlirpIPAddress = "192.168.5.15" )
View Source
const ( ModeUserV2 = "user-v2" ModeHost = "host" ModeBridged = "bridged" )
Variables ¶
This section is empty.
Functions ¶
func ConfigFile ¶
Types ¶
type Network ¶
type Network struct { Mode string `yaml:"mode"` // "host", "shared", or "bridged" Interface string `yaml:"interface,omitempty"` // only used by "bridged" networks Gateway net.IP `yaml:"gateway,omitempty"` // only used by "host" and "shared" networks DHCPEnd net.IP `yaml:"dhcpEnd,omitempty"` // default: same as Gateway, last byte is 254 NetMask net.IP `yaml:"netmask,omitempty"` // default: 255.255.255.0 }
type YAML ¶ added in v0.13.0
type YAML struct { Paths Paths `yaml:"paths"` Group string `yaml:"group,omitempty"` // default: "everyone" Networks map[string]Network `yaml:"networks"` }
func DefaultConfig ¶
func (*YAML) DaemonPath ¶ added in v0.13.0
DaemonPath returns the daemon path.
func (*YAML) IsDaemonInstalled ¶ added in v0.13.0
IsDaemonInstalled checks whether the daemon is installed.
func (*YAML) Usernet ¶ added in v0.16.0
Usernet Returns true if the mode of given network is ModeUserV2
func (*YAML) VerifySudoAccess ¶ added in v0.13.0
Source Files ¶
Click to show internal directories.
Click to hide internal directories.