Documentation ¶
Index ¶
- func AppendLine(path string, content string) error
- func CheckFile(path string) (exist bool)
- func CheckFileInPath(name string, path string) (bool, error)
- func CheckFolder(path string) (newCreated bool)
- func CheckFolderX(path string) (newCreated bool)
- func CheckRelativePath(path string) bool
- func Copy(src, dst string) error
- func CopyFolder(src, dst string) error
- func CurrentDir() (string, error)
- func ExistFile(path string) (exist bool)
- func ExistFolder(path string) (exist bool)
- func FullPath(path string) (string, error)
- func ListFolderFile(path string, remDir bool) ([]string, error)
- func OpenFile(path string) *os.File
- func ParseCsv(path string, data any) error
- func RemFileInDirByName(path string, name string, onRem func(string)) error
- func RemFolder(path string) error
- func ReplaceFileInDir(path string, from string, to string, neglect ...string) error
- func WriteLine(path string, line int, content string) error
- type FileReader
- type FileWriter
- type Filer
- type XmlFile
- type Yml
- type YmlReader
- type YmlWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckFileInPath ¶ added in v0.1.35
check file/folder in path folder
func CheckFolder ¶ added in v0.0.5
check single folder and create if not exist
func CheckFolderX ¶ added in v0.2.71
check folder in path and create if not exist
func CheckRelativePath ¶ added in v0.0.12
func CurrentDir ¶ added in v0.1.34
get current dir, will return zz from /xx/yy/zz
func ListFolderFile ¶ added in v0.2.22
func RemFileInDirByName ¶ added in v0.2.34
will rem file or folder if name contains 'name'
func ReplaceFileInDir ¶ added in v0.1.36
Types ¶
type FileReader ¶ added in v0.1.10
type FileReader struct {
Path string
}
func NewFileReader ¶ added in v0.1.10
func NewFileReader(path string) *FileReader
func (*FileReader) FineText ¶ added in v0.1.10
func (reader *FileReader) FineText(text string) (int, string, error)
find text in line, return line(start from 1), line content
func (*FileReader) Read ¶ added in v0.1.26
func (reader *FileReader) Read() (string, error)
read file in string
func (*FileReader) ReadLine ¶ added in v0.1.10
func (reader *FileReader) ReadLine(line int) (string, error)
read specific line in file
func (*FileReader) ReplaceLine ¶ added in v0.1.40
func (reader *FileReader) ReplaceLine(line int, content string) error
replace line with content
type FileWriter ¶ added in v0.0.17
type FileWriter struct {
Path string
}
func NewFileWriter ¶ added in v0.0.17
func NewFileWriter(path string) *FileWriter
func (*FileWriter) Replace ¶ added in v0.1.36
func (writer *FileWriter) Replace(from string, to string) error
func (*FileWriter) Update ¶ added in v0.1.9
func (writer *FileWriter) Update(text string) error
func (*FileWriter) Write ¶ added in v0.0.17
func (writer *FileWriter) Write(text string) error
func (*FileWriter) WriteLineByLine ¶ added in v0.2.17
func (writer *FileWriter) WriteLineByLine(data []string) error
type Filer ¶ added in v0.1.10
type Filer struct { FileWriter FileReader }
type YmlReader ¶ added in v0.0.5
type YmlReader struct {
Path string
}
func NewYmlReader ¶ added in v0.0.5
type YmlWriter ¶ added in v0.0.5
type YmlWriter struct {
Path string
}
func NewYmlWriter ¶ added in v0.0.5
Click to show internal directories.
Click to hide internal directories.