middleware

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultMaxAge provides a 2592000 second (30-day) cache max-age setting
	DefaultMaxAge = int64(60 * 60 * 24 * 30)
)

Variables

This section is empty.

Functions

func NewAuthMiddleware

func NewAuthMiddleware(paths conf.Paths, applicationServices services.Services) func(next http.HandlerFunc) http.HandlerFunc

func ToHttpHandler

func ToHttpHandler(middleware Middleware) func(http.Handler) http.HandlerFunc

Types

type Middleware

type Middleware func(next http.HandlerFunc) http.HandlerFunc

func NewAnalyticsRecorderMiddleware

func NewAnalyticsRecorderMiddleware(analyticsService analytics.Service) Middleware

func NewCORSMiddleware

func NewCORSMiddleware(
	applicationServices services.Services,
	cacheControlMiddleware Middleware) Middleware

func NewCacheControlMiddleware

func NewCacheControlMiddleware(configService config.Service) Middleware

func NewGzipMiddleware

func NewGzipMiddleware(configService config.Service) Middleware

type Middlewares

type Middlewares map[Token]Middleware

func New

func New(paths conf.Paths, applicationServices services.Services) (Middlewares, error)

func (Middlewares) Get

func (middlewares Middlewares) Get(token Token) Middleware

type Token

type Token string
var AnalyticsRecorderMiddleware Token = "AnalyticsRecorderMiddleware"
var AuthMiddleware Token = "AuthMiddleware"
var CacheControlMiddleware Token = "CacheControlMiddleware"
var CorsMiddleware Token = "CorsMiddleware"
var GzipMiddleware Token = "GzipMiddleware"

Jump to

Keyboard shortcuts

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