Documentation
¶
Index ¶
- func Mount(ctx context.Context, backend *FileSystem, mountpoint string) (*fuse.Server, error)
- type FileSystem
- func (f *FileSystem) Chmod(ctx context.Context, rel string, mode os.FileMode) syscall.Errno
- func (f *FileSystem) CreateFile(ctx context.Context, rel string) syscall.Errno
- func (f *FileSystem) MkDir(ctx context.Context, rel string) syscall.Errno
- func (f *FileSystem) ReadDir(rel string) ([]os.FileInfo, syscall.Errno)
- func (f *FileSystem) ReadFile(ctx context.Context, rel string, off int64, size int) ([]byte, syscall.Errno)
- func (f *FileSystem) Rename(ctx context.Context, oldRel, newRel string) syscall.Errno
- func (f *FileSystem) Rmdir(ctx context.Context, rel string) syscall.Errno
- func (f *FileSystem) Stat(rel string) (os.FileInfo, syscall.Errno)
- func (f *FileSystem) Truncate(ctx context.Context, rel string, size int64) syscall.Errno
- func (f *FileSystem) Unlink(ctx context.Context, rel string) syscall.Errno
- func (f *FileSystem) WriteFile(ctx context.Context, rel string, data []byte, off int64) (uint32, syscall.Errno)
- type RemoteFile
- type RemoteWriteFile
- type SFTPAdapter
- func (a *SFTPAdapter) Chmod(path string, mode os.FileMode) error
- func (a *SFTPAdapter) Create(path string) (RemoteWriteFile, error)
- func (a *SFTPAdapter) Mkdir(path string) error
- func (a *SFTPAdapter) Open(path string) (RemoteFile, error)
- func (a *SFTPAdapter) OpenFile(path string, flags int) (RemoteWriteFile, error)
- func (a *SFTPAdapter) ReadDir(path string) ([]os.FileInfo, error)
- func (a *SFTPAdapter) Remove(path string) error
- func (a *SFTPAdapter) Rename(oldpath, newpath string) error
- func (a *SFTPAdapter) Stat(path string) (os.FileInfo, error)
- func (a *SFTPAdapter) Truncate(path string, size int64) error
- type SFTPClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FileSystem ¶
type FileSystem struct {
// contains filtered or unexported fields
}
func New ¶
func New(sftp SFTPClient, root string, log *slog.Logger) *FileSystem
func (*FileSystem) CreateFile ¶
type RemoteFile ¶
type RemoteWriteFile ¶
type SFTPAdapter ¶
SFTPAdapter wraps *sftp.Client so it satisfies the SFTPClient interface. The underlying sftp methods return *sftp.File, which implements both RemoteFile and RemoteWriteFile, but Go requires exact return-type matches for interface satisfaction, so we wrap the calls.
func (*SFTPAdapter) Create ¶
func (a *SFTPAdapter) Create(path string) (RemoteWriteFile, error)
func (*SFTPAdapter) Mkdir ¶
func (a *SFTPAdapter) Mkdir(path string) error
func (*SFTPAdapter) Open ¶
func (a *SFTPAdapter) Open(path string) (RemoteFile, error)
func (*SFTPAdapter) OpenFile ¶
func (a *SFTPAdapter) OpenFile(path string, flags int) (RemoteWriteFile, error)
func (*SFTPAdapter) Remove ¶
func (a *SFTPAdapter) Remove(path string) error
func (*SFTPAdapter) Rename ¶
func (a *SFTPAdapter) Rename(oldpath, newpath string) error
type SFTPClient ¶
type SFTPClient interface {
Open(path string) (RemoteFile, error)
Create(path string) (RemoteWriteFile, error)
OpenFile(path string, flags int) (RemoteWriteFile, error)
Stat(path string) (os.FileInfo, error)
ReadDir(path string) ([]os.FileInfo, error)
Mkdir(path string) error
Remove(path string) error
Rename(oldpath, newpath string) error
Chmod(path string, mode os.FileMode) error
Truncate(path string, size int64) error
}
SFTPClient is the subset of pkg/sftp client methods required by the filesystem.
Click to show internal directories.
Click to hide internal directories.