middleware

package
v0.5.11 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2023 License: MIT Imports: 7 Imported by: 8

Documentation

Index

Constants

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

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