middleware

package
v0.3.16 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeprecationMiddleware added in v0.3.15

func DeprecationMiddleware(cfg DeprecationConfig) func(http.Handler) http.Handler

DeprecationMiddleware injects RFC 8594 deprecation headers (Deprecation, Sunset, Link) on responses to alpha (v1alpha3) API requests. Requests to any other path pass through unchanged.

func WrapWithValidation

func WrapWithValidation(corsAllowedOrigins []string, handler http.Handler) http.Handler

WrapWithValidation wraps a handler with CORS and validation middleware. If corsAllowedOrigins is empty, CORS is disabled (no cross-origin headers are added).

Types

type DeprecationConfig added in v0.3.15

type DeprecationConfig struct {
	// SunsetDate is the date after which the deprecated alpha API may be removed.
	SunsetDate time.Time
}

DeprecationConfig configures the deprecation middleware.

Jump to

Keyboard shortcuts

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