gnhttp

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GNhttp

type GNhttp interface {
	// Get takes a URL and returns back the response status code, MIME type,
	// body of the response and a possible error during the request.
	Get(URL string) (int, string, io.Reader, error)

	// SetConnMax sets maximum wait time for attempting a connection.
	SetConnMax(time.Duration)

	// ConnMax returns wait time for establishing connection.
	ConnMax() time.Duration

	// SetReqMax sets maximum wait time for a result of a request.
	SetReqMax(time.Duration)

	// ReqMax returns wait time for processing an HTTP request.
	ReqMax() time.Duration
}

GNhttp sends a request to a remote url and gets back retuls.

func New

func New(opts ...Option) GNhttp

New creates a new instance of GNhttp.

type Option

type Option func(GNhttp)

Option allows to modify GNhttp instance.

func OptConnMax

func OptConnMax(d time.Duration) Option

OptOptConnMax sets the wait time for establishing a connection.

func OptReqMax

func OptReqMax(d time.Duration) Option

OptReqMax sets the wait time for processing a request.

Jump to

Keyboard shortcuts

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