Documentation ¶
Index ¶
- func FormatBare(hwaddr net.HardwareAddr) string
- func FormatCisco(hwaddr net.HardwareAddr) string
- func FormatEUI(hwaddr net.HardwareAddr) string
- func FormatPgSQL(hwaddr net.HardwareAddr) string
- func FormatUnixCompact(hwaddr net.HardwareAddr) string
- func FormatUnixExpanded(hwaddr net.HardwareAddr) string
- func GetFormatted(mac, format string) (string, error)
- func GetJSON(mac string) (string, error)
- func GetManufacturer(mac net.HardwareAddr) string
- func GetPlain(mac string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatBare ¶
func FormatBare(hwaddr net.HardwareAddr) string
FormatBare takes a net.HardwareAddress and returns a "bare" MAC address, i.e. capital hex characters only with no delimiters.
func FormatCisco ¶
func FormatCisco(hwaddr net.HardwareAddr) string
FormatCisco takes a net.HardwareAddress and returns a Cisco-formatted MAC address.
func FormatEUI ¶
func FormatEUI(hwaddr net.HardwareAddr) string
FormatEUI takes a net.HardwareAddress and returns an EUI-formatted MAC address, i.e. capital hex characters with hyphen ("-") separating each byte's worth of hex characters.
func FormatPgSQL ¶
func FormatPgSQL(hwaddr net.HardwareAddr) string
FormatPgSQL takes a net.HardwareAddress and returns a PostgresQL-formatted MAC address.
func FormatUnixCompact ¶
func FormatUnixCompact(hwaddr net.HardwareAddr) string
FormatUnixCompact takes a net.HardwareAddress and returns a Unix-formatted MAC address with extraneous zeroes ("0") stripped.
func FormatUnixExpanded ¶
func FormatUnixExpanded(hwaddr net.HardwareAddr) string
FormatUnixExpanded takes a net.HardwareAddress and returns a Unix-formatted MAC address.
func GetFormatted ¶
GetFormatted takes a MAC address and output format as strings and returns the MAC address in various vendor formats in the requested output formats. Currently supports 'plain' and 'json' output formats. Outputs 'plain' by default.
func GetJSON ¶
GetJSON takes a MAC address string and returns a non-prettified (single-line) JSON string of that MAC address in common formats. This *could* be implemented as JSON() method on the internal macStruct type, but we want that type to remain internal but have a public way to return the plaintext representation.
func GetManufacturer ¶ added in v0.3.0
func GetManufacturer(mac net.HardwareAddr) string
GetManufacturer takes a net.HardwareAddr and returns the manufacturer to whom that MAC address is registered.
Types ¶
This section is empty.