util

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 Debugf added in v0.2.4

func Debugf(format string, args ...any)

Debugf emits a formatted debug-level log line via slog.

func EnableDebug

func EnableDebug()

EnableDebug switches the package logger to debug level with source info.

func Infof added in v0.2.4

func Infof(format string, args ...any)

Infof emits a formatted info-level log line via slog.

func Logger added in v0.2.4

func Logger() *slog.Logger

Logger returns the package-level structured logger.

func PrintPlan

func PrintPlan(p Plan) error

func PrintSummary

func PrintSummary(p Plan)

PrintSummary prints a human-readable summary of the plan

func Warnf

func Warnf(format string, v ...any)

Warnf prints a warning message to stderr.

Types

type Change

type Change struct {
	Scope   string      `json:"scope"`
	Target  string      `json:"target"`
	Action  string      `json:"action"`
	Details interface{} `json:"details"`
}

type Plan

type Plan struct {
	Changes  []Change    `json:"changes"`
	Warnings []string    `json:"warnings"`
	Stats    *StateStats `json:"stats,omitempty"`
}

type StatePair

type StatePair struct {
	Current int `json:"current"`
	Desired int `json:"desired"`
}

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"`
}

Jump to

Keyboard shortcuts

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