Documentation
¶
Index ¶
- func Path(path string) fn.Option
- type AddrFamily
- type AddrSource
- type InterfaceSet
- type InterfacesReader
- type NetworkAdapter
- type NetworkIP
- func (na *NetworkIP) DNSConcatString() string
- func (a *NetworkIP) GetAddrFamilyString() string
- func (a *NetworkIP) GetSourceFamilyString() string
- func (na *NetworkIP) SetAddress(address string) error
- func (na *NetworkIP) SetBroadcast(address string) error
- func (na *NetworkIP) SetConfigType(configType string) error
- func (na *NetworkIP) SetDNSNameServers(address string) error
- func (na *NetworkIP) SetGateway(address string) error
- func (na *NetworkIP) SetMetric(address string) error
- func (na *NetworkIP) SetNetmask(address string) error
- func (na *NetworkIP) SetNetwork(address string) error
- func (na *NetworkIP) SetOthers(address string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type InterfaceSet ¶
type InterfaceSet struct {
InterfacesReader
InterfacesPath string
Others []string
Adapters []*NetworkAdapter
}
func NewInterfaceSet ¶
func NewInterfaceSet(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() ([]string, []*NetworkAdapter, error)
type NetworkAdapter ¶
A representation of a network adapter
func (*NetworkAdapter) ParseAddressFamily ¶
func (na *NetworkAdapter) ParseAddressFamily(AddressFamily string) (AddrFamily, error)
func (*NetworkAdapter) ParseAddressSource ¶
func (na *NetworkAdapter) ParseAddressSource(AddressSource string) (AddrSource, error)
type NetworkIP ¶
type NetworkIP struct {
AddrSource AddrSource
AddrFamily AddrFamily
Address net.IP
Netmask net.IPMask
Broadcast net.IP
Network net.IP
Metric *int
Gateway net.IP
DNSNameServers []net.IP
Others []string
}
func (*NetworkIP) DNSConcatString ¶
func (*NetworkIP) GetAddrFamilyString ¶
func (*NetworkIP) GetSourceFamilyString ¶
func (*NetworkIP) SetAddress ¶
func (*NetworkIP) SetBroadcast ¶
func (*NetworkIP) SetConfigType ¶
func (*NetworkIP) SetDNSNameServers ¶
func (*NetworkIP) SetGateway ¶
func (*NetworkIP) SetNetmask ¶
func (*NetworkIP) SetNetwork ¶
Click to show internal directories.
Click to hide internal directories.