Documentation ¶
Index ¶
- func PurgeDirectory(directory string) error
- type FileInfo
- func (fileInfo *FileInfo) ExistsFile() (bool, error)
- func (fileInfo *FileInfo) GetDirectory() string
- func (fileInfo *FileInfo) GetFileExt() string
- func (fileInfo *FileInfo) GetFileName() string
- func (fileInfo *FileInfo) GetFilePath() string
- func (fileInfo *FileInfo) GetFilePathWithoutExt() string
- func (fileInfo *FileInfo) PurgeDirectory() error
- func (fileInfo *FileInfo) ReadAsByteBufferFromFile() ([]byte, error)
- func (fileInfo *FileInfo) ReadAsStringFromFile() (string, error)
- func (fileInfo *FileInfo) RemoveFile() error
- func (fileInfo *FileInfo) String() string
- func (fileInfo *FileInfo) WriteByteBufferToFile(data []byte) error
- func (fileInfo *FileInfo) WriteMessageAsProtobufToFile(msg proto.Message) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PurgeDirectory ¶
PurgeDirectory recursively removes all directories and files in a given directory.
Types ¶
type FileInfo ¶
type FileInfo struct {
// contains filtered or unexported fields
}
FileInfo holds fields used for internal tracking of files, events in notifications and so on.
func NewFileInfo ¶
NewFileInfo creates a new instance of FileInfo.
func ParseFilePath ¶
ParseFilePath parses a filesystem path into a FileInfo.
func (*FileInfo) ExistsFile ¶
ExistsFile checks if a file exists.
func (*FileInfo) GetDirectory ¶
GetDirectory returns the directory from FileInfo.
func (*FileInfo) GetFileExt ¶
GetFileExt returns the file extension from FileInfo.
func (*FileInfo) GetFileName ¶
GetFileName returns the file name from FileInfo.
func (*FileInfo) GetFilePath ¶
GetFilePath returns the full file path from FileInfo, i.e., "directory/filename+extension".
func (*FileInfo) GetFilePathWithoutExt ¶
GetFilePathWithoutExt returns the full file path from FileInfo, i.e., "directory/filename".
func (*FileInfo) PurgeDirectory ¶
PurgeDirectory recursively removes all directories and files in a given directory.
func (*FileInfo) ReadAsByteBufferFromFile ¶
ReadAsByteBufferFromFile reads a file as a byte buffer.
func (*FileInfo) ReadAsStringFromFile ¶
ReadAsStringFromFile reads a file as a string.
func (*FileInfo) RemoveFile ¶
RemoveFile removes a file.
func (*FileInfo) WriteByteBufferToFile ¶
WriteByteBufferToFile atomically writes byte buffer to file.