Documentation ¶
Index ¶
Constants ¶
View Source
const MetadataSize = common.HashLength + 8 + 8
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DownloadingDir ¶ added in v0.6.0
type DownloadingDir struct {
// contains filtered or unexported fields
}
func CreateDownloadingDir ¶ added in v0.6.0
func CreateDownloadingDir(filename string) (*DownloadingDir, error)
CreateDownloadingDir creates a temporary downloading directory by renaming the existing directory if it exists or by creating a new one if it doesn't. It ensures files are stored in a safe temporary directory.
func (*DownloadingDir) Add ¶ added in v0.6.0
func (directory *DownloadingDir) Add(node *dir.FsNode, relpath string, persist func(path string) error) error
Add adds a file, directory, or symbolic link to the downloading directory.
func (*DownloadingDir) Seal ¶ added in v0.6.0
func (directory *DownloadingDir) Seal() error
Seal finalizes the downloading process by renaming the temporary directory back to its original name. It should be called after all files have been added to the directory.
type DownloadingFile ¶
type DownloadingFile struct {
// contains filtered or unexported fields
}
func CreateDownloadingFile ¶
func (*DownloadingFile) Close ¶
func (file *DownloadingFile) Close() error
func (*DownloadingFile) Metadata ¶
func (file *DownloadingFile) Metadata() *Metadata
func (*DownloadingFile) Seal ¶
func (file *DownloadingFile) Seal() error
func (*DownloadingFile) Write ¶
func (file *DownloadingFile) Write(data []byte) error
Click to show internal directories.
Click to hide internal directories.