fileutils

package
v0.0.0-...-636798d Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2025 License: MulanPSL-2.0 Imports: 15 Imported by: 48

Documentation

Index

Constants

View Source
const FILE_GOMOD = "go.mod"

Variables

This section is empty.

Functions

func CheckConfigFileExist

func CheckConfigFileExist(root, f string) bool

func CheckFileExist

func CheckFileExist(filename string) bool

func Dir

func Dir(pathfile string) string

func FileNameOfPath

func FileNameOfPath(pathfile string) string

func FindAllDirs

func FindAllDirs(dirPath string) ([]string, error)

func FindDirs

func FindDirs(rootdir string) ([]string, error)

func FindRootDir

func FindRootDir() string

func FindRootDirGoMod

func FindRootDirGoMod() string

func FindRootPkg

func FindRootPkg() string

func GetCurPath

func GetCurPath() string

func GetPkg

func GetPkg(pkgPath string) (*build.Package, error)

func GetPkgAllFilesPath

func GetPkgAllFilesPath(pkgPath string) ([]string, error)

获取第三方包下所有文件的相对路径

func GetPkgPath

func GetPkgPath(pkgPath string) (string, error)

func IfLinux

func IfLinux() bool

func IfWindows

func IfWindows() bool

func ImportPkg

func ImportPkg(pkgpath string) (*build.Package, error)

func ImportPkgDir

func ImportPkgDir(pkgpath string) (string, error)

func LoadGofileUtil

func LoadGofileUtil() baseiface.ISingleton

func ReadFileToString

func ReadFileToString(file string) (string, error)

func ReadSubDirs

func ReadSubDirs(rootPath string) ([]string, error)

func SetRootPkgEnv

func SetRootPkgEnv(p string)

func TryFileExist

func TryFileExist(filename string) bool

func UnZip

func UnZip(zipFile string, destPath string) error

func WriteBytesFile

func WriteBytesFile(filename string, bytes []byte) error

func Zip

func Zip(srcPath string, destFile string) error

Types

type FindFileService

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

func NewFindFileService

func NewFindFileService() *FindFileService

func (*FindFileService) Dir

func (self *FindFileService) Dir() string

func (*FindFileService) ExcludeSuffix

func (self *FindFileService) ExcludeSuffix() string

func (*FindFileService) FindFiles

func (self *FindFileService) FindFiles() ([]string, error)

func (*FindFileService) IncludeSuffix

func (self *FindFileService) IncludeSuffix() string

func (*FindFileService) SetDir

func (self *FindFileService) SetDir(dir string)

func (*FindFileService) SetExcludeSuffix

func (self *FindFileService) SetExcludeSuffix(excludeSuffix string)

func (*FindFileService) SetIncludeSuffix

func (self *FindFileService) SetIncludeSuffix(includeSuffix string)

type GofileUtil

type GofileUtil struct {
	basedto.BaseEntitySingle
}

func FindBeanGofileUtil

func FindBeanGofileUtil() *GofileUtil

func NewGofileUtil

func NewGofileUtil() *GofileUtil

func (*GofileUtil) CheckConfigFileExist

func (this *GofileUtil) CheckConfigFileExist(root, f string) bool

func (*GofileUtil) CheckFileExist

func (this *GofileUtil) CheckFileExist(filename string) bool

func (*GofileUtil) Dir

func (this *GofileUtil) Dir(pathfile string) string

func (*GofileUtil) FindPkgPath

func (this *GofileUtil) FindPkgPath(pkg string) string

func (*GofileUtil) FindRootDir

func (this *GofileUtil) FindRootDir() string

func (*GofileUtil) FindRootDirGoMod

func (this *GofileUtil) FindRootDirGoMod() string

func (*GofileUtil) FindRootDirPrev

func (this *GofileUtil) FindRootDirPrev() string

func (*GofileUtil) FindRootPkg

func (this *GofileUtil) FindRootPkg() string

func (*GofileUtil) GetCurPath

func (this *GofileUtil) GetCurPath() string

func (*GofileUtil) SetRootPkgEnv

func (this *GofileUtil) SetRootPkgEnv(p string)

func (*GofileUtil) TryFileExist

func (this *GofileUtil) TryFileExist(filename string) bool

func (*GofileUtil) UnZip

func (this *GofileUtil) UnZip(zipFile string, destPath string) error

func (*GofileUtil) Zip

func (this *GofileUtil) Zip(srcPath string, destFile string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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