Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccessLog ¶
func AccessLog(logger *AccessLogger) gin.HandlerFunc
func DynamicDebugLogging ¶
DynamicDebugLogging open the debug level logging in dynamically
func PanicRecovery ¶
func PanicRecovery(logger *log.Logger) gin.HandlerFunc
PanicRecovery uses to catch panic in api handler
func WithTimeout ¶
func WithTimeout(timeout time.Duration, responder gin.HandlerFunc) gin.HandlerFunc
WithTimeout would abort the process of the request if the `timeout` is reached and revoke the responder function.
Types ¶
type AccessLogger ¶
type AccessLogger struct {
// contains filtered or unexported fields
}
func NewAccessLogger ¶
func NewAccessLogger(writer io.Writer, pattern string) (*AccessLogger, error)
func (*AccessLogger) Disabled ¶
func (accessLogger *AccessLogger) Disabled()
func (*AccessLogger) Enabled ¶
func (accessLogger *AccessLogger) Enabled()
func (*AccessLogger) SetSlowRequestThreshold ¶
func (accessLogger *AccessLogger) SetSlowRequestThreshold(duration time.Duration)
func (*AccessLogger) Status ¶
func (accessLogger *AccessLogger) Status() string
type ResponseWriter ¶
type ResponseWriter interface { http.ResponseWriter http.Hijacker http.Flusher Status() int Size() int FirstByteTime() time.Time }
func NewResponseWriter ¶
func NewResponseWriter(w http.ResponseWriter) ResponseWriter
Click to show internal directories.
Click to hide internal directories.