Documentation
¶
Overview ¶
Package http provides a HTTP transport and some utitities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetClientIP ¶
GetClientIP returns client ip from following sources, in this order: X-Real-Ip, X-Forwarded-For (first ip in an eventual list), r.RemoteAddr. Note: we assume these headers come from a trusted proxy, as client can also set them to any arbitrary value which may lead to ip spoofing.
func GetRequestBody ¶
GetRequestBody MaxBytesReader prevents clients from accidentally or maliciously sending a large request and wasting server resources.
func Health ¶
func Health(probe *xtransport.Probe) http.HandlerFunc
Health can be registered as health probe endpoint.
func NewHTTPTransport ¶
func NewHTTPTransport( httpSrv *http.Server, logger xlog.Logger, probe *xtransport.Probe, ) xtransport.Transport
NewHTTPTransport instantiates a new HTTP transport.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package client provides http client contract and utitlities.
|
Package client provides http client contract and utitlities. |
|
Package middleware provides HTTP handler useful decorators.
|
Package middleware provides HTTP handler useful decorators. |
Click to show internal directories.
Click to hide internal directories.