Documentation ¶
Index ¶
Constants ¶
View Source
const MacAddressPattern = `^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$`
Variables ¶
View Source
var (
ErrInvalidIpAddressClass = errors.New("invalid ip address class")
)
View Source
var (
ErrInvalidMacAddress = errors.New("invalid mac address")
)
Functions ¶
This section is empty.
Types ¶
type IpAddress ¶
type IpAddress struct { Version IpAddressVersion Address Address Nic *Nic }
func NewIpAddress ¶
func NewIpAddress(version IpAddressVersion, address Address, nic *Nic) IpAddress
type IpAddressVersion ¶
type IpAddressVersion int64
const ( IpAddressV4 IpAddressVersion = iota IpAddressV6 IpAddressTypeUnknown )
func DetermineIpAddressType ¶
func DetermineIpAddressType(ip string) IpAddressVersion
func IpAddressTypeFromString ¶
func IpAddressTypeFromString(v string) IpAddressVersion
func (IpAddressVersion) String ¶
func (i IpAddressVersion) String() string
type MacAddress ¶
type MacAddress string
func MacAddressFromString ¶
func MacAddressFromString(v string) (MacAddress, error)
func (MacAddress) String ¶
func (m MacAddress) String() string
Click to show internal directories.
Click to hide internal directories.