Documentation
¶
Index ¶
- func Extract(origReader io.Reader, destFolder string, options ...Option) error
- func UnzipFolder(source, destination string) error
- func WriteTar(writer io.Writer, localPath string, compress bool) error
- func WriteTarExclude(writer io.Writer, localPath string, compress bool, excludedPaths []string) error
- func WriteTarWithOptions(writer io.Writer, localPath string, opts TarOptions) error
- type Archiver
- type Option
- type Options
- type ProtectedFile
- type TarOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UnzipFolder ¶
func WriteTarExclude ¶
func WriteTarWithOptions ¶ added in v1.23.1
func WriteTarWithOptions(writer io.Writer, localPath string, opts TarOptions) error
WriteTarWithOptions archives a file or a directory's contents.
Types ¶
type Archiver ¶
type Archiver struct {
// contains filtered or unexported fields
}
func NewArchiver ¶
func (*Archiver) AddToArchive ¶
type Option ¶
type Option func(o *Options)
func PreserveHeaderOwnership ¶ added in v1.17.0
func PreserveHeaderOwnership() Option
PreserveHeaderOwnership makes Extract apply each entry's tar-header uid/gid.
func StripLevels ¶
type ProtectedFile ¶ added in v1.23.1
type TarOptions ¶ added in v1.23.1
type TarOptions struct {
Compress bool
// Docker ignore patterns relative to the archive root.
Excludes []string
// Overrides Excludes; lazy compilation prevents sharing across transfers.
Matcher *patternmatcher.PatternMatcher
// Exact root-relative paths that bypass exclusions; symlink components are rejected.
ProtectedPaths []string
// Immutable bodies for exact paths; the caller owns and closes their readers.
ProtectedFiles map[string]ProtectedFile
// ProtectedSymlinks archives approved link targets without dereferencing them.
ProtectedSymlinks map[string]string
// Exact directory headers bypass exclusions; their children retain normal filtering.
ProtectedDirectories []string
}
Click to show internal directories.
Click to hide internal directories.