http

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrClientCanceled   = "The request was cancelled by the client."
	ErrDeadlineExceeded = "" /* 160-byte string literal not displayed */
)
View Source
const StatusClientClosedRequest = 499

StatusClientClosedRequest is the status code for when a client request cancellation of an http request

Variables

This section is empty.

Functions

func ClientHTTPStatusAndError

func ClientHTTPStatusAndError(err error) (int, error)

ClientHTTPStatusAndError returns error and http status that is "safe" to return to client without exposing any implementation details.

func Error

func Error(w http.ResponseWriter, err error)

Error write a go error with the correct status code.

func ErrorWithStatus

func ErrorWithStatus(w http.ResponseWriter, err error, status int)

Types

This section is empty.

Jump to

Keyboard shortcuts

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