context fs
This commit is contained in:
parent
fd3beea874
commit
7b1863109c
25 changed files with 593 additions and 349 deletions
src/host/vfs
|
@ -1,12 +1,13 @@
|
|||
package vfs
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"io/fs"
|
||||
"path"
|
||||
"time"
|
||||
|
||||
"git.kmsign.ru/royalcat/tstor/src/iio"
|
||||
"git.kmsign.ru/royalcat/tstor/pkg/ctxio"
|
||||
)
|
||||
|
||||
type File interface {
|
||||
|
@ -14,7 +15,9 @@ type File interface {
|
|||
Size() int64
|
||||
Stat() (fs.FileInfo, error)
|
||||
|
||||
iio.Reader
|
||||
ctxio.Reader
|
||||
ctxio.ReaderAt
|
||||
ctxio.Closer
|
||||
}
|
||||
|
||||
var ErrNotImplemented = errors.New("not implemented")
|
||||
|
@ -23,14 +26,14 @@ 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)
|
||||
Open(ctx context.Context, filename string) (File, error)
|
||||
|
||||
// ReadDir reads the directory named by dirname and returns a list of
|
||||
// directory entries.
|
||||
ReadDir(path string) ([]fs.DirEntry, error)
|
||||
ReadDir(ctx context.Context, path string) ([]fs.DirEntry, error)
|
||||
|
||||
Stat(filename string) (fs.FileInfo, error)
|
||||
Unlink(filename string) error
|
||||
Stat(ctx context.Context, filename string) (fs.FileInfo, error)
|
||||
Unlink(ctx context.Context, filename string) error
|
||||
|
||||
fs.DirEntry
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue