Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bond ¶
type Bond struct { EthernetConfig Interfaces []string `json:"interfaces"` Parameters IBondModeParams `json:"parameters"` }
func NewBondMode0 ¶
func NewBondMode0(conf *EthernetConfig, interfaces []string) *Bond
func NewBondMode1 ¶
func NewBondMode1(conf *EthernetConfig, interfaces []string) *Bond
func NewBondMode4 ¶
func NewBondMode4(conf *EthernetConfig, interfaces []string) *Bond
func (*Bond) YAMLString ¶
type BondMode4Params ¶
type BondMode4Params struct {
*BondModeBaseParams
}
func NewBondMode4Params ¶
func NewBondMode4Params() *BondMode4Params
type BondModeActiveBackupParams ¶
type BondModeActiveBackupParams struct { *BondModeBaseParams Primary string `json:"primary"` }
func NewBondModeActiveBackupParams ¶
func NewBondModeActiveBackupParams(primary string) *BondModeActiveBackupParams
type BondModeBaseParams ¶
type BondModeBaseParams struct { Mode string `json:"mode"` MiiMonitorInterval int `json:"mii-monitor-interval,omitzero"` GratuitiousArp int `json:"gratuitiousi-arp,omitzero"` }
func NewBondMode0Params ¶
func NewBondMode0Params() *BondModeBaseParams
func (BondModeBaseParams) GetMode ¶
func (c BondModeBaseParams) GetMode() string
func (*BondModeBaseParams) SetGratutiousArp ¶
func (c *BondModeBaseParams) SetGratutiousArp(g int)
func (*BondModeBaseParams) SetMiiMonitorInterval ¶
func (c *BondModeBaseParams) SetMiiMonitorInterval(i int)
type Configuration ¶
type Configuration struct {
Network *Network `json:"network"`
}
Configuration examples reference from https://netplan.io/examples/ manpage: http://manpages.ubuntu.com/manpages/cosmic/man5/netplan.5.html
func NewConfiguration ¶
func NewConfiguration(network *Network) *Configuration
func (*Configuration) YAMLString ¶
func (c *Configuration) YAMLString() string
type EthernetConfig ¶
type EthernetConfig struct { DHCP4 bool `json:"dhcp4"` Addresses []string `json:"addresses"` Match *EthernetConfigMatch `json:"match"` MacAddress string `json:"macaddress"` Gateway4 string `json:"gateway4"` Routes []*Route `json:"routes"` Nameservers *Nameservers `json:"nameservers"` Mtu int `json:"mtu,omitzero"` }
func NewDHCP4EthernetConfig ¶
func NewDHCP4EthernetConfig() *EthernetConfig
func NewStaticEthernetConfig ¶
func (*EthernetConfig) YAMLString ¶
func (c *EthernetConfig) YAMLString() string
type EthernetConfigMatch ¶
type EthernetConfigMatch struct {
MacAddress string `json:"macaddress"`
}
func NewEthernetConfigMatchMac ¶
func NewEthernetConfigMatchMac(macAddr string) *EthernetConfigMatch
type IBondModeParams ¶
type IBondModeParams interface {
GetMode() string
}
type Nameservers ¶
type Network ¶
type Network struct { Version uint `json:"version"` Renderer NetworkRenderer `json:"renderer"` Ethernets map[string]*EthernetConfig `json:"ethernets"` Bonds map[string]*Bond `json:"bonds"` }
func NewNetwork ¶
func NewNetwork() *Network
func (*Network) AddEthernet ¶
func (n *Network) AddEthernet(name string, ether *EthernetConfig) *Network
func (*Network) YAMLString ¶
type NetworkRenderer ¶
type NetworkRenderer string
const ( VERSION2 = 2 NetworkRendererNetworkd NetworkRenderer = "networkd" )
Click to show internal directories.
Click to hide internal directories.