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

21
pkg/fs/disk.go Normal file
View File

@@ -0,0 +1,21 @@
package fs
import (
"io"
"os"
"path/filepath"
)
type DiskFileSystem struct {
baseDir string
}
func NewDiskFileSystem(baseDir string) *DiskFileSystem {
return &DiskFileSystem{
baseDir: baseDir,
}
}
func (system *DiskFileSystem) Open(path string) (io.ReadCloser, error) {
return os.Open(filepath.Join(system.baseDir, path))
}