Documentation
¶
Overview ¶
Package util provides function for utility
Package util provides function for utility ¶
Package util provides function for utility ¶
Package util provides function for utility ¶
Package util provides function for utility
Index ¶
- func Border(str string, style lipgloss.Style) string
- func ContainsMedia(path string) bool
- func ConvertToSeconds(s string) (seconds float64, err error)
- func CreateFile(p string) (*os.File, error)
- func Exists(p string) bool
- func GetConfigDir() (string, error)
- func GetConfigFilePath() (string, error)
- func GetFileList(p string) ([]string, error)
- func GetFileListByExts(dir string, exts []string, threads int) ([]string, error)
- func GetFileListByRegexp(dir string, pattern *regexp.Regexp, threads int) ([]string, error)
- func GetFilenameFromPath(path string) string
- func GetStringInBetween(str string, start string, end string) (result string)
- func IsAudioPath(path string) bool
- func IsBoolean(value []byte) bool
- func IsExecutable(s fs.FileInfo) bool
- func IsFloat(value []byte) bool
- func IsInteger(value []byte) bool
- func IsMediaPath(path string) bool
- func IsVideoPath(path string) bool
- func PaddingRight(s string, l int) string
- func ParseBoolean(value []byte) (bool, error)
- func ParseInteger(value []byte) (int64, error)
- func ParseNumber(value []byte) (float64, error)
- func ParseString(value []byte) (string, error)
- func RemoveFile(p string) error
- func SecondsToString(seconds float64) string
- func String(v string) *string
- func TruncateString(s string, l int) (string, bool)
- func UnixHomeDir() (string, error)
- type Type
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToSeconds ¶
ConvertToSeconds converts a string like 00:00:11.35 into seconds (11.35)
func GetConfigDir ¶
GetConfigDir returns $XDG_CONFIG_HOME directory
func GetConfigFilePath ¶
GetConfigFilePath returns config file path for `ffextractor`
func GetFileListByExts ¶
GetFileListByExts returns file list filter by extension
func GetFileListByRegexp ¶
GetFileListByRegexp returns file list filter by regexp
func GetFilenameFromPath ¶
GetFilenameFromPath returns filename from path
func GetStringInBetween ¶
GetStringInBetween returns empty string if no start or end string found
func IsExecutable ¶
IsExecutable returns whether a file has execution permissions
func PaddingRight ¶
PaddingRight returns string layout for bubbletea
func ParseBoolean ¶
ParseBoolean converts raw bytes to a bool value
func ParseInteger ¶
ParseInteger converts raw bytes to a int64 value
func ParseNumber ¶
ParseNumber converts raw bytes to a float64 value
func ParseString ¶
ParseString converts raw bytes to a string value
func SecondsToString ¶
SecondsToString seconds like 80 to a string like 00:01:20.00
func TruncateString ¶
TruncateString returns truncated string
Types ¶
type Type ¶
type Type uint8
Type is a type of data, these types follow JSON type primitives, with an added type for whole numbers (integer)
const ( // TypeUnknown is the default datatype, making for easier // errors when a datatype is expected TypeUnknown Type = iota // TypeNull specifies the null type TypeNull // TypeInteger specifies whole numbers TypeInteger // TypeNumber specifies numbers with decimal value TypeNumber // TypeBoolean species true/false values TypeBoolean // TypeString specifies text values TypeString // TypeObject maps string keys to values TypeObject // TypeArray is an ordered list of values TypeArray // TypeBytes is an ordered slice of bytes TypeBytes )