middleware

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CORS

func CORS(allowedOrigins ...string) kite.Middleware

func CORSWithConfig

func CORSWithConfig(cfg CORSConfig) kite.Middleware

func DefaultLoggerFormat

func DefaultLoggerFormat(method, path string, statusCode int, latency time.Duration) string

func Logger

func Logger() kite.Middleware

func LoggerWithConfig

func LoggerWithConfig(cfg LoggerConfig) kite.Middleware

func MaxBodySize

func MaxBodySize(maxBytes int64) kite.Middleware

func MaxBodySizeWithConfig

func MaxBodySizeWithConfig(cfg MaxBodySizeConfig) kite.Middleware

func Recovery

func Recovery() kite.Middleware

func RecoveryWithConfig

func RecoveryWithConfig(cfg RecoveryConfig) kite.Middleware

func RequestID

func RequestID() kite.Middleware

func RequestIDWithConfig

func RequestIDWithConfig(cfg RequestIDConfig) kite.Middleware

Types

type CORSConfig

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

type LoggerConfig

type LoggerConfig struct {
	Output io.Writer
	Format func(method, path string, statusCode int, latency time.Duration) string
	Skip   func(ctx *kite.Context) bool
}

type MaxBodySizeConfig

type MaxBodySizeConfig struct {
	MaxBytes int64
}

type RecoveryConfig

type RecoveryConfig struct {
	OnPanic func(ctx *kite.Context, recovered any, stack []byte) error
}

type RequestIDConfig

type RequestIDConfig struct {
	Header    string
	Generator func() string
}

Jump to

Keyboard shortcuts

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