-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathresponses.go
107 lines (92 loc) · 2.61 KB
/
responses.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
106
107
package sdnclient
// RespError is the standard JSON error response from SDN node servers
type RespError struct {
ErrCode string `json:"errcode"`
Err string `json:"error"`
}
// Error returns the errcode and error message.
func (e RespError) Error() string {
return e.ErrCode + ": " + e.Err
}
// RespJoinRoom is the JSON response for JoinRoom
type RespJoinRoom struct {
RoomID string `json:"room_id"`
}
// RespLeaveRoom is the JSON response for LeaveRoom
type RespLeaveRoom struct{}
// RespInviteUser is the JSON response for InviteUser
type RespInviteUser struct{}
// RespKickUser is the JSON response for KickUser
type RespKickUser struct{}
// RespJoinedRooms is the JSON response for JoinedRooms
type RespJoinedRooms struct {
JoinedRooms []string `json:"joined_rooms"`
}
// RespJoinedMembers is the JSON response for JoinedMembers
type RespJoinedMembers struct {
Joined map[string]struct {
DisplayName string `json:"display_name"`
AvatarURL string `json:"avatar_url"`
} `json:"joined"`
}
// RespSendEvent is the JSON response for SendEvent
type RespSendEvent struct {
EventID string `json:"event_id"`
}
// RespLogout is the JSON response for Logout
type RespLogout struct{}
// RespCreateRoom is the JSON response for CreateRoom
type RespCreateRoom struct {
RoomID string `json:"room_id"`
}
// RespUserDisplayName is the JSON response for GetDisplayName
type RespUserDisplayName struct {
DisplayName string `json:"displayname"`
}
type RespCreateFilter struct {
FilterID string `json:"filter_id"`
}
// RespSync is the JSON response for sync
type RespSync struct {
NextBatch string `json:"next_batch"`
AccountData struct {
Events []Event `json:"events"`
} `json:"account_data"`
Presence struct {
Events []Event `json:"events"`
} `json:"presence"`
Rooms struct {
Leave map[string]struct {
State struct {
Events []Event `json:"events"`
} `json:"state"`
Timeline struct {
Events []Event `json:"events"`
Limited bool `json:"limited"`
PrevBatch string `json:"prev_batch"`
} `json:"timeline"`
} `json:"leave"`
Join map[string]struct {
State struct {
Events []Event `json:"events"`
} `json:"state"`
Timeline struct {
Events []Event `json:"events"`
Limited bool `json:"limited"`
PrevBatch string `json:"prev_batch"`
} `json:"timeline"`
Ephemeral struct {
Events []Event `json:"events"`
} `json:"ephemeral"`
} `json:"join"`
Invite map[string]struct {
State struct {
Events []Event
} `json:"invite_state"`
} `json:"invite"`
} `json:"rooms"`
}
type ChildRoomInfo struct {
RoomID string `json:"room_id"`
Name string `json:"name"`
}