httpkit

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddHeader

func AddHeader(header http.Header, key string, values []string) http.Header

func AddXForwardedFor

func AddXForwardedFor(r *http.Request)

func CloneRequest

func CloneRequest(lr *http.Request, url string) (*http.Request, error)

func CopyHeaders

func CopyHeaders(lr *http.Request, rr *http.Request)

func ForwardTo

func ForwardTo(lw http.ResponseWriter, lr *http.Request, url string) error

func ForwardToIntercept

func ForwardToIntercept(lw http.ResponseWriter, lr *http.Request, url string, rInterceptors []func(*http.Request), wInterceptors []func(http.ResponseWriter, *http.Response)) error

func GetAddOnXForwardedFor

func GetAddOnXForwardedFor(r *http.Request) ([]string, bool)

func GetRemoteIP

func GetRemoteIP(r *http.Request) ([]string, error)

func GetValue

func GetValue(r *http.Request, key string) ([]string, bool)

func GetXForwardedFor

func GetXForwardedFor(r *http.Request) ([]string, bool)

func GetXRealIP

func GetXRealIP(r *http.Request) ([]string, bool)

func HeaderToMap

func HeaderToMap(header http.Header) map[string]string

func ParseRequestBody

func ParseRequestBody[T interface{}](req *http.Request) (*T, error)

func ParseResponseBody

func ParseResponseBody[T any](resp *http.Response) (*T, error)

func ParseSchema

func ParseSchema(req *http.Request) string

func ParseSchemaByTLS

func ParseSchemaByTLS(tls *tls.ConnectionState) string

func ReverseProxy

func ReverseProxy(lw http.ResponseWriter, lr *http.Request, uri string) error

func WriteResponse

func WriteResponse(w http.ResponseWriter, resp *http.Response)

Types

This section is empty.

Jump to

Keyboard shortcuts

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