Documentation
¶
Overview ¶
Package output formats and prints CLI output.
Index ¶
- type ActionEvent
- type DiagnosticEntry
- type Printer
- func (p *Printer) Error(msg, hint string)
- func (p *Printer) PrintAction(event ActionEvent)
- func (p *Printer) PrintDiagnostics(issues []DiagnosticEntry)
- func (p *Printer) PrintInfoResult(name string, r *model.InfoResult)
- func (p *Printer) PrintRegistrySkillList(skills []model.RegistrySkill)
- func (p *Printer) PrintSkillList(skills []model.InstalledSkill)
- func (p *Printer) PrintStatusTable(entries []model.StatusEntry)
- func (p *Printer) Success(msg string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionEvent ¶
type ActionEvent struct {
Action string `json:"action"`
Skill string `json:"skill,omitempty"`
Repo string `json:"repo,omitempty"`
From string `json:"from,omitempty"`
To string `json:"to,omitempty"`
DryRun bool `json:"dry_run,omitempty"`
Message string `json:"message,omitempty"`
}
ActionEvent is a single structured event emitted by write commands when --json is set.
type DiagnosticEntry ¶
type DiagnosticEntry struct {
Severity string `json:"severity"`
Code string `json:"code,omitempty"`
Message string `json:"message"`
Hint string `json:"hint,omitempty"`
}
DiagnosticEntry is the generic representation of a doctor issue for output purposes.
type Printer ¶
type Printer struct {
// contains filtered or unexported fields
}
Printer renders CLI output. When jsonMode is true all methods emit JSON instead.
func NewPrinter ¶
NewPrinter creates a Printer writing to stdout.
func NewPrinterTo ¶
NewPrinterTo creates a Printer writing to the given writer (useful for tests).
func (*Printer) PrintAction ¶
func (p *Printer) PrintAction(event ActionEvent)
PrintAction emits a single action event (plain text or JSON depending on mode).
func (*Printer) PrintDiagnostics ¶
func (p *Printer) PrintDiagnostics(issues []DiagnosticEntry)
PrintDiagnostics renders the output for `skell doctor`.
func (*Printer) PrintInfoResult ¶
func (p *Printer) PrintInfoResult(name string, r *model.InfoResult)
PrintInfoResult renders the output for `skell info`.
func (*Printer) PrintRegistrySkillList ¶
func (p *Printer) PrintRegistrySkillList(skills []model.RegistrySkill)
PrintRegistrySkillList renders the output for `skell list --source registry` and `skell search`.
func (*Printer) PrintSkillList ¶
func (p *Printer) PrintSkillList(skills []model.InstalledSkill)
PrintSkillList renders the output for `skell list` (installed skills).
func (*Printer) PrintStatusTable ¶
func (p *Printer) PrintStatusTable(entries []model.StatusEntry)
PrintStatusTable renders the tabular output for `skell status`.