Documentation
¶
Index ¶
- Variables
- func DataList(w io.Writer, pairs []attribute.KeyValue) error
- func PrintJSON(w io.Writer, v any) error
- func RenderMutation(output, statusOutput io.Writer, jsonOutput bool, result MutationResult) error
- func RenderSections(w io.Writer, sections []Section) error
- func RenderTable(w io.Writer, title string, headers []string, rows [][]attribute.Value) error
- func RenderTableWithOptions(w io.Writer, headers []string, rows [][]attribute.Value, opts TableOptions) error
- type DetailsBuilder
- func (b *DetailsBuilder) Add(key string, value attribute.Value) *DetailsBuilder
- func (b *DetailsBuilder) AddID(value any) *DetailsBuilder
- func (b *DetailsBuilder) AddOptionalString(key string, value *string) *DetailsBuilder
- func (b *DetailsBuilder) AddPair(pair attribute.KeyValue) *DetailsBuilder
- func (b *DetailsBuilder) AddWhen(ok bool, pair attribute.KeyValue) *DetailsBuilder
- func (b *DetailsBuilder) Pairs() []attribute.KeyValue
- func (b *DetailsBuilder) Render(w io.Writer) error
- type MutationResult
- type Section
- type TableOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var SumUpPink = lipgloss.Color("#FF61F2")
Functions ¶
func RenderMutation ¶
func RenderMutation(output, statusOutput io.Writer, jsonOutput bool, result MutationResult) error
RenderMutation renders a mutating command result consistently for JSON and human output.
func RenderSections ¶
RenderSections renders titled output blocks with a blank line between them.
func RenderTable ¶
RenderTable prints rows in a table using the terminal width to wrap columns.
func RenderTableWithOptions ¶
func RenderTableWithOptions(w io.Writer, headers []string, rows [][]attribute.Value, opts TableOptions) error
RenderTableWithOptions prints rows in a table using configurable presentation options.
Types ¶
type DetailsBuilder ¶
type DetailsBuilder struct {
// contains filtered or unexported fields
}
DetailsBuilder helps commands build detail views without manual slice plumbing.
func NewDetailsBuilder ¶
func NewDetailsBuilder() *DetailsBuilder
func (*DetailsBuilder) Add ¶
func (b *DetailsBuilder) Add(key string, value attribute.Value) *DetailsBuilder
func (*DetailsBuilder) AddID ¶
func (b *DetailsBuilder) AddID(value any) *DetailsBuilder
func (*DetailsBuilder) AddOptionalString ¶
func (b *DetailsBuilder) AddOptionalString(key string, value *string) *DetailsBuilder
func (*DetailsBuilder) AddPair ¶
func (b *DetailsBuilder) AddPair(pair attribute.KeyValue) *DetailsBuilder
func (*DetailsBuilder) AddWhen ¶
func (b *DetailsBuilder) AddWhen(ok bool, pair attribute.KeyValue) *DetailsBuilder
func (*DetailsBuilder) Pairs ¶
func (b *DetailsBuilder) Pairs() []attribute.KeyValue
type MutationResult ¶
type MutationResult struct {
JSONValue any
SuccessMessage string
Details []attribute.KeyValue
RenderHuman func(io.Writer) error
}
MutationResult describes the shared output flow for mutating commands.
type TableOptions ¶
TableOptions customizes human-readable table rendering.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.