Documentation
¶
Index ¶
- func GinZap(w logx.Writer, timeFormat string, utc bool) gin.HandlerFunc
- func GinZapWithConfig(w logx.Writer, conf *Config) gin.HandlerFunc
- func NewCachedReadCloser(rc io.ReadCloser) *cachedReadCloser
- func NewCachedResponseWriter(w gin.ResponseWriter) *cachedResponseWriter
- func RecoveryWithZap(w logx.Writer, stack bool) gin.HandlerFunc
- func TimeOut(d time.Duration) gin.HandlerFunc
- func Translations() gin.HandlerFunc
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GinZap ¶
Ginzap returns a gin.HandlerFunc (middleware) that logs requests using uber-go/zap.
Requests with errors are logged using zap.Error(). Requests without errors are logged using zap.Info().
It receives:
- A time package format string (e.g. time.RFC3339).
- A boolean stating whether to use UTC time zone or local.
func GinZapWithConfig ¶
func GinZapWithConfig(w logx.Writer, conf *Config) gin.HandlerFunc
func NewCachedReadCloser ¶
func NewCachedReadCloser(rc io.ReadCloser) *cachedReadCloser
func NewCachedResponseWriter ¶
func NewCachedResponseWriter(w gin.ResponseWriter) *cachedResponseWriter
func RecoveryWithZap ¶
func RecoveryWithZap(w logx.Writer, stack bool) gin.HandlerFunc
func Translations ¶
func Translations() gin.HandlerFunc
Types ¶
Click to show internal directories.
Click to hide internal directories.