diff options
Diffstat (limited to 'utils/fs/fs.go')
-rw-r--r-- | utils/fs/fs.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/utils/fs/fs.go b/utils/fs/fs.go new file mode 100644 index 0000000..df771dd --- /dev/null +++ b/utils/fs/fs.go @@ -0,0 +1,21 @@ +package fs + +import ( + "io" + "os" +) + +// FS interface represent an abstracted filesystem, so you can +// use NewRepositoryFromFS from any medium. +type FS interface { + Stat(path string) (os.FileInfo, error) + Open(path string) (ReadSeekCloser, error) + ReadDir(path string) ([]os.FileInfo, error) + Join(elem ...string) string +} + +// ReadSeekCloser is a Reader, Seeker and Closer. +type ReadSeekCloser interface { + io.ReadCloser + io.Seeker +} |