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