utils

package
v0.4.1-0...-582f678 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2025 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatBytes

func FormatBytes(bytes uint64) string

func GetGoVersion

func GetGoVersion() string

func GetVersion

func GetVersion() string

GetVersion returns the application version set by the build process. If the binary is a dev build, then it returns a truncated version of the latest commit hash.

func GetWorkingDir

func GetWorkingDir() string

func IsInt

func IsInt(v any) bool

func IsString

func IsString(v any) bool

func NewPointer

func NewPointer[T any](v T) *T

func ParseInt

func ParseInt(s string) (int, error)

func TryDeref

func TryDeref[T any](p *T) any

TryDeref tries to dereference a pointer to type T. If it cannot, then it returns nil.

Types

type InputHistory

type InputHistory struct {
	// contains filtered or unexported fields
}

func NewCmdHistory

func NewCmdHistory() *InputHistory

func (*InputHistory) Add

func (h *InputHistory) Add(v string)

func (*InputHistory) Cycle

func (h *InputHistory) Cycle(msg tea.KeyMsg) (string, bool)

Cycle moves either up or down through the history of commands that have been added. Returns a string containing the command text if it exists, and true if history cycles back to present.

func (InputHistory) GetLen

func (h InputHistory) GetLen() int

func (InputHistory) ListHistory

func (h InputHistory) ListHistory() []string

Jump to

Keyboard shortcuts

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