Documentation
¶
Overview ¶
Package versioning negotiates API versions and emits deprecation and sunset metadata. Applications own compatibility policy and migration communication.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetVersion ¶
func GetVersion(c *gpp.Context) string
GetVersion retrieves the negotiated API version from the context.
func Middleware ¶
func Middleware(defaultVersion string) gpp.HandlerFunc
Middleware creates a package-level API versioning middleware for simple usage.
Types ¶
type DeprecationInfo ¶
type DeprecationInfo struct {
SunsetDate string
}
DeprecationInfo describes the announced sunset date for an API version.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles API version negotiation (Header, Query, Path) and RFC 8594 Deprecation/Sunset headers.
func NewManager ¶
NewManager initializes an API Versioning Manager.
func (*Manager) Deprecate ¶
Deprecate marks an API version as deprecated with an RFC 8594 Sunset Date (e.g. "2027-01-01").
func (*Manager) Middleware ¶
func (m *Manager) Middleware() gpp.HandlerFunc
Middleware returns API Versioning Middleware performing header negotiation and deprecation warnings.