Documentation
¶
Index ¶
- Variables
- type AAAARecord
- type ARecord
- type ArgError
- type Audit
- type CAARecord
- type CNAMERecord
- type Client
- type ClientParams
- type DHCIDRecord
- type DLVRecord
- type DNAMERecord
- type DNSKEYRecord
- type DNSLookupResponse
- type DNSLookupService
- type DNSRecord
- type DNSRecords
- type DSRecord
- type ErrorMessage
- type ErrorResponse
- type HINFORecord
- type LOCRecord
- type MBRecord
- type MDRecord
- type MFRecord
- type MXRecord
- type NAPTRRecord
- type NSAPRecord
- type NSEC3PARAMRecord
- type NSECRecord
- type NSRecord
- type NULLRecord
- type Option
- type PTRRecord
- type RPRecord
- type Response
- type SOARecord
- type SRVRecord
- type SSHFPRecord
- type TLSARecord
- type TXTRecord
- type Time
Constants ¶
This section is empty.
Variables ¶
var ErrUnsupportedDNSType = errors.New("unknown DNS type")
Functions ¶
This section is empty.
Types ¶
type AAAARecord ¶
type AAAARecord struct { // Address is the IPv6 address. Address string `json:"address"` // contains filtered or unexported fields }
type ARecord ¶
type ARecord struct { // Address is the IPv4 address. Address string `json:"address"` // contains filtered or unexported fields }
type Audit ¶
type Audit struct { // CreatedDate is the date the DNS records are collected on whoisxmlapi.com CreatedDate Time `json:"createdDate"` // UpdatedDate is the date the DNS records updated on whoisxmlapi.com UpdatedDate Time `json:"updatedDate"` }
Audit is a part of the DNS Lookup API response It represents dates when Whois record was collected and updated in our database
type CNAMERecord ¶
type Client ¶
type Client struct { // DNSLookupService is an interface for DNS Lookup API DNSLookupService // contains filtered or unexported fields }
Client is the client for DNS 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 // DNSLookupBaseURL is the endpoint for 'DNS Lookup API' service DNSLookupBaseURL *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 DHCIDRecord ¶
type DHCIDRecord struct { // Data is several octets of binary data. Data []string `json:"data"` // contains filtered or unexported fields }
type DLVRecord ¶
type DLVRecord struct { // Algorithm lists the algorithm number of the DNSKEY RR. Algorithm int `json:"algorithm"` // Digest is the digest of a DNSKEY RR. Digest []string `json:"digest"` // DigestID identifies the algorithm used to construct the digest. DigestID int `json:"digestID"` // Footprint lists the key tag of the DNSKEY RR. Footprint int `json:"footprint"` // contains filtered or unexported fields }
type DNAMERecord ¶
type DNSKEYRecord ¶
type DNSKEYRecord struct { // Algorithm is the public key's cryptographic algorithm. Algorithm int `json:"algorithm"` // Flags is the Zone Key flag. Flags int `json:"flags"` // Footprint is the key ID/tag/footprint. Footprint int `json:"footprint"` // Key holds the public key material. Key []string `json:"key"` // Protocol is the protocol identifier. Protocol int `json:"protocol"` // PublicKey is the public key description. PublicKey string `json:"publicKey"` // contains filtered or unexported fields }
type DNSLookupResponse ¶
type DNSLookupResponse struct { // DomainName is a domain name. DomainName string `json:"domainName"` // Types are codes of the requested DNS record types. Types []int `json:"types"` // DNSTypes is the comma-separated list of DNS record types. DNSTypes string `json:"dnsTypes"` // Audit is a part of the DNS Lookup API response // It represents dates when Whois record was collected and updated in our database Audit Audit `json:"audit"` // DNSRecords is the struct where returned DNS records are stored. DNSRecords DNSRecords `json:"dnsRecords"` }
DNSLookupResponse is a response of DNS Lookup API.
type DNSLookupService ¶
type DNSLookupService interface { // Get returns parsed DNS Lookup API response Get(ctx context.Context, domainName string, opts ...Option) (*DNSLookupResponse, *Response, error) // GetRaw returns raw DNS Lookup API response as Response struct with Body saved as a byte slice GetRaw(ctx context.Context, domainName string, opts ...Option) (*Response, error) }
DNSLookupService is an interface for DNS Lookup API.
type DNSRecord ¶
type DNSRecord struct { CommonFields commonFields // Raw is a not parsed DNS record. Raw json.RawMessage `json:"raw"` // ParseError is the error that occurred during parsing. ParseError error `json:"parseError"` }
type DNSRecords ¶
type DNSRecords struct { // All is a slice of all parsed DNS records. All []DNSRecord // A is a slice of the parsed A records. A []ARecord // AAAA is a slice of the parsed AAAA records. AAAA []AAAARecord // NS is a slice of the parsed NS records. NS []NSRecord // MX is a slice of the parsed MX records. MX []MXRecord // MD is a slice of the parsed MD records. MD []MDRecord // MF is a slice of the parsed MF records. MF []MFRecord // MB is a slice of the parsed MF records. MB []MBRecord // SOA is a slice of the parsed SOA records. SOA []SOARecord // TXT is a slice of the parsed TXT records. TXT []TXTRecord // CAA is a slice of the parsed CAA records. CAA []CAARecord // CNAME is a slice of the parsed CNAME records. CNAME []CNAMERecord // DNAME is a slice of the parsed CNAME records. DNAME []DNAMERecord // DNSKEY is a slice of the parsed DNSKEY records. DNSKEY []DNSKEYRecord // NSEC3PARAM is a slice of the parsed NSEC3PARAM records. NSEC3PARAM []NSEC3PARAMRecord // NSEC is a slice of the parsed NSEC records. NSEC []NSECRecord // DS is a slice of the parsed DS records. DS []DSRecord // PTR is a slice of the parsed PTR records. PTR []PTRRecord // SRV is a slice of the parsed SRV records. SRV []SRVRecord // LOC is a slice of the parsed LOC records. LOC []LOCRecord // NAPTR is a slice of the parsed NAPTR records. NAPTR []NAPTRRecord // HINFO is a slice of the parsed HINFO records. HINFO []HINFORecord // RP is a slice of the parsed RP records. RP []RPRecord // DLV is a slice of the parsed DLV records. DLV []DLVRecord // SSHFP is a slice of the parsed SSHFP records. SSHFP []SSHFPRecord // TLSA is a slice of the parsed TLSA records. TLSA []TLSARecord // DHCID is a slice of the parsed DHCID records. DHCID []DHCIDRecord // NSAP is a slice of the parsed NSAP records. NSAP []NSAPRecord // NULL is a slice of the parsed NULL records. NULL []NULLRecord }
DNSRecords is the struct where returned DNS records are stored.
func (*DNSRecords) MarshalJSON ¶
func (r *DNSRecords) MarshalJSON() ([]byte, error)
MarshalJSON encodes DNSRecords.
func (*DNSRecords) UnmarshalJSON ¶
func (r *DNSRecords) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes DNS records and returns them as a DNSRecords struct.
type DSRecord ¶
type DSRecord struct { // Algorithm lists the algorithm number of the DNSKEY RR. Algorithm int `json:"algorithm"` // Digest is the digest of a DNSKEY RR. Digest []string `json:"digest"` // DigestID identifies the algorithm used to construct the digest. DigestID int `json:"digestID"` // Footprint lists the key tag of the DNSKEY RR. Footprint int `json:"footprint"` // contains filtered or unexported fields }
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 HINFORecord ¶
type LOCRecord ¶
type LOCRecord struct { // Altitude is the altitude of the center of the sphere described by the Size field. Altitude float64 `json:"altitude"` // HPrecision is the horizontal precision of the data, in centimeters. HPrecision float64 `json:"hPrecision"` // Latitude is the latitude of the center of the sphere described by the Size field. Latitude float64 `json:"latitude"` // Longitude is the longitude of the center of the sphere described by the Size field. Longitude float64 `json:"longitude"` // Size is the diameter of a sphere enclosing the described entity. Size float64 `json:"size"` // VPrecision is the vertical precision of the data, in centimeters. VPrecision float64 `json:"vPrecision"` // contains filtered or unexported fields }
type MBRecord ¶
type MBRecord struct { // AdditionalName is a compressed domain name which specifies a host which has the specified mailbox. AdditionalName string `json:"additionalName"` // Mailbox is a compressed domain name which specifies a host which has the specified mailbox. Mailbox string `json:"mailbox"` // contains filtered or unexported fields }
type MDRecord ¶
type MDRecord struct { // AdditionalName is a compressed domain name which specifies a host which has a mail agent for the domain. AdditionalName string `json:"additionalName"` // MailAgent is a compressed domain name which specifies a host which has a mail agent for the domain. MailAgent string `json:"mailAgent"` // contains filtered or unexported fields }
type MFRecord ¶
type MFRecord struct { // AdditionalName is a compressed domain name which specifies a host which has a mail agent for the domain. AdditionalName string `json:"additionalName"` // MailAgent is a compressed domain name which specifies a host which has a mail agent for the domain. MailAgent string `json:"mailAgent"` // contains filtered or unexported fields }
type NAPTRRecord ¶
type NAPTRRecord struct { // Flags are flags to control aspects of the rewriting and interpretation of the fields in the record // as part of NAPTR record. Flags string `json:"flags"` // Order is a 16-bit unsigned integer specifying the order in which the NAPTR records MUST be processed. Order int `json:"order"` // Preference is a 16-bit unsigned integer that specifies the order in which NAPTR records with equal Order values // SHOULD be processed. Preference int `json:"preference"` // Regexp contains a substitution expression that is applied to the original string held by the client. Regexp string `json:"regexp"` // Replacement is a domain name which is the next domain-name to query for // depending on the potential values found in the flags field. Replacement string `json:"replacement"` // Service specifies the Service Parameters applicable to the delegation path. Service string `json:"service"` // contains filtered or unexported fields }
type NSAPRecord ¶
type NSAPRecord struct { // Address is a variable length string of octets containing the NSAP. Address string `json:"address"` // contains filtered or unexported fields }
type NSEC3PARAMRecord ¶
type NSEC3PARAMRecord struct { // Flags are 8 one-bit flags. Flags int `json:"flags"` // HashAlgorithm is the cryptographic hash algorithm used to construct the hash-value. HashAlgorithm int `json:"hashAlgorithm"` // Iterations defines the number of additional times the hash function has been performed. Iterations int `json:"iterations"` // Salt is a value which appended to the original owner name before hashing. Salt []string `json:"salt"` // contains filtered or unexported fields }
type NSECRecord ¶
type NSRecord ¶
type NSRecord struct { // Target is the name server. Target string `json:"target"` // contains filtered or unexported fields }
type NULLRecord ¶
type NULLRecord struct { // Data is anything, so long as it is 65535 octets or less. Data []string `json:"data"` // contains filtered or unexported fields }
type Option ¶
Option adds parameters to the query.
func OptionCallback ¶
OptionCallback sets a javascript function used when outputFormat is JSON; this is an implementation known as JSONP which invokes the callback on the returned response.
func OptionOutputFormat ¶
OptionOutputFormat sets Response output format JSON | XML. Default: JSON.
func OptionType ¶
OptionType sets types of DNS records that should be returned. DNS type: A, NS, SOA, MX, etc. You can specify multiple comma-separated values, e.g., A,SOA,TXT; all records can be retrieved with type=_all (by default).
type PTRRecord ¶
type PTRRecord struct { // Target is a domain name. Target string `json:"target"` // contains filtered or unexported fields }
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 SOARecord ¶
type SOARecord struct { // Admin is the email address of the administrator. Admin string `json:"admin"` // Host is the primary master name server. Host string `json:"host"` // Expire is the number of seconds after which secondary name servers should stop answering request // if the master does not respond. Expire int `json:"expire"` // Minimum is the negative response caching TTL. Minimum int `json:"minimum"` // Refresh is the number of seconds after which secondary name servers should query the master for the SOA record, // to detect zone changes. Refresh int `json:"refresh"` // Retry is the number of seconds after which secondary name servers should retry to request the serial number // from the master if the master does not respond. Retry int `json:"retry"` // Serial is the serial number. Serial int `json:"serial"` // contains filtered or unexported fields }
type SRVRecord ¶
type SRVRecord struct { // Port is the port on the target host of the service. Port int `json:"port"` // Priority is the priority of the target host. Priority int `json:"priority"` // Target is the domain name of the target host. Target string `json:"target"` // Weight is a server selection mechanism. Weight int `json:"weight"` // contains filtered or unexported fields }
type SSHFPRecord ¶
type SSHFPRecord struct { // Algorithm describes the algorithm of the public key. Algorithm int `json:"algorithm"` // DigestType describes the message-digest algorithm used to calculate the fingerprint of the public key. DigestType int `json:"digestType"` // FingerPrint is calculated over the public key blob. FingerPrint []string `json:"fingerPrint"` // contains filtered or unexported fields }
type TLSARecord ¶
type TLSARecord struct { // CertificateAssociationData specifies the "certificate association data" to be matched. CertificateAssociationData []string `json:"certificateAssociationData"` // CertificateUsage specifies the provided association that will be used to match the certificate // presented in the TLS handshake. CertificateUsage int `json:"certificateUsage"` // MatchingType specifies how the certificate association is presented. MatchingType int `json:"matchingType"` // Selector specifies which part of the TLS certificate presented by the server will be matched against // the association data. Selector int `json:"selector"` // contains filtered or unexported fields }
type TXTRecord ¶
type TXTRecord struct { // Strings is the slice of text strings as part of the TXT record. Strings []string `json:"strings"` // contains filtered or unexported fields }
type Time ¶
Time is a helper wrapper on time.Time.
func (Time) MarshalJSON ¶
MarshalJSON encodes time as DNS Lookup API does.
func (*Time) UnmarshalJSON ¶
UnmarshalJSON decodes time as DNS Lookup API does.