Help us shape the future of Go! Take the 2026 Go Developer Survey

lifecycle

package
v0.4.0 Latest Latest
Warning

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

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

Documentation

Overview

Package lifecycle reads what a server says about the end of an endpoint's life: the Deprecation header (RFC 9745), the Sunset header (RFC 8594) and the Link relations that point to the documentation and to the successor. A response that carries them is a warning to read before the day it stops working.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Notice

type Notice struct {
	Deprecated bool
	// Since is when the endpoint was deprecated, zero when the server gave no date.
	Since time.Time
	// Sunset is when it will stop working, zero when the server gave none.
	Sunset       time.Time
	DocsURL      string // Link: rel="deprecation"
	SuccessorURL string // Link: rel="successor-version"
}

Notice is what a response announced.

func Read

func Read(h http.Header) (n Notice, found bool)

Read reads the headers of a response. found is false when it announced nothing: a Sunset that is not a date counts as nothing, a Deprecation of any other value still means deprecated.

func (Notice) Describe

func (n Notice) Describe(now time.Time) string

Describe says it in a line: what was announced, how far off the sunset is (or how long ago it was), and where to read more.

Jump to

Keyboard shortcuts

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