middleware

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AESEncrypt

func AESEncrypt(data, key []byte) ([]byte, error)

func Breaker

func Breaker() fiber.Handler

func CORS

func CORS(cfg CORSConfig) fiber.Handler

func ContentSecurity

func ContentSecurity(key *rsa.PublicKey, strict bool) fiber.Handler

func Cryption

func Cryption(key []byte) fiber.Handler

func Gunzip

func Gunzip() fiber.Handler

func JWT

func JWT(cfg JWTConfig) fiber.Handler

func Logger

func Logger() fiber.Handler

func MaxBytes

func MaxBytes(limit int) fiber.Handler

func MaxConns

func MaxConns(limit int) fiber.Handler

func ParsePublicKey

func ParsePublicKey(pemStr string) (*rsa.PublicKey, error)

func Prometheus

func Prometheus() fiber.Handler

func PrometheusHandler

func PrometheusHandler() fiber.Handler

func Recovery

func Recovery() fiber.Handler

func SSE

func SSE() fiber.Handler

func Shedding

func Shedding() fiber.Handler

func SignBody

func SignBody(key *rsa.PrivateKey, body []byte) (string, error)

func Timeout

func Timeout(d time.Duration) fiber.Handler

func Trace

func Trace(cfg TraceConfig) fiber.Handler

func WebSocket

func WebSocket(handler func(*websocket.Conn)) fiber.Handler

func WebSocketWithConfig

func WebSocketWithConfig(cfg WebSocketConfig, handler func(*websocket.Conn)) fiber.Handler

Types

type CORSConfig

type CORSConfig struct {
	AllowedOrigins   string
	AllowedMethods   string
	AllowedHeaders   string
	AllowCredentials bool
	MaxAge           int
}

func DefaultCORSConfig

func DefaultCORSConfig() CORSConfig

type JWTConfig

type JWTConfig struct {
	Secret      string
	PrevSecret  string
	ContextKey  string
	TokenLookup string
}

func DefaultJWTConfig

func DefaultJWTConfig() JWTConfig

type TraceConfig

type TraceConfig struct {
	Name     string
	Endpoint string
	Sampler  float64
	Batcher  string
}

type WebSocketConfig

type WebSocketConfig struct {
	Origins          []string
	HandshakeTimeout time.Duration
	ReadBufferSize   int
	WriteBufferSize  int
}

Jump to

Keyboard shortcuts

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