requests

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientDoFunc added in v0.4.0

type ClientDoFunc func(ctx context.Context, request *fasthttp.Request) (*fasthttp.Response, error)

type Response

type Response struct {
	StatusCode int
	Error      error
	Time       time.Duration
}

type Responses

type Responses []Response

func Run

func Run(ctx context.Context, requestConfig *config.RequestConfig) (Responses, error)

Run executes the HTTP requests based on the provided request configuration. It checks for internet connection and returns an error if there is no connection. If the context is canceled while checking proxies, it returns the ErrInterrupt. If the context is canceled while sending requests, it returns the response objects obtained so far.

func (Responses) Print

func (respones Responses) Print()

Print prints the responses in a tabular format, including information such as response count, minimum time, maximum time, and average time.

Jump to

Keyboard shortcuts

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