networks

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2022 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

View Source
const (
	VDESwitch   = "vde_switch" // Deprecated
	VDEVMNet    = "vde_vmnet"  // Deprecated
	SocketVMNet = "socket_vmnet"
)
View Source
const (
	ModeHost    = "host"
	ModeShared  = "shared"
	ModeBridged = "bridged"
)

Variables

This section is empty.

Functions

func ConfigFile

func ConfigFile() (string, error)

func Sock added in v0.12.0

func Sock(name string) (string, error)

Sock returns a socket_vmnet socket.

func Sudoers

func Sudoers() (string, error)

func VDESock

func VDESock(name string) (string, error)

VDESock returns a vde socket.

Deprecated. Use Sock.

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) DaemonPath added in v0.12.0

func (config *NetworksConfig) DaemonPath(daemon string) (string, error)

DaemonPath returns the daemon path.

func (*NetworksConfig) IsDaemonInstalled added in v0.12.0

func (config *NetworksConfig) IsDaemonInstalled(daemon string) (bool, error)

IsDaemonInstalled checks whether the daemon is installed.

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) Sock added in v0.12.0

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

Sock returns a socket_vmnet socket.

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

VDESock returns a vde socket.

Deprecated. Use Sock.

func (*NetworksConfig) Validate

func (config *NetworksConfig) Validate() error

func (*NetworksConfig) VerifySudoAccess

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

type Paths

type Paths struct {
	SocketVMNet string `yaml:"socketVMNet"`
	VDESwitch   string `yaml:"vdeSwitch"` // Deprecated
	VDEVMNet    string `yaml:"vdeVMNet"`  // Deprecated
	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