-
Notifications
You must be signed in to change notification settings - Fork 8
/
websocket.go
28 lines (24 loc) · 934 Bytes
/
websocket.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
package types
import "encoding/json"
// WebsocketRequest defines a request sent over the websocket connection
type WebsocketRequest struct {
Command string `json:"command"`
Ack bool `json:"ack"`
Origin string `json:"origin"`
Destination string `json:"destination"`
RequestID string `json:"request_id"`
Data interface{} `json:"data"`
}
// WebsocketResponse defines the response structure received over the websocket connection
type WebsocketResponse struct {
Command string `json:"command"`
Ack bool `json:"ack"`
Origin string `json:"origin"`
Destination string `json:"destination"`
RequestID string `json:"request_id"`
Data json.RawMessage `json:"data"`
}
// WebsocketSubscription is the Data for a new subscribe request
type WebsocketSubscription struct {
Service string `json:"service"`
}