fileutils

package
v0.0.0-...-b4327c8 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: MulanPSL-2.0 Imports: 15 Imported by: 0

README

fileutils

FindRootDir获取当前目录,

根据/config/env.yml或者go.mod自动查询
如果配置了 BasePath环境变量则取环境变量

CheckFileExist检查文件存在

入参: filename
出参:bool是否存在

MakedirAll

WriteBytesFile(filename string, bytes []byte) error

ReadFileToString(file string) (string, error)

Documentation

Index

Constants

View Source
const FILE_GOMOD = "go.mod"

Variables

This section is empty.

Functions

func CheckConfigFileExist

func CheckConfigFileExist(path, file string) bool

func CheckDirExist

func CheckDirExist(path string) bool

func CheckFileExist

func CheckFileExist(filename string) bool

func Dir

func Dir(pathfile string) string

func FindAllDirs

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

func FindAllFiles

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

func FindDirs

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

func FindRootDir

func FindRootDir() string

func FindRootDirGoMod

func FindRootDirGoMod() string

func FindRootDirGoModFile

func FindRootDirGoModFile() (string, error)

func FindRootMod

func FindRootMod() error

func FindRootPkg

func FindRootPkg() string

func GetCurPath

func GetCurPath() string

func IfLinux

func IfLinux() bool

func IfWindows

func IfWindows() bool

func InjectFindFileService

func InjectFindFileService(s *FindFileService)

func ListFiles

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

func LoadFindFileService

func LoadFindFileService() baseiface.ISingleton

func MakedirAll

func MakedirAll(path string) error

func ReadFileToString

func ReadFileToString(file string) (string, error)

func Save2File

func Save2File(file string, proxy any) error

func SetRootPkgEnv

func SetRootPkgEnv(p string)

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 {
	basedto.BaseEntity
	// contains filtered or unexported fields
}

func FindBeanFindFileService

func FindBeanFindFileService() *FindFileService

FindBeanFindFileService

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)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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