Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileReader ¶ added in v0.10.0
type FileReader struct {
// contains filtered or unexported fields
}
func Open ¶ added in v0.10.0
func Open(baseDir, baseFileName string) (*FileReader, error)
func (*FileReader) Close ¶ added in v0.10.0
func (f *FileReader) Close() error
type FileWriter ¶
type FileWriter struct {
// contains filtered or unexported fields
}
func NewChunkedFileWriter ¶
func NewChunkedFileWriter(chunkSize int64, dirPath, baseFileName string) *FileWriter
func (*FileWriter) Cleanup ¶ added in v0.30.9
func (c *FileWriter) Cleanup()
Cleanup removes any temporary chunk files this writer has created. Safe to call multiple times. Use this when the operation failed or was cancelled so no partial artifacts leak into the user's bundle directory.
func (*FileWriter) Close ¶
func (c *FileWriter) Close() error
Close flushes and closes the currently-active chunk. It does NOT promote the .tmp chunk paths to their final names: callers must invoke Finalize for that, or Cleanup to discard everything. This split lets the caller decide after-the-fact whether the produced bundle is valid (e.g. only after Pack returned without error) and avoids the previous behavior where a Ctrl+C during packing left behind ready-looking .chunk files.
func (*FileWriter) Finalize ¶ added in v0.30.9
func (c *FileWriter) Finalize() error
Finalize promotes every successfully-written chunk from its temporary path (<base>.NNNN.chunk.tmp) to the final path (<base>.NNNN.chunk). Must be called only after Close and only on a successful pack.