infrastructureroots

package
v0.62.1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 21 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package infrastructureroots runs the operator-owned DataTug root check.

Index

Constants

View Source
const Database = "(default)"
View Source
const Project = "sneat-eur3-1"

Variables

View Source
var ErrFenced = errors.New("infrastructure monitor lease superseded")
View Source
var ErrInvalidState = errors.New("infrastructure monitor counter invalid or exhausted")
View Source
var ErrOutboxFull = errors.New("infrastructure monitor outbox full")

Functions

func DefaultCatalogArtifact

func DefaultCatalogArtifact() []byte

Types

type Alert

type Alert struct {
	ID              string
	Kind            string
	At              time.Time
	Project         string
	Database        string
	RegistryDigest  string
	CatalogDigest   string
	CatalogRevision string
	Unexpected      []string
}

Alert has metadata only. Delivery is at least once; crash after send may resend.

type Evidence

type Evidence struct {
	At              time.Time
	Project         string
	Database        string
	RegistryDigest  string
	CatalogDigest   string
	CatalogRevision string
	Status          string
	Unexpected      []string
	Legacy          []string
	Run             *detective.CheckRun
}

type Monitor

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

func New

func New(o Options) (*Monitor, error)

func NewObserver

func NewObserver(o Options) (*Monitor, error)

NewObserver constructs a freshness/delivery worker without a root lister.

func (*Monitor) CheckFreshness

func (m *Monitor) CheckFreshness(ctx context.Context) error

CheckFreshness must run independently. Missing or 30h-old successful scans are stale even if the source is still being attempted. It never enumerates.

func (*Monitor) DeliverPending

func (m *Monitor) DeliverPending(ctx context.Context) (bool, error)

DeliverPending sends at most one oldest event and durably acknowledges it. Fencing prevents concurrent normal delivery. Crashes can cause duplicates.

func (*Monitor) RunDue

func (m *Monitor) RunDue(ctx context.Context) (bool, error)

RunDue saves fenced metadata evidence and durable transition alerts. Source failure retries in 15 minutes and preserves LastSuccess; success is daily.

type Options

type Options struct {
	DB                dal.DB
	RegistryDigest    string
	CatalogArtifact   []byte
	CatalogDigest     string
	CatalogRevision   string
	AuthorizeDelivery func(context.Context) error
	ListRoots         func(context.Context, string, string) ([]string, error)
	SendAlert         func(context.Context, Alert) error
	Now               func() time.Time
}

Options are operator-only dependencies. ListRoots must enumerate all roots or fail, including partial batches. It must never read collection documents. CatalogArtifact is the exact operator-pinned private project Check JSON. RegistryDigest and CatalogDigest are SHA256 hex; CatalogRevision is its Git SHA. Runtime uses these bytes directly; it never retrieves Git credentials.

type State

type State struct {
	SuccessRegistryDigest  string
	SuccessCatalogDigest   string
	SuccessCatalogRevision string
	RegistryDigest         string
	CatalogDigest          string
	CatalogRevision        string
	Fence                  int64 // Firestore stores signed integers only.
	LeaseUntil             time.Time
	NextRun                time.Time
	LastAttempt            time.Time
	LastSuccess            time.Time
	Status                 string
	Signature              string
	Stale                  bool
	FreshnessSignature     string
	Sequence               int64
	Pending                []Alert
	DeliveryFence          int64
	DeliveryLeaseUntil     time.Time
}

Jump to

Keyboard shortcuts

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