Documentation
¶
Overview ¶
Package versionregistry stores short-lived, deployment-scoped Gateway versions.
Index ¶
Constants ¶
const TTL = 3 * time.Minute
TTL is the window in which a Gateway report remains active.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Group ¶
type Group struct {
Version string `json:"version"`
BuildKind string `json:"build_kind"`
Count int `json:"count"`
}
Group contains only aggregate version information, never node identities.
func GroupNodes ¶
GroupNodes groups canonical stable versions by build kind. Unknown and uncomparable versions remain visible, and output is ordered by version/kind.
type Node ¶
type Node struct {
SchemaVersion int `json:"schema_version"`
Namespace string `json:"namespace"`
InstanceID string `json:"instance_id"`
Version string `json:"version"`
BuildKind string `json:"build_kind"`
}
Node is the version-report wire protocol, independent of request metrics.
type Store ¶
type Store interface {
Upsert(context.Context, Node) error
List(context.Context) ([]Node, error)
Delete(context.Context, string) error
}
Store manages active reports in one deployment namespace.
func NewMemoryStore ¶
NewMemoryStore creates an isolated, in-memory report store. An empty namespace defaults to "default", and a nil clock uses time.Now. Invalid configuration is reported by every operation.
func NewRedisStore ¶
NewRedisStore borrows client without taking ownership of its lifecycle. Empty namespace defaults to "default"; deployments sharing a Redis DB must configure distinct namespaces. Invalid configuration fails every operation without issuing Redis commands.