Documentation
¶
Index ¶
- func EnsureDirExists(path string) error
- func ResolveDuplicateFilename(dir, baseName string) string
- func SaveStreamToFile(stream io.Reader, filePath string, onProgress func(bytesWritten int64)) error
- func SaveStreamToFileWithMetadata(stream io.Reader, filePath string, modified *string, accessed *string, ...) error
- type ProgressWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureDirExists ¶
EnsureDirExists creates a directory if it doesn't exist.
func ResolveDuplicateFilename ¶ added in v0.4.0
ResolveDuplicateFilename finds an available filename by appending numbers if the file exists.
func SaveStreamToFile ¶
SaveStreamToFile saves an io.Reader stream to a specified file path. It creates necessary directories. It reports progress via the onProgress callback (bytes written).
func SaveStreamToFileWithMetadata ¶ added in v0.2.0
func SaveStreamToFileWithMetadata(stream io.Reader, filePath string, modified *string, accessed *string, onProgress func(bytesWritten int64), logger *zap.SugaredLogger) error
SaveStreamToFileWithMetadata saves an io.Reader stream and restores optional timestamps.
Types ¶
Click to show internal directories.
Click to hide internal directories.