Documentation
¶
Index ¶
Constants ¶
View Source
const ( // HeaderUserID is the HTTP header where the user ID is stored. HeaderUserID = "X-ID" // HeaderTenantID is the HTTP header where the tenant ID is stored. HeaderTenantID = "X-Tenant-ID" )
Variables ¶
This section is empty.
Functions ¶
func Log ¶
func Log(next echo.HandlerFunc) echo.HandlerFunc
Log is the echo middleware that logs one line per request, with the user and tenant taken from the headers named above. It measures with the wall clock deliberately: this is elapsed time, not a timestamp a test needs to control.
It runs the error handler itself rather than returning the error, so the status that handler writes is already on the response by the time the line is built, and it unwraps echo's [http.ResponseWriter] to read that status and the byte count back out.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.