Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // DomainReputation is an interface for Domain Reputation API DomainReputationService // contains filtered or unexported fields }
Client is the client for Domain Reputation 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 // DomainReputationBaseURL is the endpoint for 'Domain Reputation API' service DomainReputationBaseURL *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 DomainReputationResponse ¶
type DomainReputationResponse struct { // Mode is the selected test mode. Mode string `json:"mode"` // ReputationScore is the composite safety score based on numerous security data sources. ReputationScore float64 `json:"reputationScore"` // TestResults is a part of the Domain Reputation API response containing the test results. TestResults []TestResult `json:"testResults"` }
DomainReputationResponse is a response of Domain Reputation API.
type DomainReputationService ¶
type DomainReputationService interface { // Get returns parsed Domain Reputation API response. Get(ctx context.Context, domainName string, opts ...Option) (*DomainReputationResponse, *Response, error) // GetRaw returns raw Domain Reputation API response as the Response struct with Body saved as a byte slice. GetRaw(ctx context.Context, domainName string, opts ...Option) (*Response, error) }
DomainReputationService is an interface for Domain Reputation API.
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 OptionMode ¶
OptionMode sets the check mode. API can check your domain in 2 modes: 'fast' - Only select codes will run—i.e., 62 WHOIS Domain status, 82 Malware Databases check, 87 SSL certificate validity, and 93 WHOIS Domain check—while other tests and data collectors will be disabled. 'full' - all the data and the tests will be processed. Acceptable values: fast | full. Default: fast.
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 TestResult ¶
type TestResult struct { // Test is the test name which reduced the final score. Test string `json:"test"` // TestCode is the unique numeric test identifier. TestCode int `json:"testCode"` // Warnings is the list of warnings detected during the test execution. Warnings []Warning `json:"warnings"` }
TestResult is a part of the Domain Reputation API response containing the test results.