writer

package
v0.0.0-...-2b7ea9d Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: CC-BY-SA-4.0, MIT, MIT-0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMisalignedWrite = errors.New("unexpected number of bytes written")
)

Functions

This section is empty.

Types

type ArchiveWriter

type ArchiveWriter struct {
	MaxReadBuffer uint64
	// contains filtered or unexported fields
}

func NewWriter

func NewWriter(file io.Writer, readBufferSize uint64) *ArchiveWriter

func (*ArchiveWriter) AppendBytes

func (archive *ArchiveWriter) AppendBytes(
	rtype format.RecordType,
	flags format.RecordFlags,
	compression format.CompressionType,
	recordInfo any,
	data []byte) error

AppendBytes adds a raw, uncompressed block of data to the end of the archive. This includes the header and relevant body (`recordInfo`)

func (*ArchiveWriter) AppendDirectory

func (archive *ArchiveWriter) AppendDirectory(path string, info fs.FileInfo) error

func (*ArchiveWriter) AppendEnd

func (archive *ArchiveWriter) AppendEnd() error

func (*ArchiveWriter) AppendFile

func (archive *ArchiveWriter) AppendFile(path string, source string, compressionType format.CompressionType, info fs.FileInfo) error

func (*ArchiveWriter) AppendStart

func (archive *ArchiveWriter) AppendStart(prefix string, comment string) error

func (*ArchiveWriter) AppendStream

func (archive *ArchiveWriter) AppendStream(rtype format.RecordType, flags format.RecordFlags, compression format.CompressionType, recordInfo any, stream io.Reader) error
func (archive *ArchiveWriter) AppendSymlink(path string, destination string, info fs.FileInfo) error

func (*ArchiveWriter) AppendZstdDict

func (archive *ArchiveWriter) AppendZstdDict(dictionary []byte) error

func (*ArchiveWriter) Close

func (archive *ArchiveWriter) Close() error

Jump to

Keyboard shortcuts

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