summaryrefslogtreecommitdiffstats
path: root/lib/xsapiv1/events.go
blob: 1304b3aa47555db6d56539f9922d237e3b00e3be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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.???
)