middleware

package
v0.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 9, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetUserID

func SetUserID(ctx context.Context, userID string) error

func UserID

func UserID(ctx context.Context) (string, error)

Types

type Middleware

type Middleware struct {
	// contains filtered or unexported fields
}

func New

func New(writeErrorBody errorWriter, logger *slog.Logger) *Middleware

func (*Middleware) ContentType

func (m *Middleware) ContentType(contentTypes ...string) func(http.Handler) http.Handler

func (*Middleware) Log

func (m *Middleware) Log(next http.Handler) http.Handler

func (*Middleware) Recover

func (m *Middleware) Recover(h http.Handler) http.Handler

func (*Middleware) RequestSize

func (m *Middleware) RequestSize(maxBytes int64) func(http.Handler) http.Handler

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL