Documentation
¶
Overview ¶
Package filesystem abstracts file access on a reMarkable device (over SFTP), on the host, or against an in-memory mock.
Index ¶
- type FS
- type Local
- func (f *Local) Exists(path string) (bool, error)
- func (f *Local) IsMounted(target string) (bool, error)
- func (f *Local) MkdirAll(path string, perm os.FileMode) error
- func (f *Local) Mount(device, target string, readonly bool) error
- func (f *Local) ReadFile(path string) ([]byte, error)
- func (f *Local) Remove(path string) error
- func (f *Local) RemoveAll(path string) error
- func (f *Local) Unmount(target string) error
- func (f *Local) WriteFile(path string, data []byte, perm os.FileMode) error
- type Mock
- func (f *Mock) Exists(path string) (bool, error)
- func (f *Mock) GetFile(path string) ([]byte, bool)
- func (f *Mock) IsMounted(target string) (bool, error)
- func (f *Mock) MkdirAll(path string, perm os.FileMode) error
- func (f *Mock) Mount(device, target string, readonly bool) error
- func (f *Mock) ReadFile(path string) ([]byte, error)
- func (f *Mock) Remove(path string) error
- func (f *Mock) RemoveAll(path string) error
- func (f *Mock) Removed() []string
- func (f *Mock) SetFile(path string, content []byte)
- func (f *Mock) SetFileString(path, content string)
- func (f *Mock) SimulateMountedPartition(partNum int, version string)
- func (f *Mock) Unmount(target string) error
- func (f *Mock) WriteFile(path string, data []byte, perm os.FileMode) error
- type MountableFS
- type SSH
- func (f *SSH) Close() error
- func (f *SSH) Exists(path string) (bool, error)
- func (f *SSH) IsMounted(target string) (bool, error)
- func (f *SSH) MkdirAll(path string, perm os.FileMode) error
- func (f *SSH) Mount(device, target string, readonly bool) error
- func (f *SSH) ReadFile(path string) ([]byte, error)
- func (f *SSH) Remove(path string) error
- func (f *SSH) RemoveAll(path string) error
- func (f *SSH) Unmount(target string) error
- func (f *SSH) WriteFile(path string, data []byte, perm os.FileMode) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FS ¶
type FS interface {
ReadFile(path string) ([]byte, error)
WriteFile(path string, data []byte, perm os.FileMode) error
Exists(path string) (bool, error)
MkdirAll(path string, perm os.FileMode) error
Remove(path string) error
RemoveAll(path string) error
}
FS provides file operations on a target filesystem.
type Mock ¶
type Mock struct {
// contains filtered or unexported fields
}
Mock is an in-memory FS for tests.
func (*Mock) SetFileString ¶
func (*Mock) SimulateMountedPartition ¶
SimulateMountedPartition seeds the mock so that mounting partition partNum exposes a release file reporting the given version.
type MountableFS ¶
type MountableFS interface {
FS
Mount(device, target string, readonly bool) error
Unmount(target string) error
IsMounted(target string) (bool, error)
}
MountableFS is an FS that can also mount and unmount block devices.
Click to show internal directories.
Click to hide internal directories.