-
Notifications
You must be signed in to change notification settings - Fork 0
/
socket.go
71 lines (59 loc) · 1.81 KB
/
socket.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
package convoy_cli
import (
"encoding/json"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type ListenRequest struct {
HostName string `json:"host_name"`
ProjectID string `json:"project_id"`
DeviceID string `json:"device_id"`
SourceName string `json:"source_name"`
Since string `json:"-"`
ForwardTo string `json:"-"`
// EventTypes []string `json:"event_types"`
}
type LoginRequest struct {
HostName string `json:"host_name"`
DeviceID string `json:"device_id"`
}
type LoginResponse struct {
Projects []ProjectDevice `json:"projects"`
UserName string `json:"user_name"`
//Device *Device `json:"device"`
//Project *Project `json:"project"`
//Endpoint *Endpoint `json:"endpoint"`
}
type ProjectDevice struct {
Project *Project `json:"project"`
Device *Device `json:"device"`
}
type Device struct {
UID string `json:"uid"`
ProjectID string `json:"project_id,omitempty"`
EndpointID string `json:"endpoint_id,omitempty"`
HostName string `json:"host_name,omitempty"`
Status string `json:"status,omitempty"`
LastSeenAt primitive.DateTime `json:"last_seen_at,omitempty"`
}
type Project struct {
UID string `json:"uid"`
Name string `json:"name"`
OrganisationID string `json:"organisation_id"`
Type string `json:"type"`
}
type Endpoint struct {
UID string `json:"uid"`
ProjectID string `json:"project_id"`
OwnerID string `json:"owner_id,omitempty"`
TargetURL string `json:"target_url"`
Title string `json:"title"`
Description string `json:"description"`
}
type AckEventDelivery struct {
UID string `json:"uid"`
}
type CLIEvent struct {
UID string `json:"uid"`
Headers map[string][]string `json:"headers"`
Data json.RawMessage `json:"data"`
}