compress

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const MaxFileSize = 1900 * 1024 * 1024 // about 1.9GB

Variables

This section is empty.

Functions

func CompressPath

func CompressPath(targetPath string, buf io.Writer) error

CompressPath compresses the given path to the given writer using tar and gzip

Types

type SplitWriter added in v0.5.0

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

SplitWriter wraps an io.Writer and splits output into multiple files when size exceeds MaxFileSize

func NewSplitWriter added in v0.5.0

func NewSplitWriter(baseFilePath string) (*SplitWriter, error)

NewSplitWriter creates a new SplitWriter

func (*SplitWriter) Close added in v0.5.0

func (sw *SplitWriter) Close() error

Close closes the current file

func (*SplitWriter) IsSplit added in v0.5.0

func (sw *SplitWriter) IsSplit() bool

IsSplit returns true if the output was split into multiple parts

func (*SplitWriter) Parts added in v0.5.0

func (sw *SplitWriter) Parts() []string

Parts returns the list of created part files

func (*SplitWriter) Write added in v0.5.0

func (sw *SplitWriter) Write(p []byte) (n int, err error)

Write implements io.Writer interface

Jump to

Keyboard shortcuts

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