Documentation
¶
Overview ¶
Package maclookup implements the MACLookup API v2.
Api documentation: https://maclookup.app/api-v2/documentation
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BadAPIRequest ¶
type BadAPIRequest struct {
Err error
}
func (*BadAPIRequest) Error ¶
func (c *BadAPIRequest) Error() string
func (*BadAPIRequest) Unwrap ¶
func (c *BadAPIRequest) Unwrap() error
type BadAPIResponse ¶
type BadAPIResponse struct {
Err error
}
func (*BadAPIResponse) Error ¶
func (c *BadAPIResponse) Error() string
func (*BadAPIResponse) Unwrap ¶
func (c *BadAPIResponse) Unwrap() error
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (Client) CompanyName ¶
func (c Client) CompanyName(mac string) (ResponseVendorName, error)
CompanyName returns company name from API.
Example ¶
//Prevent rate limits error time.Sleep(time.Millisecond * 550) client := New() r, err := client.CompanyName("000000") fmt.Println(err) fmt.Printf("%s", r.Company)
Output: <nil> XEROX CORPORATION
func (Client) Lookup ¶
func (c Client) Lookup(mac string) (ResponseMACInfo, error)
Lookup retrieve MAC information from API.
Example ¶
//Prevent rate limits error time.Sleep(time.Millisecond * 550) client := New() r, err := client.Lookup("000000") fmt.Println(err) fmt.Printf("%+v", r.MACInfo)
Output: <nil> {Found:true MacPrefix:000000 Company:XEROX CORPORATION Address:M/S 105-50C, WEBSTER NY 14580, US Country:US BlockStart:000000000000 BlockEnd:000000FFFFFF BlockSize:16777215 BlockType:MA-L Updated:2015-11-17 IsRand:false IsPrivate:false}
func (*Client) WithAPIKey ¶
WithAPIKey adds apiKey to client.
func (*Client) WithPrefixURI ¶
WithPrefixURI changes the default API prefix url.
func (*Client) WithTimeout ¶
WithTimeout defines a new timeout value for every request.
type CompanyInfo ¶
type HTTPClientError ¶
type HTTPClientError struct {
Err error
}
func (*HTTPClientError) Error ¶
func (c *HTTPClientError) Error() string
func (*HTTPClientError) Unwrap ¶
func (c *HTTPClientError) Unwrap() error
type RateLimitsExceeded ¶
func (*RateLimitsExceeded) Error ¶
func (c *RateLimitsExceeded) Error() string
type ResponseVendorName ¶
type ResponseVendorName struct { RespTime time.Duration RateLimit CompanyInfo }
Source Files
¶
Click to show internal directories.
Click to hide internal directories.