middleware

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: MIT Imports: 6 Imported by: 8

Documentation

Index

Constants

View Source
const (
	AccessControlAllowOrigin      = "Access-Control-Allow-Origin"
	AccessControlAllowMethods     = "Access-Control-Allow-Methods"
	AccessControlAllowHeaders     = "Access-Control-Allow-Headers"
	AccessControlAllowCredentials = "Access-Control-Allow-Credentials"
)

Variables

This section is empty.

Functions

func CORS

func CORS(config ...CORSConfig) gsk.Middleware

func RequestLogger added in v0.5.3

func RequestLogger(next gsk.HandlerFunc) gsk.HandlerFunc

func SecurityHeaders

func SecurityHeaders(next gsk.HandlerFunc) gsk.HandlerFunc

Types

type CORSConfig added in v0.5.3

type CORSConfig struct {
	AllowedOrigins []string
	AllowedMethods []string
	AllowedHeaders []string
	AllowAll       bool
}

type RateLimiter

type RateLimiter struct {
	Middleware gsk.Middleware
	// contains filtered or unexported fields
}

func NewRateLimiter

func NewRateLimiter(rlConfig ...RateLimiterConfig) *RateLimiter

type RateLimiterConfig added in v0.5.3

type RateLimiterConfig struct {
	RequestsPerInterval int
	Interval            time.Duration
}

Jump to

Keyboard shortcuts

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