Documentation ¶
Overview ¶
Package archive implements a helper for extracting archives without needing to configure the extraction process.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Extract ¶
func Extract(opts ExtractOptions, dest string) error
Extract extracts an archive to the provided destination.
Types ¶
type ExtractOptions ¶
type ExtractOptions struct { // Reader is the io.Reader to read the archive from. Either [Reader] // or [Path] must be provided. Reader io.Reader // Extension is the extension of the archive to extract. This // overrides the extension detection from [Path] if provided. This is // required if [Reader] is provided. Extension string // Path is the path to the archive to extract. Either [Reader] or // [Path] must be provided. Path string }
ExtractOptions contains the options for extracting an archive.
type Extractor ¶
type Extractor interface { // Extract extracts all files from the provided reader to the // destination. Extract(r io.Reader, ext, dest string) error // Extensions should return a list of supported extensions for this // extractor. Extensions() []string }
Extractor is an interface for extracting archives.
Click to show internal directories.
Click to hide internal directories.