/
model.go
105 lines (84 loc) · 1.75 KB
/
model.go
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
package sdk
import "github.com/valyala/fastjson"
// Sent on socket open to identify the plugin/register it
type openMessage struct {
Event string `json:"event"`
UUID string `json:"uuid"`
}
// Sent to the Stream Deck software as a generic event
type sentEvent struct {
Event string `json:"event"`
Context string `json:"context,omitempty"`
Payload interface{} `json:"payload"`
}
// Payloads for sent events
type openUrlPayload struct {
URL string `json:"url"`
}
type logMessagePayload struct {
Message string `json:"message"`
}
type setTitlePayload struct {
Title string `json:"title"`
Target int `json:"target"`
}
type setStatePayload struct {
State int `json:"state"`
}
type setImagePayload struct {
Image string `json:"image"`
Target int `json:"target"`
}
// Events
type KeyDownEvent struct {
Action string
Context string
Payload *fastjson.Value
DeviceId string
}
type KeyUpEvent struct {
Action string
Context string
Payload *fastjson.Value
DeviceId string
}
type WillAppearEvent struct {
Action string
Context string
Payload *fastjson.Value
DeviceId string
}
type WillDisappearEvent struct {
Action string
Context string
Payload *fastjson.Value
DeviceId string
}
type DeviceConnectEvent struct {
DeviceId string
Info *fastjson.Value
}
type DeviceDisconnectEvent struct {
DeviceId string
}
type SendToPluginEvent struct {
Action string
Context string
Payload *fastjson.Value
DeviceId string
}
type ReceiveSettingsEvent struct {
Action string
Context string
DeviceId string
Settings *fastjson.Value
}
type GlobalSettingsEvent struct {
Settings *fastjson.Value
}
type ApplicationLaunchEvent struct {
Application string
}
type ApplicationTerminateEvent struct {
Application string
}