Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Addr ¶
type Addr struct {
// contains filtered or unexported fields
}
Addr is a hardware/MAC address which supports JSON [un]marshaling.
func AddrFromNet ¶
func AddrFromNet(addr net.HardwareAddr) *Addr
AddrFromNet creates an Addr from a net.HardwareAddr.
func MustParseMAC ¶
MustParseMAC parses the given string to an Addr, or panics if parsing fails.
func (*Addr) IsZeroValue ¶
IsZeroValue returns true if the MAC address is the zero value.
func (*Addr) MarshalJSON ¶
MarshalJSON marshals the MAC address to JSON.
func (*Addr) NetHardwareAddr ¶
func (a *Addr) NetHardwareAddr() net.HardwareAddr
NetHardwareAddr returns the MAC address as a net.HardwareAddr.
func (*Addr) UnmarshalJSON ¶
UnmarshalJSON unmarshals the MAC address from JSON.
type Set ¶
type Set struct {
// contains filtered or unexported fields
}
Set is a (non-concurrency-safe!) set of MAC addresses which supports [un]marshaling to/from a JSON array.
func Intersection ¶
Intersection returns a new set containing the intersection of the two given sets.
func (*Set) AddAllFrom ¶
AddAllFrom adds all MAC addresses from the given set to this set.
func (*Set) MarshalJSON ¶
MarshalJSON marshals the set to a JSON array of strings.
func (*Set) UnmarshalJSON ¶
UnmarshalJSON unmarshals a JSON array of strings into the set.