versioncheck

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package versioncheck fetches upstream release metadata without changing inventory state.

Index

Constants

This section is empty.

Variables

View Source
var ErrRunning = errors.New("version check already running")

Functions

func Compare

func Compare(current, latest string) (int, bool)

Compare accepts only plain numeric releases. Unknown formats are never called outdated.

Types

type Checker

type Checker struct {
	DB                           *sql.DB
	Client                       *http.Client
	GitHubURL, DockerURL, EOLURL string // Test servers may replace the fixed public API origins.
	Now                          func() time.Time
}

func (Checker) Run

func (c Checker) Run(ctx context.Context, dueOnly bool) (Summary, error)

Run checks all configured services, or only records older than 24 hours during scheduled runs.

func (Checker) Start

func (c Checker) Start(ctx context.Context)

Start checks stale services at startup and hourly thereafter. The context ends with the server.

type Config

type Config struct {
	Provider   string `json:"provider"`
	Repository string `json:"repository"`
	Image      string `json:"image"`
	Product    string `json:"product"`
}

type Result

type Result struct {
	ServiceID string `json:"service_id"`
	Status    string `json:"status"`
	Error     string `json:"error,omitempty"`
}

type Summary

type Summary struct {
	Checked int      `json:"checked"`
	Failed  int      `json:"failed"`
	Skipped int      `json:"skipped"`
	Results []Result `json:"results"`
}

Jump to

Keyboard shortcuts

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