table

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: BSD-3-Clause, MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const MaxColWidth = 18
View Source
const MaxLength = 120

Variables

View Source
var PreferredColumnOrder = []string{
	"id",
	"name",
	"slug",
	"environment",
	"description",
	"provisioning_type",
	"team",
	"ips",
	"servers",
	"vlans",
	"tags",
	"status",
	"phase",
	"ready",
	"plan",
	"os",
	"operating_system",
	"primary_ipv4",
	"region",
	"endpoint",
	"storage_class",
	"created_at",
	"updated_at",
}

PreferredColumnOrder is the canonical column ordering shared by the static and interactive (Bubble Tea) table views. Unlisted columns follow in alphabetical order.

Functions

func DateTime

func DateTime(value *strfmt.DateTime) string

func Float

func Float(value float64) string

func Int

func Int(value int64) string

func Render

func Render(rows []Row)

func RenderEmptyState

func RenderEmptyState(message string)

func SortColumnsByPreference added in v1.7.0

func SortColumnsByPreference(ids []string)

SortColumnsByPreference orders column ids by PreferredColumnOrder, with unlisted columns following alphabetically. Shared by the static and interactive renderers so the views never diverge.

func String

func String(value string) string

func StringList

func StringList(value []string, separator string) string

Types

type Cell

type Cell struct {
	Value     string
	Label     string
	MaxLength int
}
type Header struct {
	IDs    []string
	Labels []string
}

type Row

type Row map[string]Cell

type Table

type Table struct {
	Headers []string
	Rows    [][]string
}

Jump to

Keyboard shortcuts

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