httputil

package
v0.0.0-...-3bed8bd Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Apple = &http.Client{
	Transport: appleTLSTransport,
	Timeout:   1 * time.Minute,
}
View Source
var MaxRetries = 50
View Source
var Media = &http.Client{

	Timeout:   5 * time.Minute,
	Transport: normalTransport,
}
View Source
var Normal = &http.Client{
	Timeout:   1 * time.Minute,
	Transport: normalTransport,
}
View Source
var Slow = &http.Client{
	Timeout:   2 * time.Minute,
	Transport: slowTransport,
}

Functions

func Do

func Do(client *http.Client, req *http.Request) (*http.Response, []byte, error)

func DoCustomOutput

func DoCustomOutput(client *http.Client, req *http.Request, out io.WriteSeeker) (*http.Response, []byte, error)

func FormatCurl

func FormatCurl(cli *http.Client, req *http.Request) string

func IncreaseTimeout

func IncreaseTimeout(ctx context.Context, client *http.Client)

func Prepare

func Prepare(ctx context.Context, method, url string, body []byte) (*http.Request, error)

func PrepareCustom

func PrepareCustom(ctx context.Context, method, url string, getBody func() (io.ReadCloser, error)) (*http.Request, error)

Types

type StatusAccepter

type StatusAccepter interface {
	AcceptStatus(status int) bool
}

Jump to

Keyboard shortcuts

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