Documentation ¶
Index ¶
- func String(string string) *string
- func Uint64(uint64 uint64) *uint64
- type APIKeyTransport
- type Client
- type LookupOptions
- type RData
- type RDataLookupIPNetOptions
- type RDataLookupIPOptions
- type RDataLookupNameOptions
- type RDataLookupRawOptions
- type RDataService
- func (s *RDataService) LookupIP(ip net.IP, opt *RDataLookupIPOptions) ([]RData, *Response, error)
- func (s *RDataService) LookupIPNet(ipnet net.IPNet, opt *RDataLookupIPNetOptions) ([]RData, *Response, error)
- func (s *RDataService) LookupName(name string, opt *RDataLookupNameOptions) ([]RData, *Response, error)
- func (s *RDataService) LookupRaw(raw []byte, opt *RDataLookupRawOptions) ([]RData, *Response, error)
- type RRSet
- type RRSetLookupNameOptions
- type RRSetService
- type Rate
- type Response
- type Timestamp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APIKeyTransport ¶
type APIKeyTransport struct { APIKey string // Transport to use when making requests, defaults to http.DefaultTransport if nil. Transport http.RoundTripper }
APIKeyTransport is a http.RoundTripper that adds the APIKey to each request.
func (*APIKeyTransport) Client ¶
func (t *APIKeyTransport) Client() *http.Client
Client returns a *http.Client that makes APIKey authenticated requests
type Client ¶
type Client struct { // Base URL for API requests. Defaults to the public DNSDB API. BaseURL should always be specified with a trailing slash. BaseURL *url.URL // User agent used when communicating with the DNSDB API. UserAgent string // Service are used for communication with the different parts of the DNSDB API. RRSet *RRSetService RData *RDataService // contains filtered or unexported fields }
A Client manages communication with the DNSDB API.
func NewClient ¶
NewClient returns a new DNSDB API client. It will fallback to http.DefaultClient if no client is provided
func (*Client) NewLookupRequest ¶
NewLookupRequest is a convienience function that extends NewRequest for Lookup methods
type LookupOptions ¶
type LookupOptions struct { Limit int64 `url:"limit,omitempty"` TimeFirstBefore time.Time `url:"time_first_before,omitempty"` TimeFirstAfter time.Time `url:"time_first_after,omitempty"` TimeLastBefore time.Time `url:"time_last_before,omitempty"` TimeLastAfter time.Time `url:"time_last_after,omitempty"` }
LookupOptions defines the optional parameters to all lookup calls
type RData ¶
type RData struct { Count *uint64 `json:"count"` TimeFirst *Timestamp `json:"time_first"` TimeLast *Timestamp `json:"time_last"` ZoneTimeFirst *Timestamp `json:"zone_time_first"` ZoneTimeLast *Timestamp `json:"zone_time_last"` RRName *string `json:"rrname"` RRType *string `json:"rrtype"` RData *string `json:"rdata"` }
RData as described at https://api.dnsdb.info/#rdata-lookups
type RDataLookupIPNetOptions ¶
type RDataLookupIPNetOptions struct { RRType string LookupOptions }
RDataLookupIPNetOptions specifies the optional parameters to the RDataService.LookupIPNet method.
type RDataLookupIPOptions ¶
type RDataLookupIPOptions struct { RRType string LookupOptions }
RDataLookupIPOptions specifies the optional parameters to the RDataService.LookupIP method.
type RDataLookupNameOptions ¶
type RDataLookupNameOptions struct { RRType string LookupOptions }
RDataLookupNameOptions specifies the optional parameters to the RDataService.LookupName method.
type RDataLookupRawOptions ¶
type RDataLookupRawOptions struct { RRType string LookupOptions }
RDataLookupRawOptions specifies the optional parameters to the RDataService.LookupRaw method.
type RDataService ¶
type RDataService service
RDataService communicates with the rdata related methods of the DNSDB API.
func (*RDataService) LookupIP ¶
func (s *RDataService) LookupIP(ip net.IP, opt *RDataLookupIPOptions) ([]RData, *Response, error)
LookupIP fetches all matching records for the provided IP
func (*RDataService) LookupIPNet ¶
func (s *RDataService) LookupIPNet(ipnet net.IPNet, opt *RDataLookupIPNetOptions) ([]RData, *Response, error)
LookupIPNet fetches all matching records for the provided IPNet
func (*RDataService) LookupName ¶
func (s *RDataService) LookupName(name string, opt *RDataLookupNameOptions) ([]RData, *Response, error)
LookupName fetches all matching records for the provided name
func (*RDataService) LookupRaw ¶
func (s *RDataService) LookupRaw(raw []byte, opt *RDataLookupRawOptions) ([]RData, *Response, error)
LookupRaw fetches all matching records for the provided raw bytes and optional RRType (set to "")
type RRSet ¶
type RRSet struct { Count *uint64 `json:"count"` Bailiwick *string `json:"bailiwick"` TimeFirst *Timestamp `json:"time_first"` TimeLast *Timestamp `json:"time_last"` ZoneTimeFirst *Timestamp `json:"zone_time_first"` ZoneTimeLast *Timestamp `json:"zone_time_last"` RRName *string `json:"rrname"` RRType *string `json:"rrtype"` RData []string `json:"rdata"` }
RRSet as described at https://api.dnsdb.info/#rrest-results
type RRSetLookupNameOptions ¶
type RRSetLookupNameOptions struct { RRType string Bailiwick string LookupOptions }
RRSetLookupNameOptions specifies the optional parameters to the RRSetService.LookupName method.
type RRSetService ¶
type RRSetService service
RRSetService communicates with the rrset related methods of the DNSDB API.
func (*RRSetService) LookupName ¶
func (s *RRSetService) LookupName(ownerName string, opt *RRSetLookupNameOptions) ([]RRSet, *Response, error)
LookupName fetches all matching records for the given owner name
type Rate ¶
type Rate struct { Limit int `json: "reset"` Remaining int `json: "limit"` Reset Timestamp `json: "remaining"` }
Rate represents the current rate limit
type Response ¶
Response is a DNSDB API response. We wrap the standard http.Response and provided the Rate object from the response
type Timestamp ¶
Timestamp represents a time generated from a JSON string
func NewTimestamp ¶
Make a new Timestamp from a unix timestamp
func (*Timestamp) UnmarshalJSON ¶
UnmarshalJSON helps unmarshal UNIX dates in JSON