Documentation
¶
Index ¶
- Constants
- func CheckAndCreateDir(path string)
- func CreateDirIfNotExist(path string) (existed bool, err error)
- func CreateFile(filename string, path string) (file *os.File)
- func DeleteFileOrDir(path string)
- func FileIsJson(filename string) bool
- func FileIsYaml(filename string) bool
- func GetAbsPath(path string) string
- func LoadYamlFileToStruct[T any](path string) (*T, error)
- func OpenFileAtPath(path string, homepath string) (reader *os.File, err error)
- func PathExists(filePath string) (exists bool)
- func RemoveDir(path string)
- func WriteStringContentsToFile(path string, contents string, force bool) error
- func WriteStructToFile(target any, filename string, path string)
- func WriteStructsToFile(target any, filename string, path string, createDir bool) (exportCnt int)
- type FileDecoder
- type FileEncoder
- type FileInfo
- func (fi *FileInfo) AbsFilePath() string
- func (fi *FileInfo) Exists() bool
- func (fi *FileInfo) GetFileInfo(name string, absPath string) os.FileInfo
- func (fi *FileInfo) MoveToPath(path string)
- func (fi *FileInfo) Open() (*os.File, error)
- func (fi *FileInfo) OpenForReading() *os.File
- func (fi *FileInfo) OpenForWriting(truncate bool) *os.File
Constants ¶
View Source
const JSON string = "json"
View Source
const PathSeparator = string(os.PathSeparator)
View Source
const YAML string = "yaml"
View Source
const YML string = "yml"
Variables ¶
This section is empty.
Functions ¶
func CheckAndCreateDir ¶
func CheckAndCreateDir(path string)
func CreateDirIfNotExist ¶
func DeleteFileOrDir ¶
func DeleteFileOrDir(path string)
func FileIsJson ¶
func FileIsYaml ¶
func GetAbsPath ¶
func LoadYamlFileToStruct ¶
func OpenFileAtPath ¶
func PathExists ¶
func WriteStructToFile ¶
Types ¶
type FileDecoder ¶
type FileEncoder ¶
type FileInfo ¶
func GetDirsAtPath ¶
func GetFilesAtPath ¶
func NewFileInfo ¶
func NewFileInfoFromPath ¶
func (*FileInfo) AbsFilePath ¶
func (*FileInfo) GetFileInfo ¶
func (*FileInfo) MoveToPath ¶
func (*FileInfo) OpenForReading ¶
Click to show internal directories.
Click to hide internal directories.