mirror of
https://github.com/kovetskiy/mark.git
synced 2026-05-03 22:12:35 +00:00
wip
This commit is contained in:
27
pkg/fs/tar.go
Normal file
27
pkg/fs/tar.go
Normal 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",
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user