Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Domain ¶
type Domain struct { Domain string `json:"domain"` Depth int `json:"depth,omitempty"` Status crawler.WorkerStatus `json:"status,omitempty"` }
Domain struct for using in request & response
type Handler ¶
Handler is used as api.handler
func (*Handler) CreateDomainHandler ¶
CreateDomainHandler is the api.Handler to register domains for crawling. payload is expected in application/json format and is expected to include the domain and depth attributes below is a sample payload with their data types included { "domain": "http://cloudflare.com", "depth": 3 }
domain - required, string depth - int, optional; defaults to 5
func (*Handler) GetDomainHandler ¶
GetDomainHandler is the api.Handler to query domains crawl response tree and is expected to include the domain in the URL path parameter, such as /domains/https%3A%2F%2Fcloudflare.com
as noted in the above example, the domain in the path parameter is expected to include protocol and be a URL-encoded string most libraries perform the URL encoding before sending the request over the wire, but in some cases the user is required to explicitly perform the encoding before making the request; examples for such utilities are cURL / libcurl
func (*Handler) GetDomainStatusHandler ¶
GetDomainStatusHandler is the api.Handler to query domains crawl response status and is expected to include the domain in the URL path parameter, e.g. /domains/https%3A%2F%2Fcloudflare.com/status
as noted in the above example, the domain in the path parameter is expected to include protocol and be a URL-encoded string most libraries perform the URL encoding before sending the request over the wire, but in some cases the user is required to explicitly perform the encoding before making the request; examples for such utilities are cURL / libcurl