Documentation
¶
Index ¶
- func BackupRestoreStatus(s backupv1.BackupRestoreStatus) string
- func BackupScheduleStatus(s backupv1.BackupScheduleStatus) string
- func BackupStatus(s backupv1.BackupStatus) string
- func BoolMark(v bool) string
- func BoolYesNo(v bool) string
- func ClusterCreationStatus(s hybridv1.QdrantClusterCreationStatus) string
- func ClusterNodeState(s clusterv1.ClusterNodeState) string
- func ClusterPhase(p clusterv1.ClusterPhase) string
- func DiffValue(oldVal, newVal string) string
- func FormatMillicents(mc int32, currency string) string
- func FullDateTime(t time.Time) string
- func HumanTime(t time.Time) string
- func HybridComponentPhase(p hybridv1.HybridCloudEnvironmentComponentStatusPhase) string
- func HybridEnvironmentPhase(p hybridv1.HybridCloudEnvironmentStatusPhase) string
- func OptionalValue(v any, fallback string) string
- func PackageTier(t bookingv1.PackageTier) string
- func PrintJSON(w io.Writer, v any) error
- func RoleType(v iamv1.RoleType) string
- func TolerationEffect(eff clusterv1.TolerationEffect) string
- func TolerationOperator(op clusterv1.TolerationOperator) string
- func UserStatus(x iamv1.UserStatus) string
- type Table
- type TableRenderer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BackupRestoreStatus ¶ added in v0.15.0
func BackupRestoreStatus(s backupv1.BackupRestoreStatus) string
BackupRestoreStatus returns a concise label for a BackupRestoreStatus.
func BackupScheduleStatus ¶ added in v0.15.0
func BackupScheduleStatus(s backupv1.BackupScheduleStatus) string
BackupScheduleStatus returns a concise label for a BackupScheduleStatus.
func BackupStatus ¶ added in v0.15.0
func BackupStatus(s backupv1.BackupStatus) string
BackupStatus returns a concise label for a BackupStatus.
func ClusterCreationStatus ¶ added in v0.15.0
func ClusterCreationStatus(s hybridv1.QdrantClusterCreationStatus) string
ClusterCreationStatus returns a concise label for a QdrantClusterCreationStatus.
func ClusterNodeState ¶ added in v0.15.0
func ClusterNodeState(s clusterv1.ClusterNodeState) string
ClusterNodeState returns a concise label for a ClusterNodeState.
func ClusterPhase ¶ added in v0.15.0
func ClusterPhase(p clusterv1.ClusterPhase) string
ClusterPhase returns a concise label for a ClusterPhase.
func DiffValue ¶ added in v0.10.0
DiffValue formats a field value as "old => new" when the value changes, or just "val" when unchanged.
func FormatMillicents ¶ added in v0.16.0
FormatMillicents formats millicent pricing as a human-readable price string. 1 unit of currency = 100,000 millicents. Returns "free" for zero. currency should be an ISO 4217 code (e.g. "USD").
func FullDateTime ¶
FullDateTime formats t as "2006-01-02 15:04:05 UTC". Returns empty string for zero time.
func HumanTime ¶
HumanTime returns a relative human-readable time (e.g., "3 hours ago"). Returns empty string for zero time.
func HybridComponentPhase ¶ added in v0.15.0
func HybridComponentPhase(p hybridv1.HybridCloudEnvironmentComponentStatusPhase) string
HybridComponentPhase returns a concise label for a HybridCloudEnvironmentComponentStatusPhase.
func HybridEnvironmentPhase ¶ added in v0.15.0
func HybridEnvironmentPhase(p hybridv1.HybridCloudEnvironmentStatusPhase) string
HybridEnvironmentPhase returns a concise label for a HybridCloudEnvironmentStatusPhase.
func OptionalValue ¶ added in v0.10.0
OptionalValue formats an optional pointer value as a string. Returns fallback for nil pointers. Supports any pointer type. Booleans are formatted as "yes"/"no"; all other types use their default format.
func PackageTier ¶ added in v0.15.0
func PackageTier(t bookingv1.PackageTier) string
PackageTier returns a concise label for a PackageTier.
func PrintJSON ¶
PrintJSON marshals items as JSON and writes to w. For proto messages, uses protojson for proper field naming.
func TolerationEffect ¶ added in v0.15.0
func TolerationEffect(eff clusterv1.TolerationEffect) string
TolerationEffect returns a concise label for a TolerationEffect.
func TolerationOperator ¶ added in v0.15.0
func TolerationOperator(op clusterv1.TolerationOperator) string
TolerationOperator returns a concise label for a TolerationOperator.
func UserStatus ¶ added in v0.20.0
func UserStatus(x iamv1.UserStatus) string
UserStatus formats an iamv1.UserStatus enum for display.
Types ¶
type Table ¶
type Table[T any] struct { // contains filtered or unexported fields }
Table renders items as an ASCII table.
func (*Table[T]) AddField ¶
AddField adds a column to the table with a header name and a field extraction function.
func (*Table[T]) Render ¶ added in v0.20.0
func (t *Table[T]) Render()
Render writes the table using previously stored items (via SetItems). Headers are suppressed when SetNoHeaders(true) has been called.
func (*Table[T]) SetItems ¶ added in v0.20.0
func (t *Table[T]) SetItems(items []T)
SetItems stores items for deferred rendering via Render.
func (*Table[T]) SetNoHeaders ¶ added in v0.20.0
SetNoHeaders controls whether the header row is suppressed when rendering.
type TableRenderer ¶ added in v0.20.0
type TableRenderer interface {
SetNoHeaders(bool)
Render()
}
TableRenderer can render table output with configurable header suppression. Table[T] implements this interface after SetItems is called.