mirror of
https://github.com/kovetskiy/mark.git
synced 2025-05-25 14:32:40 +08:00
22 lines
337 B
Go
22 lines
337 B
Go
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))
|
|
}
|