httpclient

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const EnvNameHttpPrefix = "EPCC_CLI_HTTP_HEADER_"
View Source
const EnvUrlMatch = "EPCC_CLI_URL_MATCH_REGEXP_(\\d+)"
View Source
const EnvUrlMatchPrefix = "EPCC_CLI_URL_MATCH_SUBSTITUTION_"

Variables

View Source
var DontLog2xxs = false
View Source
var HttpClient = &http.Client{}
View Source
var Limit *rate.Limiter = nil
View Source
var RawHeaders []string
View Source
var Retry429 = false
View Source
var Retry5xx = false
View Source
var RetryAllErrors = false
View Source
var RetryConnectionErrors = false
View Source
var RetryDelay uint = 500
View Source
var UserAgent = fmt.Sprintf("epcc-cli/%s-%s (%s/%s)", version.Version, version.Commit, runtime.GOOS, runtime.GOARCH)

Functions

func AddAdditionalHeadersSpecifiedByFlag added in v0.8.1

func AddAdditionalHeadersSpecifiedByFlag(r *http.Request) error

func DoFileRequest

func DoFileRequest(ctx context.Context, path string, payload io.Reader, contentType string) (response *http.Response, error error)

func DoRequest

func DoRequest(ctx context.Context, method string, path string, query string, payload io.Reader) (response *http.Response, error error)

func Initialize added in v0.10.0

func Initialize(rateLimit uint16, requestTimeout float32, statisticsFrequency int)

func LogStats added in v0.7.0

func LogStats()

Types

type HttpParameterOverrides added in v0.10.0

type HttpParameterOverrides struct {
	QueryParameters []string
	OverrideUrlPath string
}

Jump to

Keyboard shortcuts

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