Versions in this module Expand all Collapse all v1 v1.0.2 Jan 27, 2026 v1.0.1 Jan 20, 2026 Changes in this version + const AppName + const FileIconGeneric + const STDIN_ERROR + var FileIconMap = map[string]string + var MultipartSuffix = regexp.MustCompile(`\.b\d+\.of\d+$`) + var TarSuffix = regexp.MustCompile(`\.tar$|\.tar.gz$`) + func Add(a, b int) int + func AlgorithmFromManifestName(filename string) (string, error) + func BagFileType(name string) string + func CleanBagName(bagName string) string + func ContainsControlCharacter(str string) bool + func ContainsEscapedControl(str string) bool + func CopyFile(dest, src string) (int64, error) + func CopyMap[K, V comparable](orig map[K]V) map[K]V + func DateISO(date time.Time) string + func DateTimeISO(date time.Time) string + func DateTimeUS(date time.Time) string + func DateUS(date time.Time) string + func Dict(values ...interface{}) (map[string]interface{}, error) + func DisplayDate(ts time.Time) string + func EscapeAttr(s string) template.HTMLAttr + func EscapeHTML(s string) template.HTML + func EstimatedChunkSize(totalSize float64) uint64 + func ExecCommand(command string, args []string, env []string, stdinData []byte) (stdout, stderr []byte, exitCode int) + func ExpandTilde(filePath string) (string, error) + func FileExists(path string) bool + func FileIconFor(filepath string) template.HTML + func FindCommonPrefix(paths []string) string + func GetHashes(algs []string) map[string]hash.Hash + func GetLogger(level logging.Level) *logging.Logger + func GetWindowsDrives() []string + func HasValidExtensionForMimeType(filename, mimeType string) (bool, error) + func HumanSize(size int64) string + func IntListContains(list []int, item int) bool + func IsDirectory(path string) bool + func IsEmpty(s string) bool + func IsEmptyStringList(list []string) bool + func IsListType(obj interface{}) bool + func IsMapType(obj interface{}) bool + func LooksLikeHypertextURL(str string) bool + func LooksLikeManifest(name string) bool + func LooksLikePayloadFile(name string) bool + func LooksLikeTagManifest(name string) bool + func LooksLikeURL(url string) bool + func LooksLikeUUID(uuid string) bool + func LooksSafeToDelete(dir string, minLength, minSeparators int) bool + func MakeTempCSVFileWithValidPaths(t *testing.T, pathToCSVFile string) string + func Min(x, y int) int + func Mod(a, b int) bool + func NewLine() string + func PathTo(program string) (string, error) + func PathToDevNull() string + func PathToTestData() string + func PathToUnitTestBag(bagName string) string + func PathsContainingControlChars(xFileInfoList []*ExtendedFileInfo) []string + func PrintAndExit(message string) + func ProjectRoot() string + func ReadFile(filepath string) ([]byte, error) + func RemoveFromSlice[T any](list []T, index int) []T + func RotateCurrentLog(pathToLogDir, pathToCurrentLog, logNamePrefix string, maxSize int64) (string, error) + func RunningInCI() bool + func SetBoolValue(obj interface{}, fieldName string, value bool) error + func SetFloatValue(obj interface{}, fieldName string, value float64) error + func SetIntValue(obj interface{}, fieldName string, value int64) error + func SetStringValue(obj interface{}, fieldName, value string) error + func SplitAndTrim(s, sep string) []string + func StrEq(val1, val2 interface{}) bool + func StrStartsWith(s, prefix string) bool + func StringIsShellSafe(s string) bool + func StringListContains(list []string, item string) bool + func StringListContainsAll(masterList []string, listToCheck []string) bool + func StringToBool(value string) (bool, error) + func StripFileExtension(filename string) string + func StripNonPrintable(str string) string + func TarPathToBagPath(name string) (string, error) + func TestsAreRunning() bool + func ToHumanSize(size, unit int64) string + func Truncate(value string, length int) string + func TruncateMiddle(str string, maxLen int) string + func TruncateStart(str string, maxLen int) string + func UCFirst(str string) string + func UnixToISO(ts int64) string + func YesNo(value bool) string + func YesOrNo(value bool) string + type DirectoryStats struct + BaseName string + DirCount int + Error string + FileCount int + FullPath string + RootIsFile bool + TotalBytes int64 + func DirStats(dir string) *DirectoryStats + func GetDirectoryStats(dir string) *DirectoryStats + type ExtendedFileInfo struct + FullPath string + func ListDirectory(dir string) ([]*ExtendedFileInfo, error) + func ListDirectoryWithSort(dir string) ([]*ExtendedFileInfo, error) + func NewExtendedFileInfo(path string, fileInfo os.FileInfo) *ExtendedFileInfo + func RecursiveFileList(dir string, includeIrregulars bool) ([]*ExtendedFileInfo, error) + func (fi *ExtendedFileInfo) OwnerAndGroup() (int, int) + func (fi *ExtendedFileInfo) OwnerAndGroup() (uid int, gid int) + type NameValuePair struct + Name string + Value string + type NameValuePairList struct + Items []NameValuePair + func NewNameValuePairList() *NameValuePairList + func ParseCSV(pathToCSVFile string) ([]string, []*NameValuePairList, error) + func (list *NameValuePairList) Add(name, value string) + func (list *NameValuePairList) AllMatching(name string) []NameValuePair + func (list *NameValuePairList) FirstMatching(name string) (NameValuePair, bool) + type Paths struct + Cache string + Config string + DataDir string + Desktop string + Documents string + Downloads string + Home string + LogDir string + Music string + Photos string + Public string + Root string + TempDir string + UserMount string + Videos string + func NewPaths() *Paths + func (p *Paths) DefaultPaths() ([]*ExtendedFileInfo, error) + func (p *Paths) LogFile() (string, error)