Documentation
¶
Overview ¶
Package utils provides helper functions for working with files, directories and strings that are shared across the proxsave codebase.
Index ¶
- func AbsPath(path string) (string, error)
- func ComputeSHA256(filePath string) (string, error)
- func DirExists(path string) bool
- func EnsureDir(path string) error
- func FileExists(path string) bool
- func FormatBytes(bytes int64) string
- func GenerateRandomString(length int) string
- func GetFileSize(filePath string) (int64, error)
- func IsAbsPath(path string) bool
- func IsComment(line string) bool
- func ParseBool(s string) bool
- func SplitKeyValue(line string) (string, string, bool)
- func TrimQuotes(s string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeSHA256 ¶
ComputeSHA256 computes the SHA256 checksum of a file.
func FormatBytes ¶
FormatBytes converts bytes to a human-readable format (KB, MB, GB, etc.).
func GenerateRandomString ¶
GenerateRandomString generates a random string of the specified length
func GetFileSize ¶
GetFileSize returns the file size in bytes.
func SplitKeyValue ¶
SplitKeyValue splits a "key=value" string into key and value. Supports inline comments too: KEY="value" # comment
func TrimQuotes ¶
TrimQuotes removes surrounding quotes from a string.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.