Documentation
¶
Index ¶
- func ExitCode(err error) (int, bool)
- func TestConnection(ctx context.Context, rcUrl string, rcUser string, rcPass string, ...) error
- func ToVFSPath(dir string) string
- func ToVFSPaths(dirs []string) []string
- func WasHardTerminated(err error) bool
- type Manager
- func (m *Manager) ForgetDir(ctx context.Context, provider string, dirs []string) error
- func (m *Manager) GetAllMounts() map[string]*MountInfo
- func (m *Manager) GetLogger() *slog.Logger
- func (m *Manager) GetMountInfo(provider string) (*MountInfo, bool)
- func (m *Manager) IsMounted(provider string) bool
- func (m *Manager) IsReady() bool
- func (m *Manager) MonitorMounts(ctx context.Context)
- func (m *Manager) Mount(ctx context.Context, provider, mountPath, webdavURL string) error
- func (m *Manager) RecoverMount(ctx context.Context, provider string) error
- func (m *Manager) RefreshDir(ctx context.Context, provider string, dirs []string) error
- func (m *Manager) Start(ctx context.Context) error
- func (m *Manager) Stop() error
- func (m *Manager) Unmount(ctx context.Context, provider string) error
- func (m *Manager) UnmountAll(ctx context.Context) error
- func (m *Manager) WaitForReady(timeout time.Duration) error
- type Mount
- type MountInfo
- type RCRequest
- type RCResponse
- type RcloneRcClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TestConnection ¶
func ToVFSPath ¶
ToVFSPath converts a directory into the separator form rclone's VFS expects.
rclone's VFS is forward-slash on every platform, so a Windows-separated path like `tv\Show` matches no node. The failure is silent: vfs/forget echoes back whatever it is given and reports success even for a directory that does not exist, so a caller sees "Successfully notified" while nothing was invalidated.
On POSIX this is a no-op: '/' is already the separator, and a backslash is a legal character in a POSIX filename that must be left alone.
func ToVFSPaths ¶
ToVFSPaths applies ToVFSPath to every element, returning a new slice.
Used at the RC boundary so every caller is covered, including ones added later. Callers should still build correct virtual paths - normalizing here is a backstop, not a licence to pass OS paths - but a missed site degrades to a working call instead of a silent no-op.
func WasHardTerminated ¶
WasHardTerminated reports true iff the process was ended by SIGKILL or SIGTERM.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles the rclone RC server and provides mount operations
func NewManager ¶
NewManager creates a new rclone RC manager
func (*Manager) ForgetDir ¶
ForgetDir drops directories from the VFS cache without forcing an eager re-listing: the next client access re-lists lazily. Intended for deletions and moves, where an immediate re-enumeration of large directories would be wasted work.
func (*Manager) GetAllMounts ¶
GetAllMounts returns information about all mounts
func (*Manager) GetMountInfo ¶
GetMountInfo returns information about a specific mount
func (*Manager) MonitorMounts ¶
MonitorMounts continuously monitors mount health and attempts recovery
func (*Manager) RecoverMount ¶
RecoverMount attempts to recover a failed mount
func (*Manager) RefreshDir ¶
RefreshDir refreshes directories in the VFS cache
func (*Manager) UnmountAll ¶
UnmountAll unmounts all mounts
type Mount ¶
type Mount struct {
Provider string
LocalPath string
WebDAVURL string
// contains filtered or unexported fields
}
Mount represents a mount using the rclone RC client
func (*Mount) GetMountInfo ¶
GetMountInfo returns mount information
type MountInfo ¶
type MountInfo struct {
Provider string `json:"provider"`
LocalPath string `json:"local_path"`
WebDAVURL string `json:"webdav_url"`
Mounted bool `json:"mounted"`
MountedAt string `json:"mounted_at,omitempty"`
ConfigName string `json:"config_name"`
Error string `json:"error,omitempty"`
// contains filtered or unexported fields
}
type RCResponse ¶
type RcloneRcClient ¶
type RcloneRcClient interface {
RefreshDir(ctx context.Context, provider string, dirs []string) error
// ForgetDir drops the directories from the VFS cache without forcing an
// eager re-listing. Use it when files were deleted or moved away: the next
// client access re-lists lazily, whereas RefreshDir would trigger an
// immediate enumeration nothing asked for.
ForgetDir(ctx context.Context, provider string, dirs []string) error
}
func NewRcloneRcClient ¶
func NewRcloneRcClient( config *config.Manager, httpClient *http.Client, ) RcloneRcClient