Documentation
¶
Index ¶
- func CalculateFlexWidth(totalWidth int, fixedWidths []int, flexFactors []int, inputFactor int) int
- func DeleteColumn[T any](matrix [][]T, colIndex int) [][]T
- func DeleteElement[T any](slice []T, index int) []T
- func DrawLine(width int) string
- func FormatSize(bytes int) string
- func FormatSpeed(bytesPerSecond int) string
- func FormatTime(seconds uint64) string
- func GetColumn[T any](matrix [][]T, colIndex int) []T
- func IfElse[T any](cond bool, exp1, exp2 T) T
- func IsEmptyOrWhitespace(str string) bool
- func MarginHor(s string, amt int) string
- func PrintMatrix(matrix [][]int) (s string)
- func Repl(s string, amt int) string
- func SetColumn[T any](matrix [][]T, colIndex int, value T)
- func Sum(arr []int) int
- func TrimString(str string, maxLength int) string
- func UpdateTeaModel[T interface{ ... }](model T, msg tea.Msg) (T, tea.Cmd)
- type Counter
- type ResizeHandler
- type StateHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateFlexWidth ¶
CalculateFlexWidth calculates the width of a flex column in a table.
func DeleteColumn ¶
func DeleteElement ¶
func FormatSize ¶
FormatSize takes an input in bytes and returns a human-readable size string.
func FormatSpeed ¶
FormatSpeed takes an input in bytes per second and returns a human-readable speed string.
func FormatTime ¶
FormatTime takes an input in seconds (as uint64) and returns a human-readable time string.
func IsEmptyOrWhitespace ¶
func PrintMatrix ¶
func TrimString ¶
Types ¶
type ResizeHandler ¶
type StateHandler ¶
type StateHandler[T comparable] struct { // contains filtered or unexported fields }
func NewStateHandler ¶
func NewStateHandler[T comparable](states []T, cur int) *StateHandler[T]
NewStateHandler initializes the state handler with a slice of states.
func (*StateHandler[T]) CurrentState ¶
func (sh *StateHandler[T]) CurrentState() T
CurrentState returns the current state.
func (*StateHandler[T]) Index ¶
func (sh *StateHandler[T]) Index() int
Returns current state's index
func (*StateHandler[T]) NextState ¶
func (sh *StateHandler[T]) NextState() T
NextState transitions to the next state, wrapping around if necessary.
func (*StateHandler[T]) PrevState ¶
func (sh *StateHandler[T]) PrevState() T
PrevState transitions to the previous state, wrapping around if necessary.
func (*StateHandler[T]) SetState ¶
func (sh *StateHandler[T]) SetState(state T)
Click to show internal directories.
Click to hide internal directories.