httputils

package
v0.0.0-...-d879545 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RequestIDHeader = "x-request-id"
)

Variables

This section is empty.

Functions

func CopyHTTPResponse

func CopyHTTPResponse(w http.ResponseWriter, resp *http.Response) error

func CopyHeader

func CopyHeader(dst, src http.Header)

func CopyRequestWithDSN

func CopyRequestWithDSN(req *http.Request, dsn string) (*http.Request, error)

func ErrResponse

func ErrResponse(errormsg string, code int) *http.Response

func GetRequestID

func GetRequestID(r *http.Request) string

func HashRequest

func HashRequest(r *http.Request) (string, error)

Types

type ResponseWrapper

type ResponseWrapper struct {
	http.ResponseWriter
	// contains filtered or unexported fields
}

func NewResponseWrapper

func NewResponseWrapper(w http.ResponseWriter) *ResponseWrapper

func (*ResponseWrapper) GetStatusCode

func (w *ResponseWrapper) GetStatusCode() int

func (*ResponseWrapper) WriteHeader

func (w *ResponseWrapper) WriteHeader(code int)

Jump to

Keyboard shortcuts

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