fileutil

package
v0.1.27 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SequenceRegex = regexp.MustCompile(`^backup-\d{13}$`)
	UUIDRegex     = regexp.MustCompile("^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$")
)
View Source
var (
	ErrNoFilename = errors.New("no file exists")
)

Functions

func CreateFiles

func CreateFiles(pth string, files []File, createDir bool) error

func DownloadFileFromURL added in v0.1.20

func DownloadFileFromURL(ctx context.Context, srcURL, dstFolder string) error

func FilterDirs

func FilterDirs(fs []os.DirEntry, regex *regexp.Regexp) []os.DirEntry

func FolderSequence

func FolderSequence(dir string) ([]os.DirEntry, error)

func FolderUUIDs

func FolderUUIDs(dir string) ([]os.DirEntry, error)

Types

type File

type File struct {
	Name  string
	IsDir bool
}

func DirFileList

func DirFileList(baseDir string) ([]File, error)

Jump to

Keyboard shortcuts

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