Documentation ¶
Index ¶
- Variables
- func CacheConfigProviders() error
- func CancelClientContext()
- func DeleteConfig(name string) error
- func DialServer() error
- func GetClientContext() context.Context
- func GetConfigSettings() (map[string]map[string]interface{}, error)
- func GetCurrentSettings() map[string]map[string]interface{}
- func GetJobQueue() *sync.Map
- func GetNewJobID(jobType string) int64
- func GetProviderDesc(confType string) string
- func GetSessions() []string
- func JobInfoStatus() chan JobInfo
- func Login(host, user, pass string) (string, error)
- func MonitorJob(job *Job, nostop ...struct{})
- func PollConnection(updateMonitor bool) chan bool
- func SaveConfig(data map[string]interface{}, create, interactiveConfig bool) error
- func SetSession(host string)
- func SetupClient(host, user, pass string) error
- func StartDashboard() (chan DashboardInfo, chan struct{})
- func StopDashboard()
- func StopJob(job *Job, errors string, force ...struct{})
- func StopJobGroup(job *Job)
- type Client
- type ConfigProviders
- type DashboardInfo
- type DashboardStats
- type Job
- type JobInfo
- type Provider
- type ProviderOption
- type Response
- type TransferStat
- type Version
Constants ¶
This section is empty.
Variables ¶
var (
JobInfoChan chan JobInfo
)
Functions ¶
func CacheConfigProviders ¶
func CacheConfigProviders() error
CacheConfigProviders fetches the provider list and stores it.
func CancelClientContext ¶
func CancelClientContext()
CancelClientContext cancels the client context.
func GetClientContext ¶
GetClientContext returns the client context.
func GetConfigSettings ¶
GetConfigSettings returns the list of configured remotes.
func GetCurrentSettings ¶
GetCurrentSettings returns the cached list of remotes.
func GetProviderDesc ¶
GetProviderDesc returns the providers description.
func JobInfoStatus ¶
func JobInfoStatus() chan JobInfo
JobInfoStatus returns the job stats update channel.
func MonitorJob ¶
func MonitorJob(job *Job, nostop ...struct{})
MonitorJob monitors the provided job, and if nostop is not set, it will automatically stop monitoring the job.
func PollConnection ¶
PollConnection polls the connectivity status of the host.
func SaveConfig ¶
SaveConfig saves the configuration.
func StartDashboard ¶
func StartDashboard() (chan DashboardInfo, chan struct{})
StartDashboard starts polling for rclone stats.
func StopJobGroup ¶
func StopJobGroup(job *Job)
StopJobGroup stops all jobs associated with the group.
Types ¶
type Client ¶
Client stores host/client information and its credentials.
func GetCurrentClient ¶
GetCurrentClient gets the client associated with the current host.
type ConfigProviders ¶
type ConfigProviders struct {
Providers []Provider `json:"providers"`
}
ConfigProviders stores the list of configuration providers.
func GetConfigProviders ¶
func GetConfigProviders() (ConfigProviders, error)
GetConfigProviders returns the list of providers.
type DashboardInfo ¶
type DashboardInfo struct { Connected bool Bandwidth string Stats *DashboardStats User string Version string }
DashboardInfo stores the dashboard information.
type DashboardStats ¶
type DashboardStats struct { Bytes int64 `json:"bytes"` Checks int64 `json:"checks"` DeletedDirs int64 `json:"deletedDirs"` Deletes int64 `json:"deletes"` ElapsedTime float64 `json:"elapsedTime"` Errors int64 `json:"errors"` Eta int64 `json:"eta"` FatalError bool `json:"fatalError"` Renames int64 `json:"renames"` RetryError bool `json:"retryError"` Speed float64 `json:"speed"` TotalBytes int64 `json:"totalBytes"` TotalChecks int64 `json:"totalChecks"` TotalTransfers int64 `json:"totalTransfers"` TransferTime int64 `json:"transferTime"` Transferring []TransferStat `json:"transferring"` Transfers int64 `json:"transfers"` }
DashboardStats stores the rclone stats.
type Job ¶
type Job struct { ID int64 Group string Context context.Context Type string Description string Updates chan JobInfo Cancel context.CancelFunc RefreshItems interface{} }
Job stores the rclone job information.
func AddJobToQueue ¶
AddJobToQueue adds a job to the queue and if nomonitor is not set, will automatically start to monitor the job.
func GetLatestJob ¶
GetLatestJob gets the latest job associated with the provided job type.
type JobInfo ¶
type JobInfo struct { Duration float64 `json:"duration"` EndTime time.Time `json:"endTime"` Error string `json:"error"` Finished bool `json:"finished"` Group string `json:"group"` ID int64 `json:"id"` Output map[string]interface{} `json:"output"` StartTime time.Time `json:"startTime"` Success bool `json:"success"` Transfers struct { Stats []TransferStat `json:"transferring"` } JobCount int64 Type, Description string CurrentTransfer TransferStat RefreshItems interface{} }
JobInfo stores the rclone running job stats.
func GetJobReply ¶
GetJobReply polls the job status and returns its output information when the job has finished.
type Provider ¶
type Provider struct { Name string `json:"Name"` Description string `json:"Description"` Prefix string `json:"Prefix"` Options []ProviderOption `json:"Options"` }
Provider stores the provider information.
func GetProviderByDesc ¶
GetProviderByDesc matches and returns a provider by its description.
func GetProviderByType ¶
GetProviderByType matches and returns a provider by its type.
type ProviderOption ¶
type ProviderOption struct { Name string `json:"Name"` Help string `json:"Help"` Provider string `json:"Provider"` ShortOpt string `json:"ShortOpt"` Hide int `json:"Hide"` Required bool `json:"Required"` IsPassword bool `json:"IsPassword"` NoPrefix bool `json:"NoPrefix"` Advanced bool `json:"Advanced"` Exclusive bool `json:"Exclusive"` DefaultStr string `json:"DefaultStr"` ValueStr string `json:"ValueStr"` Type string `json:"Type"` Examples []struct { Value string `json:"Value"` Help string `json:"Help"` Provider string `json:"Provider"` } `json:"Examples"` }
ProviderOption stores the provider's option data.
type Response ¶
type Response struct {
Body io.ReadCloser
}
Response stores the response obtained after a client request.
type TransferStat ¶
type TransferStat struct { Name string `json:"name"` Size int64 `json:"size"` Bytes int64 `json:"bytes,omitempty"` Eta int64 `json:"eta,omitempty"` Group string `json:"group,omitempty"` Percentage int64 `json:"percentage,omitempty"` Speed float64 `json:"speed,omitempty"` SpeedAvg float64 `json:"speedAvg,omitempty"` }
TransferStat stores the file transfer stats.