http

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTimeout = errors.New("timeout has occurred")

ErrTimeout is returned when the crawling failed because of timeout issue

Functions

This section is empty.

Types

type Client

type Client interface {
	// Get the corresponding URL
	// this methods follows redirections
	Get(URL string) (Response, error)
}

Client is an HTTP client

func NewFastHTTPClient

func NewFastHTTPClient(c *fasthttp.Client) Client

NewFastHTTPClient create a new Client using fasthttp.Client as backend

type Response

type Response interface {
	// Headers returns the response headers
	Headers() map[string]string
	// Body return the response body
	Body() io.Reader
}

Response is an HTTP response

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL