Documentation ¶
Index ¶
- Variables
- func Error(r *http.Request, v ...interface{})
- func Errorf(r *http.Request, format string, v ...interface{})
- func Info(r *http.Request, v ...interface{})
- func Infof(r *http.Request, format string, v ...interface{})
- func StartHttp(host string, port int, handler http.Handler, opts ...StartOption) error
- func StartHttps(host string, port int, certFile, keyFile string, handler http.Handler, ...) error
- type LogCollector
- type StartOption
Constants ¶
This section is empty.
Variables ¶
View Source
var LogContext = contextKey("request_logs")
LogContext is a context key.
Functions ¶
func StartHttps ¶
func StartHttps(host string, port int, certFile, keyFile string, handler http.Handler, opts ...StartOption) error
StartHttps starts a https server.
Types ¶
type LogCollector ¶
type LogCollector struct { Messages []string // contains filtered or unexported fields }
A LogCollector is used to collect logs.
func (*LogCollector) Append ¶
func (lc *LogCollector) Append(msg string)
Append appends msg into log context.
type StartOption ¶
StartOption defines the method to customize http.Server.
Click to show internal directories.
Click to hide internal directories.