Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // SubdomainsLookup is an interface for Subdomains Lookup API SubdomainsLookup // contains filtered or unexported fields }
Client is the client for Subdomains Lookup 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 // SubdomainsLookupBaseURL is the endpoint for 'Subdomains Lookup API' service SubdomainsLookupBaseURL *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 an 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 OptionOutputFormat ¶
OptionOutputFormat sets Response output format JSON | XML. Default: JSON.
type Record ¶
type Record struct { // Domain is the domain name. Domain string `json:"domain"` // FirstSeen is the timestamp of the first time that the record was seen. FirstSeen int64 `json:"firstSeen"` // LastSeen is the timestamp of the last update for this record. LastSeen int64 `json:"lastSeen"` }
Record contains info about subdomain: a domain name and timestamps.
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 { // Count is the number of records in result segment. Count int `json:"count"` // Records contains info about the resulting data: a domain name and timestamps. Records []Record `json:"records"` }
Result is the resulting object.
type SubdomainsLookup ¶
type SubdomainsLookup interface { // Get returns parsed Subdomains Lookup API response Get(ctx context.Context, domainName string, opts ...Option) (*SubdomainsLookupResponse, *Response, error) // GetRaw returns raw Subdomains Lookup API response as Response struct with Body saved as a byte slice GetRaw(ctx context.Context, domainName string, opts ...Option) (*Response, error) }
SubdomainsLookup is an interface for Subdomains Lookup API.
type SubdomainsLookupResponse ¶
type SubdomainsLookupResponse struct { // Search is the target domain name. Search string `json:"search"` // Result is the resulting object. Result Result `json:"result"` }
SubdomainsLookupResponse is a response of Subdomains Lookup API.