versionstatus

package
v0.9.10 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package versionstatus combines local identity, active Gateway reports and shared update-check state without caching comparisons against Gateway nodes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ComponentView

type ComponentView struct {
	Component string                  `json:"component"`
	Current   string                  `json:"current"`
	Latest    string                  `json:"latest,omitempty"`
	State     string                  `json:"state"`
	Count     int                     `json:"count,omitempty"`
	Source    updatecheck.SourceState `json:"source"`
}

type GatewayView

type GatewayView struct {
	Status string                  `json:"status"`
	Scope  string                  `json:"scope"`
	Groups []versionregistry.Group `json:"groups"`
}

GatewayView exposes aggregate versions only, never node identities.

type Service

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

func New

func New(identity productversion.Identity, store versionregistry.Store, checker *updatecheck.Checker, scope string) *Service

New borrows store and owns only the supplied checker's lifecycle. Construction never starts background work or contacts a source.

func (*Service) Check

func (s *Service) Check(ctx context.Context) (Updates, error)

Check uses the checker's instance-wide manual cooldown and in-flight request. Per-source failures remain in the returned component states.

func (*Service) Close

func (s *Service) Close()

Close is idempotent and never closes the store's borrowed Redis client.

func (*Service) Report

func (s *Service) Report(ctx context.Context, node versionregistry.Node) error

func (*Service) Start

func (s *Service) Start()

func (*Service) Summary

func (s *Service) Summary(ctx context.Context, canManage bool) (Summary, error)

func (*Service) Updates

func (s *Service) Updates(ctx context.Context) (Updates, error)

Updates is read-only with respect to external sources. A fresh registry read ensures expired or newly reported Gateway builds immediately affect notices.

type Summary

type Summary struct {
	Identity         productversion.Identity `json:"identity"`
	Gateway          GatewayView             `json:"gateway"`
	CanManageUpdates bool                    `json:"can_manage_updates"`
}

Summary is the local identity and currently observed Gateway distribution. Update-source details are deliberately absent from this view.

type Updates

type Updates struct {
	Enabled           bool            `json:"enabled"`
	Components        []ComponentView `json:"components"`
	RetryAfterSeconds int             `json:"retry_after_seconds"`
}

func Compose

func Compose(identity productversion.Identity, groups []versionregistry.Group, state updatecheck.CheckResult) Updates

Compose compares the supplied current builds with fresh, ready candidates. Gateway groups must represent active reports at the time of the read.

Jump to

Keyboard shortcuts

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