files

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseSilent

func CloseSilent(closers ...io.Closer)

func CreateDirIfMissing

func CreateDirIfMissing(path string) (bool, error)

func DirPaths

func DirPaths(paths []string, addTrailingSlash bool) []string

func FileTree

func FileTree(paths []string, cwd string, dirsOrder DirsOrder) string

func IgnoreHiddenFiles

func IgnoreHiddenFiles(path string, fi os.FileInfo) (bool, error)

func IgnoreHiddenFolders

func IgnoreHiddenFolders(path string, fi os.FileInfo) (bool, error)

func IgnoreNonPython

func IgnoreNonPython(path string, fi os.FileInfo) (bool, error)

func IgnoreNonYAML

func IgnoreNonYAML(path string, fi os.FileInfo) (bool, error)

func IgnorePythonGeneratedFiles

func IgnorePythonGeneratedFiles(path string, fi os.FileInfo) (bool, error)

func IsDir

func IsDir(path string) bool

func IsFile

func IsFile(path string) bool

func IsFileOrDir

func IsFileOrDir(path string) bool

func IsFilePathPython

func IsFilePathPython(path string) bool

func IsFilePathYAML

func IsFilePathYAML(path string) bool

func ListDir

func ListDir(dir string, relative bool) ([]string, error)

func ListDirRecursive

func ListDirRecursive(dir string, relative bool, ignoreFns ...IgnoreFn) ([]string, error)

func MakeEmptyFile

func MakeEmptyFile(path string) error

func MakeEmptyFiles

func MakeEmptyFiles(paths ...string) error

func MakeEmptyFilesInDir

func MakeEmptyFilesInDir(dir string, paths ...string) error

func ParentDir

func ParentDir(dir string) string

func ReadReqFile

func ReadReqFile(r *http.Request, fileName string) ([]byte, error)

ReadReqFile returns nil if no file

func RelPath

func RelPath(userPath string, baseDir string) string

func SearchForFile

func SearchForFile(filename string, dir string) (string, error)

func SortFilePaths

func SortFilePaths(paths []string, dirsOrder DirsOrder) []string

func TmpDir

func TmpDir() (string, error)

func TrimDirPrefix

func TrimDirPrefix(fullPath string, dirPath string) string

func UserPath

func UserPath(userPath string) string

Types

type DirsOrder

type DirsOrder string
var DirsOnBottom DirsOrder = "bottom"
var DirsOnTop DirsOrder = "top"
var DirsSorted DirsOrder = "sorted"

type IgnoreFn

type IgnoreFn func(string, os.FileInfo) (bool, error)

IgnoreFn if passed a dir, returning false will ignore all subdirs of dir

Jump to

Keyboard shortcuts

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