common

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package common provides shared UI helpers used across the Tornado UI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatCell

func FormatCell(v any) string

FormatCell converts a database cell value to its string representation. Nil values become "NULL", []byte becomes string, and everything else uses default formatting.

func MaxInt

func MaxInt(a, b int) int

MaxInt returns the larger of a and b.

func MinInt

func MinInt(a, b int) int

MinInt returns the smaller of a and b.

func PadToWidth

func PadToWidth(s string, width int) string

PadToWidth pads a string with spaces on the right to reach the target width.

func TruncateToWidth

func TruncateToWidth(s string, width int) string

TruncateToWidth truncates a string to fit within the given display width. It uses ANSI-aware truncation when available, falling back to rune-based truncation for plain strings.

Types

This section is empty.

Jump to

Keyboard shortcuts

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