Documentation
¶
Index ¶
- type Format
- type Logger
- func (t *Logger) Debug(ctx context.Context, args ...any)
- func (t *Logger) Debugf(ctx context.Context, f string, args ...any)
- func (t *Logger) Print(ctx context.Context, args ...any)
- func (t *Logger) Printf(ctx context.Context, f string, args ...any)
- func (t *Logger) SetDebug(v bool)
- func (t *Logger) With(kv ...any) server.Logger
- func (t *Logger) WrapFunc(next http.HandlerFunc) http.HandlerFunc
- type ResponseWriter
- type TermHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Format ¶
type Format uint
func FormatFromString ¶
FormatFromString returns the Format for the given string. Unrecognised values default to Text.
type Logger ¶
func (*Logger) With ¶
Append structured data to the log in key-value pairs where the key is a string and the value is any type
func (*Logger) WrapFunc ¶
func (t *Logger) WrapFunc(next http.HandlerFunc) http.HandlerFunc
type ResponseWriter ¶
type ResponseWriter interface {
http.ResponseWriter
// Status returns the status code of the response or 0 if the response has
// not been written
Status() int
// Written returns whether or not the ResponseWriter has been written.
Written() bool
// Size returns the size of the response body.
Size() int
}
ResponseWriter is a wrapper around http.ResponseWriter that provides extra information about the response. It is recommended that middleware handlers use this construct to wrap a responsewriter if the functionality calls for it.
func NewResponseWriter ¶
func NewResponseWriter(rw http.ResponseWriter) ResponseWriter
NewResponseWriter creates a ResponseWriter that wraps a http.ResponseWriter
type TermHandler ¶
Click to show internal directories.
Click to hide internal directories.