Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AS ¶ added in v1.1.0
type AS struct { // ASN Autonomous System Number. ASN int `json:"asn"` // Domain Autonomous System Website's URL. Domain string `json:"domain"` // Name Autonomous System Name. Name string `json:"name"` // Route Autonomous System Route. Route string `json:"route"` // Type Autonomous System Type. Type string `json:"type"` }
AS is a part of the Website Categorization API response.
type Category ¶
type Category struct { // Confidence The probability of how the category may be relevant for the website. Confidence float64 `json:"confidence"` // ID The unique category identifier. ID int `json:"id"` // Name The readable name of the category. Name string `json:"name"` }
Category is a part of the Website Categorization API v3 response.
type CategoryItem ¶
type CategoryItem struct { // ID is the unique category identifier. ID int `json:"id"` // Name is the readable name of the category. Name string `json:"name"` }
CategoryItem is part of the category directory.
type Client ¶
type Client struct { // WCategorization is an interface for Website Categorization API WCategorizationService // contains filtered or unexported fields }
Client is the client for Website Categorization 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 // WCategorizationBaseURL is the endpoint for 'Website Categorization API' service WCategorizationBaseURL *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 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 Option ¶
Option adds parameters to the query.
func OptionMinConfidence ¶
OptionMinConfidence sets The minimum confidence for the predictions. The higher this value the fewer false-positive results will be returned. Acceptable values: 0.00 - 1.00. Default: 0.55.
func OptionOrder ¶
OptionOrder sets the categories output order (for GetAllCategories functions only). ABC - output categories ordered alphabetically by the name field. ID - output categories ordered by the id field. Acceptable values: ABC | ID Default: ID.
func OptionOutputFormat ¶
OptionOutputFormat sets Response output format JSON | XML. Default: JSON.
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 WCategorizationResponse ¶
type WCategorizationResponse struct { // AS Autonomous System. AS *AS `json:"as,omitempty"` // DomainName is a domain/website name. DomainName string `json:"domainName"` // Categories is the list of website's categories. Categories []Category `json:"categories"` // CreatedDate is date of initial creation of the WHOIS record for the domain in ISO8601 format. Omitted if the record is not found. CreatedDate *string `json:"createdDate,omitempty"` // WebsiteResponded Determines if the website was active during the crawling. WebsiteResponded bool `json:"websiteResponded"` }
WCategorizationResponse is a response of Website Categorization API.
type WCategorizationService ¶
type WCategorizationService interface { // Get returns parsed Website Categorization API response. Get(ctx context.Context, domainName string, opts ...Option) (*WCategorizationResponse, *Response, error) // GetRaw returns raw Website Categorization API response as the Response struct with Body saved as a byte slice. GetRaw(ctx context.Context, domainName string, opts ...Option) (*Response, error) // GetAllCategories returns all possible categories. GetAllCategories(ctx context.Context, opts ...Option) (categories []CategoryItem, response *Response, err error) // GetAllCategoriesRaw returns all possible categories as a raw API response. GetAllCategoriesRaw(ctx context.Context, opts ...Option) (response *Response, err error) }
WCategorizationService is an interface for Website Categorization API.