Documentation ¶
Index ¶
- func GetClientIP(req *http.Request) (string, error)
- func GetOwnIP() (string, error)
- func Is2xx(status int) bool
- func SetReqCtx(targetCtx context.Context, data *RequestContextData) context.Context
- func Write(writer http.ResponseWriter, status int, headers map[string]string, ...)
- type RequestContextData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetClientIP ¶
GetClientIP extracts the client IP Address from the given HTTP request.
Types ¶
type RequestContextData ¶ added in v1.1.0
type RequestContextData struct { // ID is the unique identifier of this request. ID string }
RequestContextData is an HTTP request's context information.
func GetReqCtx ¶ added in v1.1.0
func GetReqCtx(targetCtx context.Context) *RequestContextData
GetReqCtx extracts the request's context data from the target context and returns it.
Click to show internal directories.
Click to hide internal directories.