Documentation
¶
Overview ¶
Package expand defines the Expander interface and a registry of expanders for compressed files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsCompressedFile ¶
IsCompressedFile reports whether the file at filePath begins with a known compression magic number.
func IsTarFile ¶
IsTarFile checks whether the file at filePath is a tar archive by reading the standard tar magic bytes at offset 257 ("ustar\0" or "ustar ").
func RegisterExpander ¶
func RegisterExpander(e Expander)
RegisterExpander adds an Expander to the global registry.
Types ¶
type ExpandOptions ¶
type ExpandOptions struct{}
ExpandOptions holds configuration options for expansion operations.
type Expander ¶
type Expander interface {
Expand(ctx context.Context, source string, destination string, umask os.FileMode) error
Matcher(extension string) bool
}
Expander defines the interface for extracting compressed archives.
func GetExpander ¶
GetExpander returns the first registered Expander whose Matcher accepts the given extension.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package bzip2 implements an Expander for standalone bzip2 compressed files.
|
Package bzip2 implements an Expander for standalone bzip2 compressed files. |
|
Package tar implements an Expander for tar archives, including gzip and bzip2 compressed variants.
|
Package tar implements an Expander for tar archives, including gzip and bzip2 compressed variants. |
|
Package zip implements an Expander for ZIP archives.
|
Package zip implements an Expander for ZIP archives. |
Click to show internal directories.
Click to hide internal directories.