wkfs

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureDir

func EnsureDir(p string) (err error)

EnsureDir creates intermediate directories if needed

func FileExists

func FileExists(path string) bool

FileExists returns true if file is exists

func IsDir

func IsDir(p string) bool

func IsFile

func IsFile(path string) bool

func ReadAllLines

func ReadAllLines(path string) ([]string, error)

func Scan

func Scan(dir string, opts ...ScanOpt) (files, folders []string, err error)

Scan folder recursive, find all the files match with scan options

func Unzip

func Unzip(src string, dest string) (inflated []string, err error)

Unzip will decompress a zip archive, moving all files and folders within the zip file to an output directory

Types

type ScanOpt

type ScanOpt func(options *ScanOptions)

func WithBothFileAndFolder

func WithBothFileAndFolder() ScanOpt

WithBothFileAndFolder specifies scan both files and folders

func WithFilesOnly

func WithFilesOnly() ScanOpt

WithFilesOnly specifies only scan for files

func WithFoldersOnly

func WithFoldersOnly() ScanOpt

WithFoldersOnly specifies only scan for folders

func WithPatterns

func WithPatterns(patterns ...string) ScanOpt

WithPatterns specifies regex pattern to scan for

func WithTypes

func WithTypes(types ...string) ScanOpt

WithTypes specifies file types to scan for

type ScanOptions

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

ScanOptions holds folder scan options

Jump to

Keyboard shortcuts

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