httputil

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2023 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseResponse added in v1.5.0

func CloseResponse(resp *http.Response)

CloseResponse closes the response's body. But reads at least some of the body so if it's small the underlying TCP connection will be re-used. No need to check for errors: if it fails, the Transport won't reuse it anyway.

func ListenAndServe

func ListenAndServe(ctx context.Context, server *http.Server, shutdownTimeout ...time.Duration) error

func RetriableStatus added in v1.2.0

func RetriableStatus(statusCode int) bool

RetriableStatus returns true if the HTTP status code should be retried.

We consider retriable status code:
	* 5xx - all server errors
	* 408 - request timeout
	* 429 - too many requests.

func Serve

func Serve(ctx context.Context, server *http.Server, l net.Listener, shutdownTimeout ...time.Duration) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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