networks

package
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2022 License: Apache-2.0 Imports: 19 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Switch = "switch"
	VMNet  = "vmnet"
)
View Source
const (
	ModeHost    = "host"
	ModeShared  = "shared"
	ModeBridged = "bridged"
)

Variables

This section is empty.

Functions

func ConfigFile

func ConfigFile() (string, error)

func Sudoers

func Sudoers() (string, error)

func VDESock

func VDESock(name string) (string, error)

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 NetworksConfig

type NetworksConfig struct {
	Paths    Paths              `yaml:"paths"`
	Group    string             `yaml:"group,omitempty"` // default: "everyone"
	Networks map[string]Network `yaml:"networks"`
}

func Config

func Config() (NetworksConfig, error)

Config returns the network config from the _config/networks.yaml file.

func DefaultConfig

func DefaultConfig() (NetworksConfig, error)

func (*NetworksConfig) Check

func (config *NetworksConfig) Check(name string) error

func (*NetworksConfig) LogFile

func (config *NetworksConfig) LogFile(name, daemon, stream string) string

func (*NetworksConfig) MkdirCmd

func (config *NetworksConfig) MkdirCmd() string

func (*NetworksConfig) PIDFile

func (config *NetworksConfig) PIDFile(name, daemon string) string

func (*NetworksConfig) StartCmd

func (config *NetworksConfig) StartCmd(name, daemon string) string

func (*NetworksConfig) StopCmd

func (config *NetworksConfig) StopCmd(name, daemon string) string

func (*NetworksConfig) User

func (config *NetworksConfig) User(daemon string) (osutil.User, error)

func (*NetworksConfig) VDESock

func (config *NetworksConfig) VDESock(name string) string

func (*NetworksConfig) Validate

func (config *NetworksConfig) Validate() error

func (*NetworksConfig) VerifySudoAccess

func (config *NetworksConfig) VerifySudoAccess(sudoersFile string) error

type Paths

type Paths struct {
	VDESwitch string `yaml:"vdeSwitch"`
	VDEVMNet  string `yaml:"vdeVMNet"`
	VarRun    string `yaml:"varRun"`
	Sudoers   string `yaml:"sudoers,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL