Versions in this module Expand all Collapse all v1 v1.0.0 Sep 2, 2026 Changes in this version + const MaxBatchSize + const Version + var ErrAuth = errors.New("macadress: invalid or missing API key") + var ErrInvalidMAC = errors.New("macadress: invalid MAC address") + var ErrQuota = errors.New("macadress: quota exceeded") + var ErrRateLimited = errors.New("macadress: rate limit exceeded") + type APIError struct + Body map[string]any + Message string + RequestID string + RetryAfter time.Duration + StatusCode int + func (e *APIError) Error() string + func (e *APIError) Is(target error) bool + type AdministrationType string + const LocallyAdministered + const UniversallyAdministered + type BatchItem struct + Err string + Input string + func (b BatchItem) Failed() bool + type BlockType string + const BlockCID + const BlockIAB + const BlockMAL + const BlockMAM + const BlockMAS + type Client struct + func New(apiKey string, opts ...Option) *Client + func (c *Client) BaseURL() string + func (c *Client) Batch(ctx context.Context, macs []string) ([]BatchItem, error) + func (c *Client) Do(ctx context.Context, method, path string, query url.Values, body any) (*Response, error) + func (c *Client) Health(ctx context.Context) (bool, error) + func (c *Client) Lookup(ctx context.Context, mac string) (*MacResult, error) + func (c *Client) SearchVendors(ctx context.Context, query string, opts ...SearchOption) (*VendorSearchResult, error) + func (c *Client) Vendor(ctx context.Context, mac string) (string, error) + type Device struct + Category DeviceCategory + Confidence string + ExactModelKnown bool + InferenceSource string + PossibleCategories []DeviceCategory + Raw map[string]any + type DeviceCategory string + const DeviceAutomotive + const DeviceCamera + const DeviceComputer + const DeviceConsumerElectronics + const DeviceContainer + const DeviceEmbeddedDevice + const DeviceFirewall + const DeviceGamingConsole + const DeviceIndustrial + const DeviceIoT + const DeviceMediaDevice + const DeviceMedical + const DeviceNetworkInterface + const DevicePrinter + const DeviceRouter + const DeviceServer + const DeviceSmartTV + const DeviceSmartphone + const DeviceStorage + const DeviceSwitch + const DeviceTablet + const DeviceUnknown + const DeviceVirtualMachine + const DeviceWirelessAccessPoint + type MacResult struct + AddressCapacity int64 + AdministrationType AdministrationType + BlockType BlockType + Country string + Device Device + EUI64 string + Explanation string + IPv6LinkLocal string + IsBroadcast bool + IsZero bool + LocallyAdministered bool + MAC string + MatchedPrefix string + Meta Meta + OUI string + Organization string + PotentiallyRandomized bool + PrefixLength int + RandomizationConfidence RandomizationConfidence + RangeEnd string + RangeStart string + Raw map[string]any + Registered bool + SLAPQuadrant string + TransmissionType TransmissionType + Valid bool + VendorAddress string + VendorLookupReliable bool + func (r *MacResult) Get(path string) (any, bool) + type Meta struct + Cached bool + DatabaseVersion string + RequestID string + type Option func(*Client) + func WithBaseURL(raw string) Option + func WithHTTPClient(h *http.Client) Option + func WithTimeout(d time.Duration) Option + func WithUserAgent(s string) Option + type RandomizationConfidence string + const RandomizationLikely + const RandomizationNone + const RandomizationPossible + type Response struct + Body []byte + Header http.Header + StatusCode int + func (r *Response) JSON(v any) error + type SearchOption func(url.Values) + func WithCountry(code string) SearchOption + func WithLimit(n int) SearchOption + type TransmissionType string + const Broadcast + const Multicast + const Unicast + type TransportError struct + Err error + func (e *TransportError) Error() string + func (e *TransportError) Unwrap() error + type VendorBlock struct + Address string + BlockType BlockType + Country string + FirstSeenAt string + IsPrivate bool + LastChangedAt string + MaskBits int + Organization string + PrefixInt int64 + type VendorSearchResult struct + Blocks []VendorBlock + Raw map[string]any + Total int