Documentation
¶
Index ¶
- Constants
- func BuildRequest(r any) *http.Request
- func BuildResponse(r any) *http.Response
- func Conditional(primary, secondary string) string
- func CreateTo(req *http.Request) string
- func DefaultFormat(o core.Origin, traffic string, start time.Time, duration time.Duration, ...) string
- func Encoding(resp *http.Response) string
- func JsonString(value string) string
- func Log(traffic string, start time.Time, duration time.Duration, req any, resp any, ...)
- func Milliseconds(duration time.Duration) int
- func SetLogFn(fn LogFn)
- func SetOrigin(o core.Origin)
- type Controller
- type LogFn
- type Request
- type RequestImpl
- type Routing
Constants ¶
View Source
const ( InternalTraffic = "internal" EgressTraffic = "egress" IngressTraffic = "ingress" XRequestId = "x-request-id" XRelatesTo = "x-relates-to" ContentEncoding = "Content-Encoding" LocationHeader = "Location" Primary = "primary" Secondary = "secondary" ControllerTimeout = "TO" // Controller struct code ControllerRateLimit = "RL" // Controller struct code RoutingFailover = "FO" // Routing struct code RoutingRedirect = "RD" // Routing struct code )
Variables ¶
This section is empty.
Functions ¶
func BuildRequest ¶
func BuildResponse ¶
func Conditional ¶
func DefaultFormat ¶
func Log ¶
func Log(traffic string, start time.Time, duration time.Duration, req any, resp any, routing Routing, controller Controller)
Log - access logging. Header.Get(XRequestId)), Header.Get(XRelatesTo)), Header.Get(LocationHeader)
func Milliseconds ¶
Milliseconds - convert time.Duration to milliseconds
Types ¶
type Controller ¶
Controller - controller attributes
func NilController ¶
func NilController() Controller
NilController - used when Controller is not applicable
type LogFn ¶
type LogFn func(o core.Origin, traffic string, start time.Time, duration time.Duration, req any, resp any, routing Routing, controller Controller)
LogFn - log function
type RequestImpl ¶
RequestImpl - non HTTP request attributes
Click to show internal directories.
Click to hide internal directories.