Documentation
¶
Index ¶
- func BackupPath(path string) fn.Option
- func Path(path string) fn.Option
- type AddrFamily
- type AddrSource
- type InterfaceSet
- type InterfacesReader
- type NetworkAdapter
- func (a *NetworkAdapter) GetAddrFamilyString() string
- func (a *NetworkAdapter) GetSourceFamilyString() string
- func (na *NetworkAdapter) ParseAddressFamily(AddressFamily string) (AddrFamily, error)
- func (na *NetworkAdapter) ParseAddressSource(AddressSource string) (AddrSource, error)
- func (na *NetworkAdapter) SetAddress(address string) error
- func (na *NetworkAdapter) SetBroadcast(address string) error
- func (na *NetworkAdapter) SetConfigType(configType string) error
- func (na *NetworkAdapter) SetGateway(address string) error
- func (na *NetworkAdapter) SetNetmask(address string) error
- func (na *NetworkAdapter) SetNetwork(address string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BackupPath ¶
Types ¶
type InterfaceSet ¶
type InterfaceSet struct {
InterfacesReader
InterfacesPath string
Adapters []*NetworkAdapter
}
func NewInterfaceSet ¶
func NewInterfaceSet(opts ...fn.Option) *InterfaceSet
func Parse ¶
func Parse(opts ...fn.Option) *InterfaceSet
func (*InterfaceSet) WriteToFile ¶
func (is *InterfaceSet) WriteToFile(f *os.File) error
type InterfacesReader ¶
type InterfacesReader struct {
// contains filtered or unexported fields
}
TODO get rid of interfaceReader
func NewInterfacesReader ¶
func NewInterfacesReader(filePath string) *InterfacesReader
func (*InterfacesReader) ParseInterfaces ¶
func (ir *InterfacesReader) ParseInterfaces() []*NetworkAdapter
type NetworkAdapter ¶
type NetworkAdapter struct {
Name string
Hotplug bool
Auto bool
Address net.IP
Netmask net.IP
Network net.IP
Broadcast net.IP
Gateway net.IP
AddrSource AddrSource
AddrFamily AddrFamily
}
A representation of a network adapter
func (*NetworkAdapter) GetAddrFamilyString ¶
func (a *NetworkAdapter) GetAddrFamilyString() string
func (*NetworkAdapter) GetSourceFamilyString ¶
func (a *NetworkAdapter) GetSourceFamilyString() string
func (*NetworkAdapter) ParseAddressFamily ¶
func (na *NetworkAdapter) ParseAddressFamily(AddressFamily string) (AddrFamily, error)
func (*NetworkAdapter) ParseAddressSource ¶
func (na *NetworkAdapter) ParseAddressSource(AddressSource string) (AddrSource, error)
func (*NetworkAdapter) SetAddress ¶
func (na *NetworkAdapter) SetAddress(address string) error
func (*NetworkAdapter) SetBroadcast ¶
func (na *NetworkAdapter) SetBroadcast(address string) error
func (*NetworkAdapter) SetConfigType ¶
func (na *NetworkAdapter) SetConfigType(configType string) error
func (*NetworkAdapter) SetGateway ¶
func (na *NetworkAdapter) SetGateway(address string) error
func (*NetworkAdapter) SetNetmask ¶
func (na *NetworkAdapter) SetNetmask(address string) error
func (*NetworkAdapter) SetNetwork ¶
func (na *NetworkAdapter) SetNetwork(address string) error
Click to show internal directories.
Click to hide internal directories.