Documentation
¶
Index ¶
- Constants
- Variables
- func Audit(scope, target, action, status string)
- func Debugf(format string, args ...any)
- func EnableDebug()
- func Infof(format string, args ...any)
- func Logger() *slog.Logger
- func PrintPlan(p Plan) error
- func PrintSummary(p Plan)
- func Warnf(format string, v ...any)
- type Change
- type Plan
- type StatePair
- type StateStats
Constants ¶
const ( ActionCreate = "create" ActionEnsure = "ensure" ActionGrant = "grant" ActionUpdate = "update" ActionDelete = "delete" ActionRemove = "remove" )
The actions a Change can carry. They are switched on here and in the apply handlers, across packages, so a literal that drifts by a letter routes a change to nothing at all rather than failing to compile.
Variables ¶
var AuditLog bool
AuditLog controls whether structured audit log entries are emitted to stderr.
Functions ¶
func Audit ¶ added in v0.2.3
func Audit(scope, target, action, status string)
Audit emits a structured JSON audit log entry to stderr when AuditLog is enabled.
func EnableDebug ¶
func EnableDebug()
EnableDebug switches the package logger to debug level and prefixes records with file:line so operators can trace noisy runs.
func PrintPlan ¶
PrintPlan writes the plan's changes as a short, one-line-per-change list. File contents and other verbose detail fields are omitted; the summary block printed by PrintSummary carries the aggregate stats.
func PrintSummary ¶
func PrintSummary(p Plan)
PrintSummary prints a human-readable summary of the plan
Types ¶
type Plan ¶
type Plan struct {
Changes []Change `json:"changes"`
Warnings []string `json:"warnings"`
Stats *StateStats `json:"stats,omitempty"`
}
func (Plan) HasChanges ¶ added in v0.4.3
HasChanges reports whether the plan would change anything.
type StateStats ¶
type StateStats struct {
Teams StatePair `json:"teams"`
TeamMembers StatePair `json:"team_members"`
Repositories StatePair `json:"repositories"`
RepoPermissions StatePair `json:"repo_permissions"`
CustomRoles StatePair `json:"custom_roles"`
Rulesets StatePair `json:"rulesets"`
Owners StatePair `json:"owners"`
}