Documentation
¶
Overview ¶
Package output provides formatting for Guardian CLI output in both human-readable and JSON formats.
Index ¶
- func PrintCheckReportHuman(w io.Writer, r *CheckReport)
- func PrintCheckReportJSON(w io.Writer, r *CheckReport) error
- func PrintHistoryReportHuman(w io.Writer, r *HistoryReport)
- func PrintHistoryReportJSON(w io.Writer, r *HistoryReport) error
- func PrintInboxReportHuman(w io.Writer, r *InboxReport)
- func PrintInboxReportJSON(w io.Writer, r *InboxReport) error
- func PrintTallyReportHuman(w io.Writer, r *TallyReport)
- func PrintTallyReportJSON(w io.Writer, r *TallyReport) error
- type CheckReport
- type HistoryItem
- type HistoryReport
- type InboxItem
- type InboxReport
- type ReportSummary
- type TallyReport
- type ViolationReport
- type VoteEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrintCheckReportHuman ¶
func PrintCheckReportHuman(w io.Writer, r *CheckReport)
PrintCheckReportHuman writes a human-readable check report to the given writer.
func PrintCheckReportJSON ¶
func PrintCheckReportJSON(w io.Writer, r *CheckReport) error
PrintCheckReportJSON writes a JSON-formatted check report to the given writer.
func PrintHistoryReportHuman ¶
func PrintHistoryReportHuman(w io.Writer, r *HistoryReport)
PrintHistoryReportHuman writes a human-readable history report to the given writer.
func PrintHistoryReportJSON ¶
func PrintHistoryReportJSON(w io.Writer, r *HistoryReport) error
PrintHistoryReportJSON writes a JSON-formatted history report to the given writer.
func PrintInboxReportHuman ¶
func PrintInboxReportHuman(w io.Writer, r *InboxReport)
PrintInboxReportHuman writes a human-readable inbox report to the given writer.
func PrintInboxReportJSON ¶
func PrintInboxReportJSON(w io.Writer, r *InboxReport) error
PrintInboxReportJSON writes a JSON-formatted inbox report to the given writer.
func PrintTallyReportHuman ¶
func PrintTallyReportHuman(w io.Writer, r *TallyReport)
PrintTallyReportHuman writes a human-readable tally report to the given writer.
func PrintTallyReportJSON ¶
func PrintTallyReportJSON(w io.Writer, r *TallyReport) error
PrintTallyReportJSON writes a JSON-formatted tally report to the given writer.
Types ¶
type CheckReport ¶
type CheckReport struct {
Violations []ViolationReport `json:"violations"`
Summary ReportSummary `json:"summary"`
}
CheckReport contains the results of a guardian check operation.
type HistoryItem ¶
type HistoryItem struct {
ProposalID string `json:"proposal_id"`
RuleID string `json:"rule_id"`
ProposalType string `json:"proposal_type"`
FinalizedAt string `json:"finalized_at"`
Summary string `json:"summary"`
}
HistoryItem represents a finalized proposal in the history.
type HistoryReport ¶
type HistoryReport struct {
Items []HistoryItem `json:"items"`
}
HistoryReport lists finalized proposals.
type InboxItem ¶
type InboxItem struct {
ProposalID string `json:"proposal_id"`
RuleID string `json:"rule_id"`
ProposalType string `json:"proposal_type"`
CreatedBy string `json:"created_by"`
CreatedAt string `json:"created_at"`
Age string `json:"age"`
}
InboxItem represents a single pending proposal in the inbox.
type InboxReport ¶
InboxReport lists proposals awaiting the current user's vote.
type ReportSummary ¶
type ReportSummary struct {
Errors int `json:"errors"`
Warnings int `json:"warnings"`
Passed bool `json:"passed"`
}
ReportSummary summarizes the check results.
type TallyReport ¶
type TallyReport struct {
ProposalID string `json:"proposal_id"`
RuleID string `json:"rule_id"`
EligibleVoters []string `json:"eligible_voters"`
Votes []VoteEntry `json:"votes"`
Result string `json:"result"`
YesCount int `json:"yes_count"`
NoCount int `json:"no_count"`
Required int `json:"required"`
}
TallyReport contains the voting results for a proposal.
type ViolationReport ¶
type ViolationReport struct {
RuleID string `json:"rule_id"`
Severity string `json:"severity"`
Description string `json:"description"`
FilePath string `json:"file_path"`
DiffSnippet string `json:"diff_snippet"`
LLMExplanation string `json:"llm_explanation"`
}
ViolationReport describes a single rule violation found during a check.