deprecation

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package deprecation emits runtime Deprecation, Sunset, and Link headers.

The middleware follows the current HTTP header contracts for deprecation and sunset signaling while leaving response status and body behavior unchanged.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(config Config, next http.Handler) (http.Handler, error)

Handler constructs middleware and wraps next.

Types

type Config

type Config struct {
	Disabled     bool
	DeprecatedAt time.Time
	SunsetAt     time.Time
	Links        []Link
}

Config configures runtime deprecation and sunset response headers.

type Link struct {
	URL   string
	Rel   string
	Type  string
	Title string
}

Link describes a Link header associated with deprecation or sunset policy.

type Middleware

type Middleware struct {
	// contains filtered or unexported fields
}

Middleware emits deprecation headers without changing response behavior.

func New

func New(config Config) (*Middleware, error)

New constructs deprecation middleware.

func (*Middleware) Handler

func (m *Middleware) Handler(next http.Handler) http.Handler

Handler wraps the next handler.

Jump to

Keyboard shortcuts

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