archive

package
v0.0.0-...-c5a1b87 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TarMagicHeader = []byte{0x75, 0x73, 0x74, 0x61, 0x72}
	TarMagicOffset = 257
)
View Source
var GzipMagicHeader = []byte{0x1f, 0x8b}
View Source
var ZipMagicHeader = []byte{0x50, 0x4b, 0x03, 0x04}

Functions

func IsGzipFile

func IsGzipFile(r io.Reader) (bool, error)

func IsTarFile

func IsTarFile(r io.ReaderAt) bool

func IsZipFile

func IsZipFile(r io.ReaderAt) bool

func ListFiles

func ListFiles(r io.Reader, opts ...Option) ([]fs.FileInfo, error)

func UntarFiles

func UntarFiles(ctx context.Context, r io.Reader, fn func(Reader) error, opts ...Option) error

func UnzipFiles

func UnzipFiles(ctx context.Context, r io.Reader, fn func(Reader) error, opts ...Option) error

func UnzipJSON

func UnzipJSON[T any](ctx context.Context, r io.Reader, opts ...Option) iter.Seq2[T, error]

Types

type Option

type Option func(*options)

func WithConcurrency

func WithConcurrency(n int) Option

func WithLimit

func WithLimit(n int) Option

func WithOffset

func WithOffset(n int) Option

type Reader

type Reader interface {
	io.Reader
	fs.FileInfo
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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