alerts

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package alerts persists doctor findings as a small local lifecycle ledger. It stores no secret values and never leaves ~/.multiversa by itself.

Index

Constants

View Source
const Schema = "multiversa.alert-ledger/v1"

Variables

This section is empty.

Functions

func DefaultPath

func DefaultPath() (string, error)

Types

type Alert

type Alert struct {
	Finding    doctor.Finding `json:"finding"`
	State      State          `json:"state"`
	FirstSeen  string         `json:"first_seen"`
	LastSeen   string         `json:"last_seen"`
	ResolvedAt string         `json:"resolved_at,omitempty"`
}

type Ledger

type Ledger struct {
	Schema    string  `json:"schema"`
	UpdatedAt string  `json:"updated_at"`
	Alerts    []Alert `json:"alerts"`
}

func Load

func Load(path string) (Ledger, error)

func Reconcile

func Reconcile(path string, findings []doctor.Finding, now time.Time) (Ledger, error)

Reconcile refreshes the ledger from current findings. It is idempotent for a fixed timestamp and writes atomically with mode 0600.

func (Ledger) OpenAlerts

func (l Ledger) OpenAlerts() []Alert

func (Ledger) Summary

func (l Ledger) Summary() Summary

type State

type State string
const (
	Open     State = "open"
	Resolved State = "resolved"
)

type Summary

type Summary struct {
	Open     int `json:"open"`
	Resolved int `json:"resolved"`
	P0       int `json:"p0"`
	P1       int `json:"p1"`
	P2       int `json:"p2"`
	P3       int `json:"p3"`
}

Jump to

Keyboard shortcuts

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