tar

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter struct {
	Root string
	// contains filtered or unexported fields
}

Filter supports glob-style filtering.

func NewFilter

func NewFilter(root string) (f Filter)

NewFilter returns a filter.

func (*Filter) Exclude

func (r *Filter) Exclude(patterns ...string)

Exclude adds excluded patterns. Empty ("") patterns are ignored.

func (*Filter) Include

func (r *Filter) Include(patterns ...string)

Include adds included patterns. Empty ("") patterns are ignored.

func (*Filter) Match

func (r *Filter) Match(path string) (b bool)

Match determines if path matches the filter.

type FilterSet

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

FilterSet is a collection of filter patterns.

func (*FilterSet) Add

func (r *FilterSet) Add(patterns ...string)

Add pattern. Empty ("") patterns are ignored.

func (*FilterSet) Len

func (r *FilterSet) Len() (n int)

Len returns number of patterns.

func (*FilterSet) Match

func (r *FilterSet) Match(path string) (match bool)

Match returns true when the path matches.

type Reader

type Reader struct {
	Filter Filter
}

Reader archive reader.

func NewReader

func NewReader() (reader *Reader)

NewReader returns a new reader.

func (*Reader) Extract

func (r *Reader) Extract(outDir string, reader io.Reader) (err error)

Extract archive content to the destination path.

type Writer

type Writer struct {
	Filter Filter
	// contains filtered or unexported fields
}

Writer is a Zipped TAR streamed writer.

func NewWriter

func NewWriter(output io.Writer) (writer *Writer)

NewWriter returns a new writer.

func (*Writer) AddDir

func (r *Writer) AddDir(pathIn string) (err error)

AddDir adds a directory.

func (*Writer) AddFile

func (r *Writer) AddFile(pathIn, destPath string) (err error)

AddFile adds a file.

func (*Writer) AssertDir

func (r *Writer) AssertDir(pathIn string) (err error)

AssertDir validates the path is a readable directory.

func (*Writer) AssertFile

func (r *Writer) AssertFile(pathIn string) (err error)

AssertFile validates the path is a readable file.

func (*Writer) Close

func (r *Writer) Close()

Close the writer.

func (*Writer) Open

func (r *Writer) Open(output io.Writer)

Open the writer.

Jump to

Keyboard shortcuts

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