sum

package
v0.1.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package file provides archive interface for local directories/files

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(dir string, files []string) (err error)

func List

func List(dir string) (files []string, err error)

Types

type ChecksumArchive

type ChecksumArchive struct {
	// contains filtered or unexported fields
}

ChecksumArchive embeds a BasicArchive with some additional attributes

func NewArchive

func NewArchive(outDir, prefix, extension string, options ...func(*common.BasicArchive) error) (rf *ChecksumArchive, err error)

NewArchive creates a new recorder file (for writing). The caller must call `rf.Close()` on the resulting handle to close out the file. File is atomically renamed to the final name only after everything is flushed to disk and file is closed. `*ChecksumArchive` returned is an io.Writer

func OpenArchive

func OpenArchive(fileName string, bufferSize int) (rf *ChecksumArchive, err error)

OpenArchive opens an archive file for reading. `*FileArchive` returned is an io.Reader

func (*ChecksumArchive) Close

func (rf *ChecksumArchive) Close() (err error)

Close works for both Read and Write. Additional logic for write to finalize the file from temp-name to final-name

func (*ChecksumArchive) FinalizedFiles

func (rf *ChecksumArchive) FinalizedFiles() map[string]common.ArchiveFileDetails

func (*ChecksumArchive) Flush

func (rf *ChecksumArchive) Flush() (err error)

Flush complements io.Writer

func (*ChecksumArchive) Name

func (rf *ChecksumArchive) Name() string

func (*ChecksumArchive) Read

func (rf *ChecksumArchive) Read(p []byte) (n int, err error)

Read satisfies io.Reader interface - main logic is the transparent read from LZ4, Bufio, or Raw FP depending on how the file was opened

func (*ChecksumArchive) Rotate

func (rf *ChecksumArchive) Rotate() (err error)

func (*ChecksumArchive) Write

func (rf *ChecksumArchive) Write(buf []byte) (int, error)

Write satisfies io.Writer interface - main logic is the transparent write to LZ4, Bufio, or Raw FP depending on how the file was opened

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL