Documentation ¶
Index ¶
- func ContextWithLogger(ctx context.Context, logger Logger) context.Context
- func Decode(r *http.Request, t any, acceptEmpty bool) error
- func Encode(w http.ResponseWriter, v any) error
- func Err(code int, err error) error
- func ErrHandler(h Handler) http.Handler
- func ErrHandlerFunc(h HandlerFunc) http.Handler
- func ErrStr(code int, err string) error
- func RunServerGracefully(ctx context.Context, srv *http.Server, logger Logger) error
- func With(h http.Handler, mws ...Middleware) http.Handler
- type FormParser
- type GzipResponseWriter
- type Handler
- type HandlerFunc
- type Logger
- type LoggerFunc
- type Middleware
- type Outputer
- type StatusError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrHandler ¶
func ErrHandlerFunc ¶
func ErrHandlerFunc(h HandlerFunc) http.Handler
func RunServerGracefully ¶
Types ¶
type FormParser ¶
type GzipResponseWriter ¶
type GzipResponseWriter struct { http.ResponseWriter // contains filtered or unexported fields }
func NewGzipResponseWriter ¶
func NewGzipResponseWriter(w http.ResponseWriter) *GzipResponseWriter
func (*GzipResponseWriter) Close ¶
func (w *GzipResponseWriter) Close() error
type HandlerFunc ¶
func (HandlerFunc) ServeHTTP ¶
func (h HandlerFunc) ServeHTTP(ctx context.Context, w http.ResponseWriter, r *http.Request) error
type LoggerFunc ¶
func (LoggerFunc) Printf ¶
func (f LoggerFunc) Printf(format string, args ...any)
type Middleware ¶
func WithCacheCtrlHeader ¶
func WithCacheCtrlHeader(ttl time.Duration) Middleware
func WithCompression ¶
func WithCompression() Middleware
func WithLogger ¶
func WithLogger(logger Logger) Middleware
type StatusError ¶
func (StatusError) Error ¶
func (s StatusError) Error() string
func (StatusError) Unwrap ¶
func (s StatusError) Unwrap() error
Click to show internal directories.
Click to hide internal directories.