Documentation
¶
Index ¶
- func Execute() error
- func SetVersionInfo(version, commit, date string)
- type RunContext
- func (ctx *RunContext) PrintList(items any, cols []output.Column, count, page, total int) error
- func (ctx *RunContext) PrintTotal(items any, cols []output.Column, total int) error
- func (ctx *RunContext) Structured() bool
- func (ctx *RunContext) WriteResult(message string)
- func (ctx *RunContext) WriteResultJSON(data any, humanMessage string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetVersionInfo ¶
func SetVersionInfo(version, commit, date string)
SetVersionInfo sets build-time version info from ldflags.
Types ¶
type RunContext ¶
type RunContext struct {
Client flashdutyClient
Cmd *cobra.Command
Args []string
Writer io.Writer
Printer output.Printer
Format output.Format
}
RunContext provides helpers for command execution. It is created by runCommand and passed to the command's handler function.
func (*RunContext) PrintList ¶
PrintList prints items as a table and appends a "Showing N results (page P, total T)." footer.
func (*RunContext) PrintTotal ¶
PrintTotal prints items as a table and appends a "Total: N" footer.
func (*RunContext) Structured ¶ added in v1.3.1
func (ctx *RunContext) Structured() bool
Structured reports whether output should be a machine-readable dump (JSON or TOON) rather than the human table/detail view. Command handlers branch on this to suppress detail views, footers, and interactive prompts.
func (*RunContext) WriteResult ¶
func (ctx *RunContext) WriteResult(message string)
WriteResult prints a success message as plain text or JSON.
func (*RunContext) WriteResultJSON ¶ added in v1.1.0
func (ctx *RunContext) WriteResultJSON(data any, humanMessage string) error
WriteResultJSON outputs structured data in JSON or TOON mode, or a human-readable message in table mode. JSON stays indented (byte-compatible with the legacy --json path); TOON routes through the SDK marshaller.
Source Files
¶
- alert.go
- alert_event.go
- args.go
- audit.go
- change.go
- channel.go
- command.go
- config.go
- escalation_rule.go
- field.go
- helpers.go
- identity.go
- incident.go
- insight.go
- login.go
- mcp.go
- member.go
- monit_agent.go
- monit_query.go
- oncall.go
- postmortem.go
- root.go
- status_page.go
- status_page_migrate.go
- team.go
- template.go
- update.go
- version.go
- whoami.go