middlewares

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MatrixQuery

func MatrixQuery(render *response.Assembler) func(handlerFunc echo.HandlerFunc) echo.HandlerFunc

MatrixQuery is an echo.MiddlewareFunc that verifies basic prerequisites that the request shall comply with and injects the formatted query request into echo.Context

func NewPrometheus added in v1.1.0

func NewPrometheus(e *echo.Echo)

func PopulateCacheHeader

func PopulateCacheHeader(cacheType CacheType) func(handlerFunc echo.HandlerFunc) echo.HandlerFunc

PopulateCacheHeader populates the `Cache-Control`

func RequestMetadata

func RequestMetadata() func(handlerFunc echo.HandlerFunc) echo.HandlerFunc

RequestMetadata is an echo.MiddlewareFunc that populates response.RequestMetadata and injects it into echo.Context

func SiteStatsQuery added in v1.1.0

func SiteStatsQuery(render *response.Assembler) func(handlerFunc echo.HandlerFunc) echo.HandlerFunc

SiteStatsQuery is an echo.MiddlewareFunc that verifies siteStats.Query parameters and inject to echo.Context

Types

type CacheType

type CacheType string

CacheType describes the type of cache shall be used, which its value is the content of the `Cache-Control` header that is being populated

const (
	// CacheTypeStatic describes the resource should never be changed and therefore is safe for long-term caching
	CacheTypeStatic CacheType = "public, max-age=31356000"
	// CacheTypeDynamic describes the resource as if it is a valuable-to-cache dynamic resource
	CacheTypeDynamic CacheType = "public, max-age=300, must-revalidate"
	// CacheTypeNoCache describes the resource should always not be cached
	CacheTypeNoCache CacheType = "no-store"
)

Jump to

Keyboard shortcuts

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