sizelimiter

package
v0.13.4 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2025 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNilSizeLimiter = errors.New("size limiter is nil")
)

Functions

This section is empty.

Types

type Middleware

type Middleware struct{}

Middleware struct is the size limiter middleware

func NewMiddleware

func NewMiddleware() *Middleware

NewMiddleware returns a new instance of the size limiter middleware

Returns:

  • *Middleware: The middleware instance

func (Middleware) Limit

func (m Middleware) Limit(bytesSizeLimit int64) func(next http.Handler) http.Handler

Limit is the size limiter middleware

Parameters:

  • bytesSizeLimit: The maximum size of the request body in bytes

Returns:

  • func(next http.Handler) http.Handler: The middleware function

type SizeLimiter

type SizeLimiter interface {
	Limit(bytesSizeLimit int64) func(next http.Handler) http.Handler
}

SizeLimiter is the interface for the size limiter middleware

Jump to

Keyboard shortcuts

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