util

package
v0.2.25 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PalShellrc = "[ -f ~/.palrc ] && source ~/.palrc # added by PalApp"
)

Functions

func AppendToFile

func AppendToFile(filename, content string) error

func CalculateHash

func CalculateHash(input string) string

func CheckIfInitRan

func CheckIfInitRan() error

func EditFile

func EditFile(command, file string) error

func FileContains

func FileContains(filename, search string) (bool, error)

func GeneratePalrc

func GeneratePalrc(aliasLines string, showMessage bool) error

func GetBindList

func GetBindList() (string, error)

func GetCurrentShell

func GetCurrentShell() string

func GetStateFile

func GetStateFile(logger *zerolog.Logger) (*db.Storage, error)

func ParseBool

func ParseBool(str string) (bool, error)

func RandStrRunes

func RandStrRunes(n int) string

func ReadableTime

func ReadableTime() string

func RunCmd

func RunCmd(command string, r io.Reader, w io.Writer) error

func RunCmdInBackground

func RunCmdInBackground(commandToRun string) int

func UnixMilli

func UnixMilli() int64

func UnixMilliDiff

func UnixMilliDiff(milliseconds int64) int

func WriteStringToFile

func WriteStringToFile(filePath, content string) error

Types

type CleanStr

type CleanStr string

func (CleanStr) ReplaceNewLine

func (cstr CleanStr) ReplaceNewLine() CleanStr

func (CleanStr) StandardizeSpaces

func (cstr CleanStr) StandardizeSpaces() CleanStr

func (CleanStr) TruncateText

func (cstr CleanStr) TruncateText(max int) CleanStr

Jump to

Keyboard shortcuts

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