support

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package support tracks upstream release-line lifecycles, not patch allowlists.

Index

Examples

Constants

View Source
const (
	NodeScheduleURL = "https://raw.githubusercontent.com/nodejs/Release/main/schedule.json"
	NodeReleasesURL = "https://nodejs.org/dist/index.json"
)

Variables

This section is empty.

Functions

func Compare

func Compare(a, b string) int

func UpdateRegistry

func UpdateRegistry(data []byte, catalog Catalog, now time.Time) ([]byte, error)

UpdateRegistry edits only default/version lines, preserving comments and all installer metadata. A default advances only after its upstream line expires.

Types

type Catalog

type Catalog struct {
	Dependencies map[string]Product `json:"dependencies"`
}

func (Catalog) Check

func (c Catalog) Check(name, version string, now time.Time) error

Check rejects known EOL lines. A patch within a maintained line and a newly published line newer than the catalog are not blocked by stale metadata. Actual artifact availability remains the upstream installer's responsibility.

Example
err := fixtureCatalog().Check("node", "20.19.0", testNow)
fmt.Println(strings.Contains(err.Error(), "2026-04-30"))
Output:
true

func (Catalog) Default

func (c Catalog) Default(name, current string, now time.Time) (string, error)

Default preserves a maintained default. After EOL, choose a maintained successor rather than making unversioned configurations fail with age. Prefer the oldest successor with at least 90 days left; Go uses the newest supported toolchain so current Go tools can build.

func (Catalog) Validate

func (c Catalog) Validate() error

type Fetcher

type Fetcher struct {
	Client *http.Client
}

Fetcher allows bounded upstream requests and fixture HTTP clients in tests.

func (Fetcher) Fetch

func (f Fetcher) Fetch(ctx context.Context, now time.Time) (Catalog, error)

type Line

type Line struct {
	Cycle    string `json:"cycle"`
	Released string `json:"released"`
	End      string `json:"end,omitempty"`
	Ended    bool   `json:"ended,omitempty"`
}

type Product

type Product struct {
	Source string `json:"source"`
	// Published-only products have no upstream EOL policy; age alone is not evidence of unsupported releases.
	PublishedOnly bool   `json:"published_only,omitempty"`
	Lines         []Line `json:"lines"`
}

func (Product) Versions

func (p Product) Versions(now time.Time) []string

Jump to

Keyboard shortcuts

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