table

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package table provides utilities for formatting and rendering CLI output as tables.

Index

Constants

View Source
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

type StatusDetails interface {
	GetStatus() string
	GetDetails() string
}

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.

func New

func New(_ string, layout layouts.TableLayout, out io.Writer, header []string) Table

New creates a new table.

Directories

Path Synopsis
Package layouts defines the available table layouts
Package layouts defines the available table layouts

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL