chore: add files cache for reading template tar archives from db (#17141)

This commit is contained in:
ケイラ
2025-04-02 16:42:16 -06:00
committed by GitHub
parent c06294235f
commit ac7ea08873
5 changed files with 308 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
package archivefs
import (
"archive/tar"
"io"
"io/fs"
"github.com/spf13/afero"
"github.com/spf13/afero/tarfs"
)
func FromTarReader(r io.Reader) fs.FS {
tr := tar.NewReader(r)
tfs := tarfs.New(tr)
rofs := afero.NewReadOnlyFs(tfs)
return afero.NewIOFS(rofs)
}