Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // WContactsService is an interface for Website Contacts API WContactsService // contains filtered or unexported fields }
Client is the client for Website Contacts 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 // WContactsBaseURL is the endpoint for 'Website Contacts API' service WContactsBaseURL *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 OptionHardRefresh ¶
OptionHardRefresh sets the parameter for demanding the website contacts information from scratch.
func OptionOutputFormat ¶
OptionOutputFormat sets Response output format JSON | XML. Default: JSON.
type Phones ¶
type Phones struct { PhoneNumber string `json:"phoneNumber"` Description string `json:"description"` CallHours string `json:"callHours"` }
Phones is the list of phone numbers with description and call hours.
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 SocialLinks ¶
type SocialLinks struct { Facebook string `json:"facebook"` Instagram string `json:"instagram"` LinkedIn string `json:"linkedIn"` Twitter string `json:"twitter"` }
SocialLinks is the Facebook/Instagram/LinkedIn/Twitter URLs found on the main website's page.
type WContactsResponse ¶
type WContactsResponse struct { // DomainName is a domain name. DomainName string `json:"domainName"` // WebsiteResponded Determines if the website was active during the crawling. WebsiteResponded bool `json:"websiteResponded"` // Meta is the metadata defined in the title and description meta tag on the main page. Meta Meta `json:"meta"` // CountryCode is the Website country (ISO-3166). CountryCode string `json:"countryCode"` // CompanyNames is the list of possible company names. CompanyNames []string `json:"companyNames"` // Emails is the list of email addresses with description. Emails []Emails `json:"emails"` // Phones is the list of phone numbers with description and call hours. Phones []Phones `json:"phones"` // PostalAddresses is the list of postal addresses. Every address is presented in the format of: // street, city, state, zip code, country. Some positions may be missing. PostalAddresses []string `json:"postalAddresses"` // SocialLinks is the Facebook/Instagram/LinkedIn/Twitter URLs found on the main website's page. SocialLinks SocialLinks `json:"socialLinks"` }
WContactsResponse is a response of Website Contacts API.
type WContactsService ¶
type WContactsService interface { // Get returns parsed Website Contacts API response Get(ctx context.Context, domainName string, opts ...Option) (*WContactsResponse, *Response, error) // GetRaw returns raw Website Contacts API response as Response struct with Body saved as a byte slice GetRaw(ctx context.Context, domainName string, opts ...Option) (*Response, error) }
WContactsService is an interface for Website Contacts API.