Documentation
¶
Overview ¶
Package format provides TOON output formatting for the axi-forge CLI. It transforms domain types into TOON strings at the CLI output boundary, keeping TOON conversion separate from the provider layer.
Index ¶
- func AuthStatus(hosts []AuthRow) string
- func Diagnostic(msg string) string
- func Error(msg, help string) string
- func IssueCloseConfirm(number int) string
- func IssueCreateConfirm(number int, title, url string) string
- func IssueList(issues []IssueRow, count, total int, _ ...string) string
- func IssueView(issue *IssueDetail, full bool) string
- func LabelCreateConfirm(name, scope string) string
- func LabelDeleteConfirm(name, scope string) string
- func LabelList(labels []LabelRow, _ ...string) string
- func LabelUpdateConfirm(name, scope string) string
- func PRCreateConfirm(number int, title, url string) string
- func PRList(prs []PRRow, count, total int, _ ...string) string
- func PRMergeConfirm(number int) string
- func PRView(pr *PRDetail, full bool) string
- func TruncateBody(body string, maxLen int) (string, int)
- type AuthRow
- type DepPR
- type IssueDetail
- type IssueRow
- type LabelRow
- type PRDetail
- type PRRow
- type ReviewerState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthStatus ¶
AuthStatus formats the auth status as TOON tabular output.
func Diagnostic ¶
Diagnostic formats a diagnostic message (e.g., broken stack warning).
func IssueCloseConfirm ¶
IssueCloseConfirm formats an issue close confirmation.
func IssueCreateConfirm ¶
IssueCreateConfirm formats an issue creation confirmation.
func IssueList ¶
IssueList formats a list of issues as TOON tabular output. count is the number of items in this response; total is the total matching items. fields is accepted for backward compatibility but is unused — the caller always populates all fields, and omitempty controls column visibility.
func IssueView ¶
func IssueView(issue *IssueDetail, full bool) string
IssueView formats a single issue as TOON key-value output. If full is false, the body is truncated to 500 characters.
func LabelCreateConfirm ¶
LabelCreateConfirm formats a label creation confirmation.
func LabelDeleteConfirm ¶
LabelDeleteConfirm formats a label deletion confirmation.
func LabelList ¶
LabelList formats a list of labels as TOON tabular output. fields is accepted for backward compatibility but is unused — the caller always populates all fields, and omitempty controls column visibility.
func LabelUpdateConfirm ¶
LabelUpdateConfirm formats a label update confirmation.
func PRCreateConfirm ¶
PRCreateConfirm formats a PR creation confirmation.
func PRList ¶
PRList formats a list of pull requests as TOON tabular output. fields is accepted for backward compatibility but is unused — the caller always populates all fields, and omitempty controls column visibility.
func PRMergeConfirm ¶
PRMergeConfirm formats a PR merge confirmation.
Types ¶
type AuthRow ¶
type AuthRow struct {
Forge string `toon:"forge"`
Host string `toon:"host"`
Source string `toon:"source"`
}
AuthRow is a single row in the auth status output.
type DepPR ¶
type DepPR struct {
Number int `toon:"number"`
Title string `toon:"title"`
State string `toon:"state"`
}
DepPR is a dependency row in the PR view.
type IssueDetail ¶
type IssueDetail struct {
Number int `toon:"number"`
Title string `toon:"title"`
State string `toon:"state"`
Body string `toon:"body"`
BodySize int `toon:"body_size"`
Author string `toon:"author"`
CreatedAt string `toon:"created_at"`
UpdatedAt string `toon:"updated_at"`
URL string `toon:"url"`
Hint string `toon:"hint,omitempty"`
}
IssueDetail is the full issue view output.
type IssueRow ¶
type IssueRow struct {
Number int `toon:"number"`
Title string `toon:"title"`
State string `toon:"state"`
Author string `toon:"author,omitempty"`
Labels string `toon:"labels,omitempty"`
}
IssueRow is a single row in the issue list tabular output. Author and Labels are populated by the caller and suppressed via omitempty when --fields does not request them (TOON omits empty optional fields).
type LabelRow ¶
type LabelRow struct {
Name string `toon:"name"`
Scope string `toon:"scope"`
Color string `toon:"color"`
Description string `toon:"description"`
Exclusive bool `toon:"exclusive,omitempty"`
}
LabelRow is a single row in the label list tabular output. Exclusive is populated by the caller and suppressed via omitempty when --fields does not request it.
type PRDetail ¶
type PRDetail struct {
Number int `toon:"number"`
Title string `toon:"title"`
State string `toon:"state"`
Body string `toon:"body"`
BodySize int `toon:"body_size"`
BaseRef string `toon:"base_ref"`
HeadRef string `toon:"head_ref"`
Stack string `toon:"stack,omitempty"`
Draft bool `toon:"draft,omitempty"`
DependsOn []DepPR `toon:"depends_on"`
DependedOnBy []DepPR `toon:"depended_on_by"`
Reviewers []ReviewerState `toon:"reviewers,omitempty"`
ChecksPassed int `toon:"checks_passed,omitempty"`
ChecksTotal int `toon:"checks_total,omitempty"`
Author string `toon:"author"`
CreatedAt string `toon:"created_at"`
UpdatedAt string `toon:"updated_at"`
URL string `toon:"url"`
Hint string `toon:"hint,omitempty"`
}
PRDetail is the full PR view output.
type PRRow ¶
type PRRow struct {
Number int `toon:"number"`
Stack string `toon:"stack"`
Title string `toon:"title"`
State string `toon:"state"`
Author string `toon:"author,omitempty"`
Created string `toon:"created,omitempty"`
}
PRRow is a single row in the PR list tabular output. Author and Created are populated by the caller and suppressed via omitempty when --fields does not request them.
type ReviewerState ¶
ReviewerState is a reviewer row in the PR view.