diff options
Diffstat (limited to 'lib/xsapiv1/events.go')
-rw-r--r-- | lib/xsapiv1/events.go | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/xsapiv1/events.go b/lib/xsapiv1/events.go new file mode 100644 index 0000000..1304b3a --- /dev/null +++ b/lib/xsapiv1/events.go @@ -0,0 +1,31 @@ +package xsapiv1 + +// EventRegisterArgs Parameters (json format) of /events/register command +type EventRegisterArgs struct { + Name string `json:"name"` + ProjectID string `json:"filterProjectID"` +} + +// EventUnRegisterArgs Parameters of /events/unregister command +type EventUnRegisterArgs struct { + Name string `json:"name"` + ID int `json:"id"` +} + +// EventMsg Message send +type EventMsg struct { + Time string `json:"time"` + Type string `json:"type"` + Folder FolderConfig `json:"folder"` +} + +// EventEvent Event send in WS when an internal event (eg. Syncthing event is received) +const ( + // EventTypePrefix Used as event prefix + EventTypePrefix = "event:" // following by event type + + // Supported Events type + EVTAll = EventTypePrefix + "all" + EVTFolderChange = EventTypePrefix + "folder-change" // type EventMsg with Data type xsapiv1.??? + EVTFolderStateChange = EventTypePrefix + "folder-state-change" // type EventMsg with Data type xsapiv1.??? +) |