Documentation
¶
Index ¶
- func ExtractTar(r io.Reader, dest string) error
- func ExtractTarWithOptions(r io.Reader, dest string, opts ExtractOptions) error
- func MoveTree(src, dst string) error
- func ReadHeader(r *bufio.Reader) (string, string, error)
- func TarDirectory(w io.Writer, src string, prefix string) error
- func TarDirectoryWithObserver(w io.Writer, src string, prefix string, observer TarObserver) error
- func TarFile(w io.Writer, src string, name string) error
- func TarFileWithObserver(w io.Writer, src string, name string, observer TarObserver) error
- func WriteHeader(w io.Writer, kind, base string) error
- type ExtractOptions
- type TarEntry
- type TarObserver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractTar ¶
ExtractTar extracts a tar archive stream into dest. It rejects absolute or parent-traversal paths.
func ExtractTarWithOptions ¶
func ExtractTarWithOptions(r io.Reader, dest string, opts ExtractOptions) error
ExtractTarWithOptions extracts a tar archive stream into dest with optional callbacks.
func MoveTree ¶
MoveTree moves src into dst, merging into dst when it already exists. It attempts to use renames for atomic moves where possible.
func ReadHeader ¶
ReadHeader reads a copy stream header and returns kind and base name.
func TarDirectory ¶
TarDirectory writes a tar archive of src into w. Entries are relative to src, with an optional prefix applied.
func TarDirectoryWithObserver ¶
TarDirectoryWithObserver writes a tar archive of src into w, invoking observer for each entry.
func TarFileWithObserver ¶
TarFileWithObserver writes a single file or symlink entry to w, invoking observer.
Types ¶
type ExtractOptions ¶
type ExtractOptions struct {
OnEntry TarObserver
}
type TarObserver ¶
type TarObserver func(entry TarEntry)