Documentation
¶
Index ¶
- Constants
- func ExecuteCommand(timeLimit time.Duration, cmdDir string, baseCmd string, args ...string) (int, string, error)
- func ExecuteCommandInShell(timeLimit time.Duration, cmdDir string, shellCommand string) (int, string, error)
- func FooterWidth(fullWidth int) int
- func FullFooterHeight(footerHeight int, toggleFooter bool) int
- func FzfSearch(query string, source []string) []fzf.MatchResult
- func LoadTomlFile(filePath string, defaultData string, target interface{}, fixFlag bool, ...) bool
- func PrintfAndExit(format string, args ...any)
- func PrintlnAndExit(args ...any)
- func ReadBoolFile(path string, defaultValue bool) bool
- func ResolveAbsPath(currentDir string, path string) string
- func SetRootLoggerToDiscarded()
- func SetRootLoggerToStdout(debug bool)
- func TeaRuneKeyMsg(msg string) tea.KeyMsg
- func WriteBoolFile(path string, value bool) error
- func WriteTomlData(filePath string, data interface{}) error
Constants ¶
const ( TrueString = "true" FalseString = "false" // These are used while comparing with runtime.GOOS // OsWindows represents the Windows operating system identifier OsWindows = "windows" // OsDarwin represents the macOS (Darwin) operating system identifier OsDarwin = "darwin" )
Variables ¶
This section is empty.
Functions ¶
func ExecuteCommand ¶
func ExecuteCommandInShell ¶
func ExecuteCommandInShell(timeLimit time.Duration, cmdDir string, shellCommand string) (int, string, error)
Choose correct shell as per OS
func FooterWidth ¶
We have three panels, so 6 characters for border <---><---><---> Hence we have (fullWidth - 6) / 3 = fullWidth/3 - 2
func FullFooterHeight ¶
Including borders
func FzfSearch ¶
func FzfSearch(query string, source []string) []fzf.MatchResult
Returning a string slice causes inefficiency in current usage
func LoadTomlFile ¶
func LoadTomlFile(filePath string, defaultData string, target interface{}, fixFlag bool, errorPrefix string) bool
Helper function to load and validate TOML files with field checking errorPrefix is appended before every error message
func PrintfAndExit ¶
Print formatted output line to stderr and exit with status 1 Cannot use log.Fataln() as slog.SetDefault() causes those lines to go into log file
func PrintlnAndExit ¶
func PrintlnAndExit(args ...any)
Print line to stderr and exit with status 1 Cannot use log.Fataln() as slog.SetDefault() causes those lines to go into log file
func ReadBoolFile ¶
Read file with "true" / "false" as content. In case of issues, return defaultValue
func ResolveAbsPath ¶
If path is not absolute, then append to currentDir and get absolute path Resolve paths starting with "~" currentDir should be an absolute path
func TeaRuneKeyMsg ¶
func WriteBoolFile ¶
func WriteTomlData ¶
Types ¶
This section is empty.