dvdir

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const CommonGroup = "dv_common"

Variables

This section is empty.

Functions

func CleanTmpFolder

func CleanTmpFolder(tmpFolder string) bool

func CollectFileListForRegularExpression

func CollectFileListForRegularExpression(pref string, suffix string, reg string, pool []string) []string

func CollectFileListForSingleName

func CollectFileListForSingleName(s string, pool []string) []string

func CollectFileListForWildCard

func CollectFileListForWildCard(path string, name string, pool []string) []string

func CollectRegularFileList

func CollectRegularFileList(path string) []string

func ConvertInterfaceToByteArrayValue

func ConvertInterfaceToByteArrayValue(key string, v interface{}) ([]byte, error)

func CopySingleFile

func CopySingleFile(srcFile, dstFile string) error
func CopySymLink(source, dest string) error

func CopyWholeFolder

func CopyWholeFolder(src string, dest string) error

func CreateIfNotExists

func CreateIfNotExists(dir string, perm os.FileMode) error

func CreateOrCleanDir

func CreateOrCleanDir(dir string, perm os.FileMode) error

func DeleteAllSavedFiles

func DeleteAllSavedFiles(dirName string, fileName string) bool

func DeleteAllSavedFilesExceptZero

func DeleteAllSavedFilesExceptZero(dirName string, fileName string) bool

func DeleteFileIfExists

func DeleteFileIfExists(fileName string) bool

func DeleteFilesIfExist

func DeleteFilesIfExist(fileNames []string) int

func DeleteLastSavedFile

func DeleteLastSavedFile(dirName string, fileName string, count int) bool

func EnsureFolderForUsualFileToBeSaved

func EnsureFolderForUsualFileToBeSaved(fileName string)

func Exists

func Exists(filePath string) bool

func GetCacheByteArrayValue

func GetCacheByteArrayValue(key string) ([]byte, error)

func GetCacheFloat64Value

func GetCacheFloat64Value(key string) (float64, error)

func GetCacheInt64Value

func GetCacheInt64Value(key string) (int64, error)

func GetCacheLocalFileInfo

func GetCacheLocalFileInfo(folder string, item string) (folderFile string)

func GetCacheStringValue

func GetCacheStringValue(key string) (string, error)

func GetCacheValue

func GetCacheValue(key string) (interface{}, error)

func GetFirstExistingPath

func GetFirstExistingPath(paths ...string) string

func GetFolderLastPartName

func GetFolderLastPartName(name string) string

func GetFolderNameWithoutLastPart

func GetFolderNameWithoutLastPart(name string) string

func GetFolderNameWithoutLastSlash

func GetFolderNameWithoutLastSlash(name string) string

func GetGroupByKey

func GetGroupByKey(key string) (grp string, item string)

func GetLastSavedFileName

func GetLastSavedFileName(dirName string, fileName string) string

func GetNextSaveFileName

func GetNextSaveFileName(dirName string, fileName string) string

func GetSafeFileName

func GetSafeFileName(src string) string

func GetTempPath

func GetTempPath() string

func GetTempPathSlashed

func GetTempPathSlashed() string

func GetTemporaryFileName

func GetTemporaryFileName() string

func GetUniqueFileName

func GetUniqueFileName(dir string, prefix string, suffix string) string

func GetUniqueTmpFolder

func GetUniqueTmpFolder() string

func MakeALlDirs

func MakeALlDirs(fileNames []string) int

func MakeLastPathIfNotAbsolute

func MakeLastPathIfNotAbsolute(fileName string) string

func MoveFile

func MoveFile(sourcePath, destPath string, strictRemove bool) error

func ParsePathName

func ParsePathName(s string) (string, string)

func ReadConfigByDescription

func ReadConfigByDescription(config string) (duration1 int, duration2 int, name string, ok bool)

func ReadFileList

func ReadFileList(s string) []string

func RenameOrMoveFile

func RenameOrMoveFile(sourcePath, destPath string, strictRemove bool) error

func ResetAllLocalFileCache

func ResetAllLocalFileCache()

func ResetCacheGroups

func ResetCacheGroups(groups ...string)

func ResetCacheItems

func ResetCacheItems(items ...string)

func ResetTotalCache

func ResetTotalCache()

func SaveToUniqueFile

func SaveToUniqueFile(data string) string

func SetCacheConfigByDescription

func SetCacheConfigByDescription(groupName string, config string, valueGetter CacheValueGetter) bool

func SetCacheConfigWhole

func SetCacheConfigWhole(groupName string, memoryDuration int, fileDuration int, folderName string, valueGetter CacheValueGetter) bool

func SetCacheValue

func SetCacheValue(key string, value interface{})

func SetCacheValueAndSave

func SetCacheValueAndSave(key string, value interface{}, tosave bool)

func SetTempPath

func SetTempPath(path string, prefix string)

func WildMaskFullPathScan

func WildMaskFullPathScan(lst []string, mask string) []string

func WildMaskInString

func WildMaskInString(pattern []string, beginAny bool, endAny bool, s string) bool

func WildMaskStringScan

func WildMaskStringScan(lst []string, mask string) []string

Types

type CacheValueGetter

type CacheValueGetter func(key string, item string) (interface{}, error)

type DirScanList

type DirScanList struct {
	// contains filtered or unexported fields
}

func DirScanProvider

func DirScanProvider(data map[string][]string, currentDir string, dirListProc DirScanListGetter) ([]*DirScanList, error)

func DirScanProviderByString

func DirScanProviderByString(data string, currentDir string, dirListProc DirScanListGetter) ([]*DirScanList, error)

type DirScanListGetter

type DirScanListGetter func(path string) ([]string, error)

Jump to

Keyboard shortcuts

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