diff options
author | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2017-11-29 08:54:00 +0100 |
---|---|---|
committer | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2017-11-29 11:10:30 +0100 |
commit | 2f7828d01f4c4ca2909f95f098627cd5475ed225 (patch) | |
tree | b5e71920b813b95cae3e32044be08b99223348ec /lib/xsapiv1/events.go | |
parent | 5caebfb4b7c3b73988f067082b219ce5b7f409ba (diff) |
Refit source files to have a public xs-apiv1 lib package.
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
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.??? +) |