middleware

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CORS

func CORS() gin.HandlerFunc

func Gzip

func Gzip() gin.HandlerFunc

func GzipWithConfig

func GzipWithConfig(config CompressionConfig) gin.HandlerFunc

func Logger

func Logger() gin.HandlerFunc

func TokenAuth

func TokenAuth(config TokenAuthConfig) gin.HandlerFunc

TokenAuth creates a middleware for token authentication.

Types

type CompressionConfig

type CompressionConfig struct {
	// Level is the compression level (1-9)
	Level int
	// ExcludedPaths are paths that should not be compressed
	ExcludedPaths []string
	// ExcludedExtensions are file extensions that should not be compressed
	ExcludedExtensions []string
}

CompressionConfig contains configuration for the compression middleware

type TokenAuthConfig

type TokenAuthConfig struct {
	// Token is the authentication token.
	Token string
}

TokenAuthConfig contains the configuration for token-based authentication.

Jump to

Keyboard shortcuts

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