Documentation ¶
Index ¶
- type Action
- type AdvancedSearchTerm
- type ArgError
- type BasicSearchTerms
- type Client
- type ClientParams
- type DomainItem
- type ErrorMessage
- type ErrorResponse
- type Messages
- type Option
- func OptionCreatedDateFrom(date time.Time) Option
- func OptionCreatedDateTo(date time.Time) Option
- func OptionExpiredDateFrom(date time.Time) Option
- func OptionExpiredDateTo(date time.Time) Option
- func OptionPunycode(punycode bool) Option
- func OptionResponseFormat(outputFormat string) Option
- func OptionSinceDate(date time.Time) Option
- func OptionUpdatedDateFrom(date time.Time) Option
- func OptionUpdatedDateTo(date time.Time) Option
- type RegistrantAlert
- type RegistrantAlertResponse
- type Response
- type Time
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdvancedSearchTerm ¶
type AdvancedSearchTerm struct { // Field is the WHOIS field to search in. Field string `json:"field"` // Term is the search string. Case insensitive. Term string `json:"term"` // ExactMatch defines whether the field should exactly match the search term. // If false, the field is allowed to contain a search term as a substring. ExactMatch bool `json:"exactMatch,omitempty"` }
AdvancedSearchTerm is a part of the Registrant Alert API request.
type BasicSearchTerms ¶
type BasicSearchTerms struct { // Include is an array of search strings. // All of them should be present in the domain's registrant details. Include []string `json:"include,omitempty"` // Exclude is an array of search strings. // All of them should NOT be present in the domain's registrant details. Exclude []string `json:"exclude,omitempty"` }
BasicSearchTerms is a part of the Registrant Alert API request.
type Client ¶
type Client struct { // RegistrantAlert is an interface for Registrant Alert API RegistrantAlert // contains filtered or unexported fields }
Client is the client for Registrant Alert 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 // RegistrantAlertBaseURL is the endpoint for 'Registrant Alert API' service RegistrantAlertBaseURL *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 DomainItem ¶
type DomainItem struct { // DomainName is the full domain name. DomainName string `json:"domainName"` // Action is the related action. Possible actions: added | updated | dropped | discovered. Action Action `json:"action"` // Date is the event date. Date Time `json:"date"` }
DomainItem is a part of the Registrant Alert API response.
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 Messages ¶
type Messages []string
Messages is a wrapper on []string.
func (*Messages) UnmarshalJSON ¶
UnmarshalJSON decodes the error messages returned by Registrant Alert API.
type Option ¶
type Option func(v *registrantAlertRequest)
Option adds parameters to the query.
func OptionCreatedDateFrom ¶
OptionCreatedDateFrom searches through domains created after the given date.
func OptionCreatedDateTo ¶
OptionCreatedDateTo searches through domains created before the given date.
func OptionExpiredDateFrom ¶
OptionExpiredDateFrom searches through domains expired after the given date.
func OptionExpiredDateTo ¶
OptionExpiredDateTo searches through domains expired before the given date.
func OptionPunycode ¶
OptionPunycode sets the punycode option. If true, domain names in the response will be encoded to Punycode. Default: true.
func OptionResponseFormat ¶
OptionResponseFormat sets Response output format json | xml. Default: json.
func OptionSinceDate ¶
OptionSinceDate results in search through activities discovered since the given date.
func OptionUpdatedDateFrom ¶
OptionUpdatedDateFrom searches through domains updated after the given date.
func OptionUpdatedDateTo ¶
OptionUpdatedDateTo searches through domains updated before the given date.
type RegistrantAlert ¶
type RegistrantAlert interface { // BasicPreview returns only the number of domains for the basic search. No credits deducted. BasicPreview(ctx context.Context, basicSearchTerms *BasicSearchTerms, option ...Option) (int, *Response, error) // BasicPurchase returns parsed Registrant Alert API response for the basic search. BasicPurchase(ctx context.Context, basicSearchTerms *BasicSearchTerms, option ...Option) (*RegistrantAlertResponse, *Response, error) // BasicRawData returns raw Registrant Alert API response for the basic search. BasicRawData(ctx context.Context, basicSearchTerms *BasicSearchTerms, option ...Option) (*Response, error) // AdvancedPreview returns only the number of domains for the advanced search. No credits deducted. AdvancedPreview(ctx context.Context, advancedSearchTerms []AdvancedSearchTerm, option ...Option) (int, *Response, error) // AdvancedPurchase returns parsed Registrant Alert API response for the advanced search. AdvancedPurchase(ctx context.Context, advancedSearchTerms []AdvancedSearchTerm, option ...Option) (*RegistrantAlertResponse, *Response, error) // AdvancedRawData returns raw Registrant Alert API response for the advanced search. AdvancedRawData(ctx context.Context, advancedSearchTerms []AdvancedSearchTerm, option ...Option) (*Response, error) }
RegistrantAlert is an interface for Registrant Alert API.
type RegistrantAlertResponse ¶
type RegistrantAlertResponse struct { // DomainsList is the list of domains matching the criteria. DomainsList []DomainItem `json:"domainsList"` // DomainsCount is the number of domains matching the criteria. DomainsCount int `json:"domainsCount"` }
RegistrantAlertResponse is a response of Registrant Alert API.
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 Time ¶
Time is a helper wrapper on time.Time
func (Time) MarshalJSON ¶
MarshalJSON encodes time as Registrant Alert API does.
func (*Time) UnmarshalJSON ¶
UnmarshalJSON decodes time as Registrant Alert API does.