tstor/fs/fs.go
Antonio Navarro Perez 45f10e2f81 Refactoring and first steps to make multi OS compatible.
- Using cgofuse to be compatible with multiple OSes
- Refactor to make possible better testing
- Add a bunch of tests
- Add code coverage

Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
2020-10-18 11:39:59 +02:00

23 lines
509 B
Go

package fs
import (
"github.com/ajnavarro/distribyted/iio"
)
type File interface {
IsDir() bool
Size() int64
iio.Reader
}
type Filesystem interface {
// Open opens the named file for reading. If successful, methods on the
// returned file can be used for reading; the associated file descriptor has
// mode O_RDONLY.
Open(filename string) (File, error)
// ReadDir reads the directory named by dirname and returns a list of
// directory entries.
ReadDir(path string) (map[string]File, error)
}