Documentation
¶
Overview ¶
Package table provides utilities for formatting and rendering CLI output as tables.
Index ¶
Constants ¶
const (
// Simple defines the standard table layout used across the Minder CLI.
Simple = "simple"
)
Variables ¶
This section is empty.
Functions ¶
func GetEntityTypeIcon ¶ added in v0.2.0
func GetEntityTypeIcon(entityType string, emoji bool) layouts.ColoredColumn
GetEntityTypeIcon returns a colored column representing the entity type. When emoji is true, an emoji icon is used; otherwise a short text label is returned. Unknown entity types fall back to the raw type string.
func GetStatusIcon ¶ added in v0.1.0
func GetStatusIcon(eval EvalStatus, emoji bool) layouts.ColoredColumn
GetStatusIcon returns a colored column with the status icon for the given evaluation status.
Types ¶
type EvalStatus ¶ added in v0.1.0
type EvalStatus interface {
GetStatus() string
GetStatusDetail() string
GetRemediationStatus() string
GetRemediationDetail() string
GetAlert() StatusDetails
}
EvalStatus provides an abstract interface for reading evaluation status. Since we don't have common shapes between e.g. EvaluationHistory and RuleEvaluationStatus, we use an interface modeled on RuleEvaluationStatus to adapt the two. (We would use the EvaluationHistory shape, but the sub-message return values are structs that don't match the interface here.)
type StatusDetails ¶ added in v0.1.0
StatusDetails provides an abstract interface for reading status details. This is currently only used for Alert status, because those structures consistently expose this pattern.
type Table ¶
type Table interface {
AddRow(row ...string)
AddRowWithColor(row ...layouts.ColoredColumn)
Render()
// SeparateRows ensures each row is clearly separated (probably because it is multi-line)
SeparateRows() Table
SetAutoMerge(merge bool) Table
SetEqualColumns(equal bool) Table
}
Table is the interface for rendering CLI tables using the go-pretty engine.