Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Alert ¶
func Alert(webhookURL string, result *DriftResult) error
Alert sends a drift result to a webhook URL (Pro feature). Supports Slack Block Kit (when URL contains "hooks.slack.com") and generic JSON.
func AppendReport ¶
func AppendReport(path string, result *DriftResult) error
AppendReport appends a DriftResult as a single JSON line to a JSONL file. Creates the file and parent directories if they don't exist.
Types ¶
type DriftResult ¶
type DriftResult struct {
Source string `json:"source"`
BaselineAt time.Time `json:"baseline_at"`
CheckedAt time.Time `json:"checked_at"`
HasDrift bool `json:"has_drift"`
Changes []diff.TableDiff `json:"changes,omitempty"`
}
DriftResult is the outcome of comparing a live schema against a baseline snapshot.
type HistoryEntry ¶
type HistoryEntry struct {
*DriftResult
}
HistoryEntry is one line from a JSONL report file.
func LoadHistory ¶
func LoadHistory(path string) ([]HistoryEntry, error)
LoadHistory reads all entries from a JSONL report file, sorted by CheckedAt ascending.
type HistorySummary ¶
type HistorySummary struct {
Source string
TotalChecks int
DriftCount int
LastChecked string
LastDrift string
}
HistorySummary aggregates stats across all history entries.
func Summarize ¶
func Summarize(entries []HistoryEntry) HistorySummary
Click to show internal directories.
Click to hide internal directories.