Documentation
¶
Index ¶
- Constants
- func AbsolutePath(root, path string) string
- func GetBlockSize(path string) (int, error)
- func GetPageSize() int
- func RelativePath(root, path string) string
- func ResolveVirtualPath(root, p string) string
- type DiskFilesystem
- func (d *DiskFilesystem) Copy(source, destination string) error
- func (d *DiskFilesystem) CreateDir(path string) error
- func (d *DiskFilesystem) Exists(path string) bool
- func (d *DiskFilesystem) FileHash(path string, hasher hashing.Hasher) (hashing.Sum, error)
- func (d *DiskFilesystem) Open(name string, flags int, perm os.FileMode) (File, error)
- func (d *DiskFilesystem) ReadDir(path string, recursive bool) ([]os.DirEntry, error)
- func (d *DiskFilesystem) ReadFile(path string) ([]byte, error)
- func (d *DiskFilesystem) Remove(path string) error
- func (d *DiskFilesystem) Rename(oldPath, newPath string) error
- func (b DiskFilesystem) RootAbs() string
- func (b DiskFilesystem) RootDir() string
- func (d *DiskFilesystem) Stat(path string) (os.FileInfo, error)
- func (d *DiskFilesystem) Sub(dir string) (FileSystem, error)
- func (b DiskFilesystem) Unwatch(path string, callback chan Event) error
- func (b DiskFilesystem) Watch(path string, callback chan Event) error
- func (d *DiskFilesystem) WriteFile(path string, data []byte) error
- type Event
- type File
- type FileSystem
- type MMapAccess
- type MMapFilesystem
- type MMapMode
- type MMapOptions
- type MemoryFilesystem
- func (m *MemoryFilesystem) Copy(source, destination string) error
- func (m *MemoryFilesystem) CreateDir(dir string) error
- func (m *MemoryFilesystem) Exists(path string) bool
- func (m *MemoryFilesystem) FileHash(path string, hasher hashing.Hasher) (hashing.Sum, error)
- func (m *MemoryFilesystem) Open(name string, flags int, perm os.FileMode) (File, error)
- func (m *MemoryFilesystem) ReadDir(dir string, recursive bool) ([]os.DirEntry, error)
- func (m *MemoryFilesystem) ReadFile(path string) ([]byte, error)
- func (m *MemoryFilesystem) Remove(path string) error
- func (m *MemoryFilesystem) Rename(oldPath, newPath string) error
- func (b MemoryFilesystem) RootAbs() string
- func (b MemoryFilesystem) RootDir() string
- func (m *MemoryFilesystem) Stat(path string) (os.FileInfo, error)
- func (m *MemoryFilesystem) Sub(dir string) (FileSystem, error)
- func (m *MemoryFilesystem) Unwatch(path string, callback chan Event) error
- func (m *MemoryFilesystem) Watch(path string, callback chan Event) error
- func (m *MemoryFilesystem) WriteFile(path string, data []byte) error
- type SyncType
Constants ¶
View Source
const ( PrivateAccess = MMapAccess(mmap.MAP_PRIVATE) )
View Source
const ( ReadOnlyMode = MMapMode(mmap.PROT_READ) WriteOnlyMode = MMapMode(mmap.PROT_WRITE) ReadWriteMode = MMapMode(mmap.PROT_READ | mmap.PROT_WRITE) )
Variables ¶
This section is empty.
Functions ¶
func AbsolutePath ¶
func GetBlockSize ¶
func GetPageSize ¶
func GetPageSize() int
func RelativePath ¶
func ResolveVirtualPath ¶
Types ¶
type DiskFilesystem ¶
type DiskFilesystem struct {
// contains filtered or unexported fields
}
func (*DiskFilesystem) Copy ¶
func (d *DiskFilesystem) Copy(source, destination string) error
func (*DiskFilesystem) CreateDir ¶
func (d *DiskFilesystem) CreateDir(path string) error
func (*DiskFilesystem) Exists ¶
func (d *DiskFilesystem) Exists(path string) bool
func (*DiskFilesystem) Remove ¶
func (d *DiskFilesystem) Remove(path string) error
func (*DiskFilesystem) Rename ¶
func (d *DiskFilesystem) Rename(oldPath, newPath string) error
func (*DiskFilesystem) Sub ¶
func (d *DiskFilesystem) Sub(dir string) (FileSystem, error)
type File ¶
type File interface { io.Reader io.ReaderAt io.Writer io.WriterAt io.Seeker io.Closer Slice(start int64, end int64) ([]byte, error) Truncate(size int64) error Stat() (os.FileInfo, error) Sync() error }
File is the interface compatible with os.File.
type FileSystem ¶
type FileSystem interface { // Open opens the named file. Open(name string, flags int, perm os.FileMode) (File, error) // ReadDir returns a slice of directory entries in the named directory. ReadDir(path string, recursive bool) ([]os.DirEntry, error) // ReadFile reads and returns the content of the named file. ReadFile(path string) ([]byte, error) // WriteFile writes the content to the named file. WriteFile(path string, data []byte) error // CreateDir creates a new directory with the given name. CreateDir(path string) error // Remove removes the named file or directory. Remove(path string) error // Rename renames the named file or directory to newPath. Rename(oldPath, newPath string) error // Copy copies source file to destination Copy(source, destination string) error // Stat returns the FileInfo for the named file or directory. Stat(path string) (os.FileInfo, error) // Exists checks if the named file or directory exists. Exists(path string) bool // FileHash hashes the content of the named file with the given hash function. FileHash(path string, hasher hashing.Hasher) (hashing.Sum, error) // Sub returns a new FileSystem rooted at dir Sub(dir string) (FileSystem, error) // Watch a file or directory for changes. Watch(path string, callback chan Event) error // Unwatch removes a watch on a file or directory. Unwatch(path string, callback chan Event) error // RootDir Returns the root directory of the filesystem. RootDir() string // RootAbs Returns the absolute path to the root directory of the filesystem. RootAbs() string }
func NewDiskFilesystem ¶
func NewDiskFilesystem() FileSystem
func NewMMapFilesystem ¶
func NewMMapFilesystem(options *MMapOptions) FileSystem
func NewMemoryFilesystem ¶
func NewMemoryFilesystem() FileSystem
type MMapAccess ¶
type MMapFilesystem ¶
type MMapFilesystem struct { FileSystem // contains filtered or unexported fields }
type MMapOptions ¶
type MMapOptions struct { Access MMapAccess Mode MMapMode Sync SyncType }
type MemoryFilesystem ¶
type MemoryFilesystem struct {
// contains filtered or unexported fields
}
func (*MemoryFilesystem) Copy ¶
func (m *MemoryFilesystem) Copy(source, destination string) error
func (*MemoryFilesystem) CreateDir ¶
func (m *MemoryFilesystem) CreateDir(dir string) error
func (*MemoryFilesystem) Exists ¶
func (m *MemoryFilesystem) Exists(path string) bool
func (*MemoryFilesystem) ReadFile ¶
func (m *MemoryFilesystem) ReadFile(path string) ([]byte, error)
func (*MemoryFilesystem) Remove ¶
func (m *MemoryFilesystem) Remove(path string) error
func (*MemoryFilesystem) Rename ¶
func (m *MemoryFilesystem) Rename(oldPath, newPath string) error
func (*MemoryFilesystem) Sub ¶
func (m *MemoryFilesystem) Sub(dir string) (FileSystem, error)
func (*MemoryFilesystem) Unwatch ¶
func (m *MemoryFilesystem) Unwatch(path string, callback chan Event) error
Click to show internal directories.
Click to hide internal directories.