state

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2026 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadInventory added in v0.4.2

func ReadInventory(path string) ([]string, error)

func SaveMirrors added in v0.4.7

func SaveMirrors(
	path string,
	syncStartedAt time.Time,
	syncCompletedAt time.Time,
	repositories []Asset,
	gists []Asset,
) error

func WriteInventory added in v0.4.2

func WriteInventory(path string, items []string) error

Types

type Asset added in v0.4.1

type Asset struct {
	Name        string `json:"name"`
	LastSuccess bool   `json:"last_success"`

	Cause logging.Cause `json:"cause,omitempty"`
	Error string        `json:"error,omitempty"`
}

Asset records the outcome of syncing one repository or gist mirror.

Cause and Error are only meaningful when LastSuccess is false; both are empty for a successful sync. Cause == logging.CauseCancelled specifically means the sync was deliberately interrupted (Ctrl+C, systemd stop) — the mirror isn't broken, the sync just didn't finish; see health.populateAssets, which relies on exactly this distinction to avoid reporting a false "warning" status after an ordinary interruption.

type MirrorState added in v0.4.7

type MirrorState struct {
	GeneratedAt     string `json:"generated_at"`
	SyncStartedAt   string `json:"sync_started_at,omitempty"`
	SyncCompletedAt string `json:"sync_completed_at,omitempty"`

	Repositories []Asset `json:"repositories"`
	Gists        []Asset `json:"gists"`
}

func LoadMirrors added in v0.4.7

func LoadMirrors(path string) (*MirrorState, error)

Jump to

Keyboard shortcuts

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