middleware

package
v0.0.0-...-41bf266 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: CC0-1.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ACOEnabled

func ACOEnabled(cfg *service.Config) func(next http.Handler) http.Handler

func CheckConcurrentJobs

func CheckConcurrentJobs(next http.Handler) http.Handler

func ConnectionClose

func ConnectionClose(next http.Handler) http.Handler

func NewRequestParametersContext

func NewRequestParametersContext(ctx context.Context, rp RequestParameters) context.Context

func SecurityHeader

func SecurityHeader(next http.Handler) http.Handler

func ValidateRequestHeaders

func ValidateRequestHeaders(next http.Handler) http.Handler

func ValidateRequestURL

func ValidateRequestURL(next http.Handler) http.Handler

ValidateRequestURL ensure that request matches certain expectations. Any error that it finds will result in a http.StatusBadRequest response. If successful, it populates the request context with RequestParameters that can be used downstream. These paramters can be retrieved by calling RequestParametersFromContext.

Types

type RequestParameters

type RequestParameters struct {
	Since         time.Time
	ResourceTypes []string
	Version       string // e.g. v1, v2
	RequestURL    string
}

func RequestParametersFromContext

func RequestParametersFromContext(ctx context.Context) (RequestParameters, bool)

Jump to

Keyboard shortcuts

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