Versions in this module Expand all Collapse all v0 v0.0.1 Mar 8, 2021 Changes in this version + const CachePurgeInterval + const DefaultDirtyTimeout + const DefaultFilePermissions + const DontSetPerms + const MaxLinkResolveDepth + const OK + const O_APPEND + const O_CREATE + const O_EXCL + const O_RDONLY + const O_RDWR + const O_SYNC + const O_TRUNC + const O_WRONLY + const ReadlinkInvalidArgument + const ReadlinkPermissionDenied + var ErrLinkTooDeep = errors.New("link recursion too deep") + var ErrNoPermission = os.ErrPermission + var ErrNotALink = errors.New("not a link") + var ErrNotPermitted = errors.New("operation not permitted") + func NewAdbFile(opts AdbFileOpenOptions) nodefs.File + func NewAdbFileSystem(config Config) (pathfs.FileSystem, error) + type AdbFile struct + func (f *AdbFile) Flush() fuse.Status + func (f *AdbFile) Fsync(flags int) fuse.Status + func (f *AdbFile) GetAttr(out *fuse.Attr) fuse.Status + func (f *AdbFile) InnerFile() nodefs.File + func (f *AdbFile) Read(buf []byte, off int64) (fuse.ReadResult, fuse.Status) + func (f *AdbFile) Release() + func (f *AdbFile) Truncate(size uint64) fuse.Status + func (f *AdbFile) Write(data []byte, off int64) (uint32, fuse.Status) + type AdbFileOpenOptions struct + FileBuffer *FileBuffer + Flags FileOpenFlags + type AdbFileSystem struct + func (fs *AdbFileSystem) Access(name string, mode uint32, context *fuse.Context) fuse.Status + func (fs *AdbFileSystem) Chmod(name string, mode uint32, context *fuse.Context) (code fuse.Status) + func (fs *AdbFileSystem) Chown(name string, uid uint32, gid uint32, context *fuse.Context) (code fuse.Status) + func (fs *AdbFileSystem) Create(name string, rawFlags uint32, perms uint32, context *fuse.Context) (nodefs.File, fuse.Status) + func (fs *AdbFileSystem) GetAttr(name string, _ *fuse.Context) (attr *fuse.Attr, status fuse.Status) + func (fs *AdbFileSystem) GetXAttr(name string, attribute string, context *fuse.Context) (data []byte, code fuse.Status) + func (fs *AdbFileSystem) Link(oldName string, newName string, context *fuse.Context) fuse.Status + func (fs *AdbFileSystem) ListXAttr(name string, context *fuse.Context) (attributes []string, code fuse.Status) + func (fs *AdbFileSystem) Mkdir(name string, perms uint32, context *fuse.Context) fuse.Status + func (fs *AdbFileSystem) Mknod(name string, mode uint32, dev uint32, context *fuse.Context) fuse.Status + func (fs *AdbFileSystem) OnMount(nodeFs *pathfs.PathNodeFs) + func (fs *AdbFileSystem) OnUnmount() + func (fs *AdbFileSystem) Open(name string, flags uint32, context *fuse.Context) (nodefs.File, fuse.Status) + func (fs *AdbFileSystem) OpenDir(name string, _ *fuse.Context) ([]fuse.DirEntry, fuse.Status) + func (fs *AdbFileSystem) Readlink(name string, context *fuse.Context) (target string, status fuse.Status) + func (fs *AdbFileSystem) RemoveXAttr(name string, attr string, context *fuse.Context) fuse.Status + func (fs *AdbFileSystem) Rename(oldName, newName string, context *fuse.Context) fuse.Status + func (fs *AdbFileSystem) Rmdir(name string, context *fuse.Context) fuse.Status + func (fs *AdbFileSystem) SetDebug(debug bool) + func (fs *AdbFileSystem) SetXAttr(name string, attr string, data []byte, flags int, context *fuse.Context) fuse.Status + func (fs *AdbFileSystem) StatFs(name string) *fuse.StatfsOut + func (fs *AdbFileSystem) String() string + func (fs *AdbFileSystem) Symlink(oldName string, newName string, context *fuse.Context) fuse.Status + func (fs *AdbFileSystem) Truncate(name string, size uint64, context *fuse.Context) (code fuse.Status) + func (fs *AdbFileSystem) Unlink(name string, context *fuse.Context) fuse.Status + func (fs *AdbFileSystem) Utimens(name string, Atime *time.Time, Mtime *time.Time, context *fuse.Context) (code fuse.Status) + type CachedDirEntries struct + ByName map[string]*adb.DirEntry + InOrder []*adb.DirEntry + func NewCachedDirEntries(entries []*adb.DirEntry) *CachedDirEntries + type CachingDeviceClient struct + Cache DirEntryCache + func (c *CachingDeviceClient) ListDirEntries(path string, log *LogEntry) ([]*adb.DirEntry, error) + func (c *CachingDeviceClient) OpenWrite(name string, perms os.FileMode, mtime time.Time, log *LogEntry) (io.WriteCloser, error) + func (c *CachingDeviceClient) Stat(name string, log *LogEntry) (*adb.DirEntry, error) + type Config struct + ClientFactory DeviceClientFactory + ConnectionPoolSize int + DeviceRoot string + DeviceSerial string + Mountpoint string + ReadOnly bool + type DeviceClient interface + ListDirEntries func(path string, log *LogEntry) ([]*adb.DirEntry, error) + OpenRead func(path string, log *LogEntry) (io.ReadCloser, error) + OpenWrite func(path string, perms os.FileMode, mtime time.Time, log *LogEntry) (io.WriteCloser, error) + RunCommand func(cmd string, args ...string) (string, error) + Stat func(path string, log *LogEntry) (*adb.DirEntry, error) + type DeviceClientFactory func() DeviceClient + func NewCachingDeviceClientFactory(cache DirEntryCache, factory DeviceClientFactory) DeviceClientFactory + func NewGoadbDeviceClientFactory(server adb.Server, deviceSerial string, deviceDisconnectedHandler func()) DeviceClientFactory + type DirEntryCache interface + Get func(path string) (entries *CachedDirEntries, found bool) + GetOrLoad func(path string, loader DirEntryLoader) (entries *CachedDirEntries, err error, hit bool) + RemoveEventually func(path string) + func NewDirEntryCache(ttl time.Duration) DirEntryCache + type DirEntryLoader func(path string) (*CachedDirEntries, error) + type FileBuffer struct + func NewFileBuffer(initialFlags FileOpenFlags, opts FileBufferOptions, logEntry *LogEntry) (file *FileBuffer, err error) + func (f *FileBuffer) Contents() string + func (f *FileBuffer) DecRefCount() int + func (f *FileBuffer) Flush(logEntry *LogEntry) error + func (f *FileBuffer) IncRefCount() int + func (f *FileBuffer) IsDirty() bool + func (f *FileBuffer) ReadAt(buf []byte, off int64) (n int, err error) + func (f *FileBuffer) RefCount() int + func (f *FileBuffer) SetSize(size int64) + func (f *FileBuffer) Size() int64 + func (f *FileBuffer) Sync(logEntry *LogEntry) error + func (f *FileBuffer) SyncIfTooDirty(logEntry *LogEntry) error + func (f *FileBuffer) WriteAt(data []byte, off int64) (int, error) + type FileBufferOptions struct + Client DeviceClient + Clock Clock + DirtyTimeout time.Duration + Path string + Perms os.FileMode + ZeroRefCountHandler func(*FileBuffer) + type FileOpenFlags uint32 + func (f FileOpenFlags) CanRead() bool + func (f FileOpenFlags) CanWrite() bool + func (f FileOpenFlags) Contains(bits FileOpenFlags) bool + func (f FileOpenFlags) GoString() string + func (f FileOpenFlags) String() string + type LogEntry struct + func StartFileOperation(name, path string, args string) *LogEntry + func StartOperation(name string, path string) *LogEntry + func (r *LogEntry) CacheUsed(hit bool) + func (r *LogEntry) Error(err error) + func (r *LogEntry) ErrorMsg(err error, msg string, args ...interface{}) + func (r *LogEntry) FinishOperation() + func (r *LogEntry) Result(msg string, args ...interface{}) + func (r *LogEntry) Status(status syscall.Errno) syscall.Errno + func (r *LogEntry) SuppressFinishOperation() + type OpenFiles struct + func NewOpenFiles(opts OpenFilesOptions) *OpenFiles + func (f *OpenFiles) GetOrLoad(path string, openFlags FileOpenFlags, perms os.FileMode, logEntry *LogEntry) (file *FileBuffer, err error) + type OpenFilesOptions struct + ClientFactory DeviceClientFactory + DefaultPermissions os.FileMode + DeviceSerial string + DirtyTimeout time.Duration + type WrappingFile struct + AfterCall func(fs *WrappingFile, call interface{}, status *fuse.Status, ...) + BeforeCall func(fs *WrappingFile, method string, args ...interface{}) (call interface{}) + func (f *WrappingFile) Allocate(off uint64, size uint64, mode uint32) (code fuse.Status) + func (f *WrappingFile) Chmod(perms uint32) (code fuse.Status) + func (f *WrappingFile) Chown(uid uint32, gid uint32) (code fuse.Status) + func (f *WrappingFile) Flush() (code fuse.Status) + func (f *WrappingFile) Fsync(flags int) (code fuse.Status) + func (f *WrappingFile) GetAttr(out *fuse.Attr) (code fuse.Status) + func (f *WrappingFile) InnerFile() (file nodefs.File) + func (f *WrappingFile) Read(dest []byte, off int64) (result fuse.ReadResult, code fuse.Status) + func (f *WrappingFile) Release() + func (f *WrappingFile) SetInode(inode *nodefs.Inode) + func (f *WrappingFile) String() string + func (f *WrappingFile) Truncate(size uint64) (code fuse.Status) + func (f *WrappingFile) Utimens(atime *time.Time, mtime *time.Time) (code fuse.Status) + func (f *WrappingFile) Write(data []byte, off int64) (written uint32, code fuse.Status)