Documentation ¶
Index ¶
- Constants
- func DefaultLogFormatter(ctx *LogContext) string
- func DefaultRecoverer(w http.ResponseWriter, r *http.Request, v interface{}, stak []byte)
- type LogContext
- type LogFormatter
- type Logger
- type Option
- func WithAccessLog(logFormatter LogFormatter) Option
- func WithGracefulShutdown(timeout time.Duration, sig ...os.Signal) Option
- func WithIdleTimeout(timeout time.Duration) Option
- func WithLogger(logger Logger) Option
- func WithPort(port int) Option
- func WithReadHeaderTimeout(timeout time.Duration) Option
- func WithReadTimeout(timeout time.Duration) Option
- func WithRecoverer(recoverer Recoverer) Option
- func WithTLS(certFile, keyFile string) Option
- func WithWriteTimeout(timeout time.Duration) Option
- type Recoverer
- type Server
Constants ¶
View Source
const LoggerContextKey ckLogger = 1
Variables ¶
This section is empty.
Functions ¶
func DefaultLogFormatter ¶
func DefaultLogFormatter(ctx *LogContext) string
func DefaultRecoverer ¶
func DefaultRecoverer(w http.ResponseWriter, r *http.Request, v interface{}, stak []byte)
Types ¶
type LogContext ¶
type LogFormatter ¶
type LogFormatter func(*LogContext) string
type Option ¶
func WithAccessLog ¶
func WithAccessLog(logFormatter LogFormatter) Option
func WithGracefulShutdown ¶
func WithIdleTimeout ¶
func WithLogger ¶
func WithReadHeaderTimeout ¶
func WithReadTimeout ¶
func WithRecoverer ¶
func WithWriteTimeout ¶
Click to show internal directories.
Click to hide internal directories.