Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // ReverseIP is an interface for Reverse IP/DNS API ReverseIP // contains filtered or unexported fields }
Client is the client for Reverse IP/DNS API services.
func NewBasicClient ¶
NewBasicClient creates Client with recommended parameters.
func NewClient ¶
func NewClient(apiKey string, params ClientParams) *Client
NewClient creates Client with specified parameters.
type ClientParams ¶
type ClientParams struct { // HTTPClient is the client used to access API endpoint // If it's nil then value API client uses http.DefaultClient HTTPClient *http.Client // ReverseIPBaseURL is the endpoint for 'Reverse IP/DNS API' service ReverseIPBaseURL *url.URL }
ClientParams is used to create Client. None of parameters are mandatory and leaving this struct empty works just fine for most cases.
type ErrorMessage ¶
ErrorMessage is the error message.
func (*ErrorMessage) Error ¶
func (e *ErrorMessage) Error() string
Error returns error message as a string.
type ErrorResponse ¶
ErrorResponse is returned when the response status code is not 2xx.
func (*ErrorResponse) Error ¶
func (e *ErrorResponse) Error() string
Error returns error message as a string.
type Option ¶
Option adds parameters to the query.
func OptionFrom ¶
OptionFrom sets the domain name which is used as an offset for the results returned.
func OptionOutputFormat ¶
OptionOutputFormat sets Response output format JSON | XML. Default: JSON.
type Response ¶
type Response struct { *http.Response // Body is the byte slice representation of http.Response Body Body []byte }
Response is the http.Response wrapper with Body saved as a byte slice.
type Result ¶
type Result struct { // Name is the domain name. Name string `json:"name"` // FirstSeen is the timestamp of the first time that the record was seen. FirstSeen int64 `json:"first_seen"` // LastVisit is the timestamp of the last update for this record. LastVisit int64 `json:"last_visit"` }
Result is a part of the Reverse IP/DNS API response.
type ReverseIP ¶
type ReverseIP interface { // Get returns parsed Reverse IP/DNS API response. Get(ctx context.Context, ip net.IP, opts ...Option) (*ReverseIPResponse, *Response, error) // GetRaw returns raw Reverse IP/DNS API response as the Response struct with Body saved as a byte slice. GetRaw(ctx context.Context, ip net.IP, opts ...Option) (*Response, error) }
ReverseIP is an interface for Reverse IP/DNS API.
type ReverseIPResponse ¶
type ReverseIPResponse struct { // Result is a segment that contains info about the resulting data. Result []Result `json:"result"` // CurrentPage is the selected page. CurrentPage string `json:"current_page"` // Size is the number of records in the Result segment. Size int `json:"size"` }
ReverseIPResponse is a response of Reverse IP/DNS API.