Documentation ¶
Index ¶
- Variables
- func CopyFromReaderToDir(src io.Reader, dst string, perm fs.FileMode) error
- func CopyToDir(src, dst string) (int64, error)
- func DetectFileType(path string) (string, error)
- func IsRegularFile(path string) (bool, error)
- func ValidateSHA256Sum(path string, checksum string) error
- func WriteFile(path string, data []byte) error
- func WriteFileWithPermission(path string, data []byte, perm fs.FileMode, overwrite bool) error
Constants ¶
This section is empty.
Variables ¶
View Source
var MaxFileBytes int64 = 256 * 1024 * 1024 // 256 MiB
MaxFileBytes is the maximum file bytes. When used, the value should be strictly less than this number.
Functions ¶
func CopyFromReaderToDir ¶ added in v1.1.0
CopyFromReaderToDir copies file from src to dst where dst is the destination file path.
func DetectFileType ¶ added in v1.1.0
DetectFileType returns a file's content type given path
func IsRegularFile ¶
IsRegularFile checks if path is a regular file
func ValidateSHA256Sum ¶ added in v1.1.0
ValidateSHA256Sum returns nil if SHA256 of file at path equals to checksum.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.