Documentation ¶
Index ¶
- func BodyDump(option Option, maxBodySizeBytes int) echo.MiddlewareFunc
- func CORS(enable bool) echo.MiddlewareFunc
- func DetailLog(option Option) echo.MiddlewareFunc
- func GetRequestID(c echo.Context) string
- func InjectRequestID() echo.MiddlewareFunc
- func PassThroughDebugFlag() echo.MiddlewareFunc
- func Recover(log logs.Logger) interface{}
- func SimpleRecord(option Option) echo.MiddlewareFunc
- type EnableFetchFunc
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BodyDump ¶ added in v1.0.8
func BodyDump(option Option, maxBodySizeBytes int) echo.MiddlewareFunc
BodyDump dump body for http request.
func DetailLog ¶ added in v1.0.8
func DetailLog(option Option) echo.MiddlewareFunc
DetailLog print detail log for http request. Like: {"time":"2022-07-19T16:03:44.525493+08:00","id":"eSRLySVRiUAXs0VRu0AC0ETteIRKtAHg","remote_ip":"127.0.0.1","host":"localhost:9529","method":"GET","uri":"/test","user_agent":"curl/7.79.1","status":401,"error":"","latency":273532041,"latency_human":"273.532041ms","bytes_in":0,"bytes_out":25}
func GetRequestID ¶ added in v1.0.8
GetRequestID get request id from context.
func InjectRequestID ¶ added in v1.0.8
func InjectRequestID() echo.MiddlewareFunc
InjectRequestID inject request id for http request.
func PassThroughDebugFlag ¶ added in v1.0.8
func PassThroughDebugFlag() echo.MiddlewareFunc
PassThroughDebugFlag is the middleware to pass through the debug flag.
func SimpleRecord ¶ added in v1.0.8
func SimpleRecord(option Option) echo.MiddlewareFunc
SimpleRecord record begin and end for http request.
Types ¶
type EnableFetchFunc ¶ added in v1.0.8
EnableFetchFunc is a func used by middleware invoker to define how to get enable switch.