Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMiddleware ¶
func NewMiddleware(logger AccessLogger) func(http.Handler) http.Handler
Types ¶
type AccessLogger ¶
type AccessLogger interface {
Log(entry *Entry)
}
func NewAccessLogger ¶
func NewAccessLogger(name string, opts Options) (AccessLogger, error)
type Entry ¶
type Entry struct { Username string `json:"username"` Latency time.Duration `json:"latency"` ClientIP string `json:"client_ip"` Request Request `json:"request"` Response Response `json:"response"` }
func (*Entry) MarshalZerologObject ¶
type JsonLogger ¶
type JsonLogger struct {
// contains filtered or unexported fields
}
func NewJsonLogger ¶
func NewJsonLogger(name string, writer io.Writer) *JsonLogger
func (*JsonLogger) Log ¶
func (l *JsonLogger) Log(entry *Entry)
type TextLogger ¶
type TextLogger struct {
// contains filtered or unexported fields
}
func NewTextLogger ¶
func NewTextLogger(name string, writer io.Writer) *TextLogger
func (*TextLogger) Log ¶
func (l *TextLogger) Log(entry *Entry)
Click to show internal directories.
Click to hide internal directories.