This commit is contained in:
Egor Kovetskiy
2019-06-05 18:02:39 +03:00
parent eb30d1d1fc
commit 4ffbc12fa4
5 changed files with 83 additions and 20 deletions

27
pkg/fs/tar.go Normal file
View File

@@ -0,0 +1,27 @@
package fs
import (
"archive/tar"
"io"
"github.com/reconquest/karma-go"
)
type TarFileSystem struct {
files map[string][]byte
}
func NewTarFileSystem(input io.Reader) (*TarFileSystem, error) {
files := map[string][]byte{}
archive := tar.NewReader(input)
for {
header, err := archive.Next()
if err != nil {
return nil, karma.Format(
err,
"asdasd",
)
}
}
}