]> git.immae.eu Git - github/fretlink/terraform-provider-statuscake.git/blob - vendor/github.com/hashicorp/go-getter/decompress.go
Initial transfer of provider code
[github/fretlink/terraform-provider-statuscake.git] / vendor / github.com / hashicorp / go-getter / decompress.go
1 package getter
2
3 // Decompressor defines the interface that must be implemented to add
4 // support for decompressing a type.
5 type Decompressor interface {
6 // Decompress should decompress src to dst. dir specifies whether dst
7 // is a directory or single file. src is guaranteed to be a single file
8 // that exists. dst is not guaranteed to exist already.
9 Decompress(dst, src string, dir bool) error
10 }
11
12 // Decompressors is the mapping of extension to the Decompressor implementation
13 // that will decompress that extension/type.
14 var Decompressors map[string]Decompressor
15
16 func init() {
17 tbzDecompressor := new(TarBzip2Decompressor)
18 tgzDecompressor := new(TarGzipDecompressor)
19
20 Decompressors = map[string]Decompressor{
21 "bz2": new(Bzip2Decompressor),
22 "gz": new(GzipDecompressor),
23 "tar.bz2": tbzDecompressor,
24 "tar.gz": tgzDecompressor,
25 "tbz2": tbzDecompressor,
26 "tgz": tgzDecompressor,
27 "zip": new(ZipDecompressor),
28 }
29 }