Documentation ¶
Index ¶
- Variables
- func NameToPath(name string) (ret []string, err error)
- type ChangeOption
- type DirEntry
- func (d DirEntry) Dump(w io.Writer, level int)
- func (d DirEntry) Equal(n2 Node) bool
- func (d DirEntry) Info() (fs.FileInfo, error)
- func (d DirEntry) IsDir() bool
- func (d DirEntry) KeyRange() (Key, Key)
- func (d DirEntry) Merge(ctx Scope, node2 Node) (Node, error)
- func (d DirEntry) Mutate(ctx Scope, path KeyPath, fn func(Node) (Node, error)) (Node, error)
- func (d DirEntry) Name() string
- func (d DirEntry) Type() fs.FileMode
- type ExtFileInfo
- type FS
- type File
- func (f *File) Clone() *File
- func (f File) Dump(w io.Writer, level int)
- func (f File) Equal(n2 Node) bool
- func (f File) KeyRange() (Key, Key)
- func (f *File) Merge(ctx Scope, node2 Node) (Node, error)
- func (f *File) Mutate(ctx Scope, path KeyPath, fn func(Node) (Node, error)) (retNode Node, err error)
- func (f File) ReadAt(buf []byte, offset int64) (n int, err error)
- func (f File) Stat() (FileInfo, error)
- func (f *File) WriteAt(data []byte, offset int64) (*File, int, error)
- type FileID
- type FileInfo
- type FileMap
- func (f *FileMap) Clone() *FileMap
- func (f FileMap) Dump(w io.Writer, level int)
- func (f *FileMap) Equal(n2 Node) bool
- func (f FileMap) GetPath(id FileID) (path KeyPath)
- func (f FileMap) KeyRange() (Key, Key)
- func (f *FileMap) Merge(ctx Scope, node2 Node) (Node, error)
- func (f *FileMap) Mutate(ctx Scope, path KeyPath, fn func(Node) (Node, error)) (retNode Node, err error)
- type Handle
- type Key
- type KeyPath
- type MemFS
- func (m *MemFS) ChangeMode(name string, mode fs.FileMode, options ...ChangeOption) (err error)
- func (m *MemFS) ChangeOwner(name string, uid, gid int, options ...ChangeOption) (err error)
- func (m *MemFS) ChangeTimes(name string, atime, mtime time.Time, options ...ChangeOption) (err error)
- func (m *MemFS) Create(name string) (handle Handle, err error)
- func (m *MemFS) Link(oldname, newname string) (err error)
- func (m *MemFS) LinkStat(name string) (info fs.FileInfo, err error)
- func (m *MemFS) MakeDir(p string) (err error)
- func (m *MemFS) MakeDirAll(p string) (err error)
- func (m *MemFS) NewReadBatch() (batch *MemFSReadBatch, done func(*error))
- func (m *MemFS) NewWriteBatch() (batch *MemFSWriteBatch, done func(*error))
- func (m *MemFS) Open(path string) (fs.File, error)
- func (m *MemFS) OpenHandle(name string, options ...OpenOption) (handle Handle, err error)
- func (m *MemFS) ReadLink(name string) (link string, err error)
- func (m *MemFS) Remove(name string, options ...RemoveOption) (err error)
- func (m *MemFS) Rename(oldname, newname string) (err error)
- func (m *MemFS) Snapshot() FS
- func (m *MemFS) Stat(name string) (info fs.FileInfo, err error)
- func (m *MemFS) SymLink(oldname, newname string) (err error)
- func (m *MemFS) Truncate(name string, size int64) (err error)
- type MemFSReadBatch
- func (m *MemFSReadBatch) GetDirEntryByPath(parent *DirEntry, path []string, followSymlink bool) (entry *DirEntry, err error)
- func (m *MemFSReadBatch) GetFileByID(id FileID) (*File, error)
- func (m *MemFSReadBatch) GetFileByName(name string, followSymlink bool) (*File, error)
- func (m *MemFSReadBatch) GetFileIDByPath(path []string, followSymlink bool) (FileID, error)
- func (m *MemFSReadBatch) LinkStat(name string) (fs.FileInfo, error)
- func (m *MemFSReadBatch) NewHandle(name string, id FileID) *MemHandle
- func (m *MemFSReadBatch) ReadLink(name string) (link string, err error)
- func (m *MemFSReadBatch) Stat(name string) (fs.FileInfo, error)
- type MemFSWriteBatch
- func (m *MemFSWriteBatch) ChangeMode(name string, mode fs.FileMode, options ...ChangeOption) error
- func (m *MemFSWriteBatch) ChangeOwner(name string, uid, gid int, options ...ChangeOption) error
- func (m *MemFSWriteBatch) ChangeTimes(name string, atime, mtime time.Time, options ...ChangeOption) error
- func (m *MemFSWriteBatch) Create(name string) (Handle, error)
- func (m *MemFSWriteBatch) Link(oldname, newname string) error
- func (m *MemFSWriteBatch) MakeDir(p string) error
- func (m *MemFSWriteBatch) MakeDirAll(p string) error
- func (m *MemFSWriteBatch) OpenHandle(name string, options ...OpenOption) (handle Handle, err error)
- func (m *MemFSWriteBatch) Remove(name string, options ...RemoveOption) error
- func (m *MemFSWriteBatch) Rename(oldname string, newname string) error
- func (m *MemFSWriteBatch) SymLink(oldname, newname string) error
- func (m *MemFSWriteBatch) Truncate(name string, size int64) error
- type MemHandle
- func (h *MemHandle) ChangeMode(mode fs.FileMode) (err error)
- func (h *MemHandle) ChangeOwner(uid, gid int) (err error)
- func (h *MemHandle) ChangeTimes(atime, mtime time.Time) (err error)
- func (m *MemHandle) Close() error
- func (m *MemHandle) Name() string
- func (m *MemHandle) Read(buf []byte) (n int, err error)
- func (m *MemHandle) ReadAt(buf []byte, offset int64) (n int, err error)
- func (m *MemHandle) ReadDir(n int) (ret []fs.DirEntry, err error)
- func (m *MemHandle) Seek(offset int64, whence int) (n int64, err error)
- func (m *MemHandle) Stat() (fs.FileInfo, error)
- func (h *MemHandle) Sync() error
- func (h *MemHandle) Truncate(size int64) (err error)
- func (m *MemHandle) Write(data []byte) (n int, err error)
- type Node
- type NodeSet
- type OpenOption
- type RemoveOption
- type Scope
- type Sink
- type Src
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrBadArgument = errors.New("bad argument") ErrCannotLink = errors.New("cannot link") ErrCannotRemove = errors.New("cannot remove") ErrClosed = errors.New("closed") ErrDirNotEmpty = errors.New("dir not empty") ErrFileExisted = errors.New("file existed") ErrFileNotFound = errors.New("file not found") ErrImmutable = errors.New("immutable") ErrInvalidName = errors.New("invalid name") ErrInvalidPath = errors.New("invalid path") ErrNameMismatch = errors.New("name mismatch") ErrNoPermission = errors.New("no permission") ErrNodeNotFound = errors.New("node not found") ErrOutOfBounds = errors.New("out of bounds") ErrTypeMismatch = errors.New("type mismatch") )
Functions ¶
func NameToPath ¶
Types ¶
type ChangeOption ¶
type ChangeOption func(*changeSpec)
func OptNoFollow ¶
func OptNoFollow(b bool) ChangeOption
type DirEntry ¶
type DirEntry struct {
// contains filtered or unexported fields
}
type FS ¶
type FS interface { fs.FS ChangeMode(name string, mode fs.FileMode, options ...ChangeOption) error ChangeOwner(name string, uid, gid int, options ...ChangeOption) error ChangeTimes(name string, atime time.Time, mtime time.Time, options ...ChangeOption) error Create(name string) (Handle, error) Link(oldname, newname string) error MakeDir(path string) error MakeDirAll(path string) error OpenHandle(path string, options ...OpenOption) (Handle, error) ReadLink(name string) (string, error) Remove(path string, options ...RemoveOption) error Rename(oldpath, newpath string) error SymLink(oldname, newname string) error Truncate(name string, size int64) error Stat(name string) (fs.FileInfo, error) LinkStat(name string) (fs.FileInfo, error) Snapshot() FS }
type File ¶
type File struct { ID FileID IsDir bool Size int64 Mode fs.FileMode ModTime time.Time Subs *NodeSet // name -> NamedFileID Symlink string Content []byte //TODO sharded bytes slice UserID int GroupID int AccessTime time.Time // contains filtered or unexported fields }
type FileMap ¶
type FileMap struct {
// contains filtered or unexported fields
}
FileMap is sharded map of FileID to *File
func NewFileMap ¶
type MemFS ¶
func (*MemFS) ChangeMode ¶
func (*MemFS) ChangeOwner ¶
func (m *MemFS) ChangeOwner(name string, uid, gid int, options ...ChangeOption) (err error)
func (*MemFS) ChangeTimes ¶
func (*MemFS) MakeDirAll ¶
func (*MemFS) NewReadBatch ¶
func (m *MemFS) NewReadBatch() ( batch *MemFSReadBatch, done func(*error), )
func (*MemFS) NewWriteBatch ¶
func (m *MemFS) NewWriteBatch() ( batch *MemFSWriteBatch, done func(*error), )
func (*MemFS) OpenHandle ¶
func (m *MemFS) OpenHandle(name string, options ...OpenOption) (handle Handle, err error)
type MemFSReadBatch ¶
type MemFSReadBatch struct {
// contains filtered or unexported fields
}
func (*MemFSReadBatch) GetDirEntryByPath ¶
func (*MemFSReadBatch) GetFileByID ¶
func (m *MemFSReadBatch) GetFileByID(id FileID) (*File, error)
func (*MemFSReadBatch) GetFileByName ¶
func (m *MemFSReadBatch) GetFileByName(name string, followSymlink bool) (*File, error)
func (*MemFSReadBatch) GetFileIDByPath ¶
func (m *MemFSReadBatch) GetFileIDByPath(path []string, followSymlink bool) (FileID, error)
func (*MemFSReadBatch) LinkStat ¶
func (m *MemFSReadBatch) LinkStat(name string) (fs.FileInfo, error)
func (*MemFSReadBatch) NewHandle ¶
func (m *MemFSReadBatch) NewHandle(name string, id FileID) *MemHandle
type MemFSWriteBatch ¶
type MemFSWriteBatch struct {
MemFSReadBatch
}
func (*MemFSWriteBatch) ChangeMode ¶
func (m *MemFSWriteBatch) ChangeMode(name string, mode fs.FileMode, options ...ChangeOption) error
func (*MemFSWriteBatch) ChangeOwner ¶
func (m *MemFSWriteBatch) ChangeOwner(name string, uid, gid int, options ...ChangeOption) error
func (*MemFSWriteBatch) ChangeTimes ¶
func (m *MemFSWriteBatch) ChangeTimes(name string, atime, mtime time.Time, options ...ChangeOption) error
func (*MemFSWriteBatch) Link ¶
func (m *MemFSWriteBatch) Link(oldname, newname string) error
func (*MemFSWriteBatch) MakeDir ¶
func (m *MemFSWriteBatch) MakeDir(p string) error
func (*MemFSWriteBatch) MakeDirAll ¶
func (m *MemFSWriteBatch) MakeDirAll(p string) error
func (*MemFSWriteBatch) OpenHandle ¶
func (m *MemFSWriteBatch) OpenHandle(name string, options ...OpenOption) (handle Handle, err error)
func (*MemFSWriteBatch) Remove ¶
func (m *MemFSWriteBatch) Remove(name string, options ...RemoveOption) error
func (*MemFSWriteBatch) Rename ¶
func (m *MemFSWriteBatch) Rename(oldname string, newname string) error
func (*MemFSWriteBatch) SymLink ¶
func (m *MemFSWriteBatch) SymLink(oldname, newname string) error
type MemHandle ¶
func (*MemHandle) ChangeOwner ¶
type OpenOption ¶
type OpenOption func(*openSpec)
func OptCreate ¶
func OptCreate(b bool) OpenOption
type RemoveOption ¶
type RemoveOption func(*removeSpec)
func OptAll ¶
func OptAll(b bool) RemoveOption
Click to show internal directories.
Click to hide internal directories.