Documentation ¶
Overview ¶
Package ydisk implements API for yandex-disk daemon. Logging is organized via github.com/slytomcat/llog package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type YDisk ¶
type YDisk struct { Path string // Path to synchronized folder (obtained from yandex-disk conf. file) Changes chan YDvals // Output channel for detected changes in daemon status // contains filtered or unexported fields }
YDisk provides methods to interact with yandex-disk (methods: Start, Stop, Output), path of synchronized catalogue (property Path) and channel for receiving yandex-disk status changes (property Changes).
func NewYDisk ¶
NewYDisk creates new YDisk structure for communication with yandex-disk daemon Parameter:
conf - full path to yandex-disk daemon configuration file
Checks performed in the beginning:
- check that yandex-disk was installed
- check that yandex-disk was properly configured
When something not good NewYDisk returns not nil error
func (*YDisk) Close ¶
func (yd *YDisk) Close()
Close deactivates the daemon connection: stops event handler that closes file watcher and Changes channel.
func (*YDisk) Output ¶
Output returns the output string of `yandex-disk status` command in the current user language.
type YDvals ¶
type YDvals struct { Stat string // Current Status Prev string // Previous Status Total string // Total space available Used string // Used space Free string // Free space Trash string // Trash size Last []string // Last-updated files/folders list (10 or less items) ChLast bool // Indicator that Last was changed Err string // Error status message ErrP string // Error path Prog string // Synchronization progress (when in busy status) }
YDvals - Daemon Status structure