comparison socket/types.go @ 8:e9df3bb010f4

fix issues
author Dennis C. M. <dennis@denniscm.com>
date Thu, 13 Mar 2025 17:41:42 +0000
parents
children aaf85ae1f942
comparison
equal deleted inserted replaced
7:a8aab75f68c9 8:e9df3bb010f4
1 package socket
2
3 type Res_Metadata struct {
4 Metadata Metadata `json:"metadata"`
5 }
6
7 type Res_Metadata_Notif struct {
8 Metadata Metadata_Notif `json:"metadata"`
9 }
10
11 type Res_Welcome struct {
12 Metadata Metadata `json:"metadata"`
13 Payload Payload_Welcome `json:"payload"`
14 }
15
16 type Res_Keepalive struct {
17 Metadata Metadata `json:"metadata"`
18 Payload Payload_Keepalive `json:"payload"`
19 }
20
21 type Res_Notif_ChannelChatMsg struct {
22 Metadata Metadata_Notif `json:"metadata,omitempty"`
23 Payload Payload_Notif_ChannelChatMsg `json:"payload,omitempty"`
24 }
25
26 type Metadata struct {
27 MsgId string `json:"message_id"`
28 MsgType string `json:"message_type"`
29 MsgTimestamp string `json:"message_timestamp"`
30 }
31
32 type Metadata_Notif struct {
33 Metadata
34 SubType string `json:"subscription_type"`
35 SubVersion string `json:"subscription_version"`
36 }
37
38 type Payload_Welcome struct {
39 Session struct {
40 Id string `json:"id"`
41 Status string `json:"status"`
42 ConnectedAt string `json:"connected_at"`
43 KeepaliveTimeout int `json:"keepalive_timeout_seconds"`
44 } `json:"session"`
45 }
46
47 type Payload_Keepalive struct {
48 }
49
50 type Payload_Notif_ChannelChatMsg struct {
51 Subscription Payload_Sub_Notif_ChannelChatMsg `json:"subscription"`
52 Event Payload_Event_Notif_ChannelChatMsg `json:"event"`
53 }
54
55 type Payload_Sub_Notif struct {
56 Id string `json:"id"`
57 Status string `json:"status"`
58 Type string `json:"type"`
59 Version string `json:"version"`
60 Cost int `json:"cost"`
61
62 Transport struct {
63 Method string `json:"method"`
64 SessionId string `json:"session_id"`
65 } `json:"transport"`
66
67 CreatedAt string `json:"created_at"`
68 }
69
70 type Payload_Sub_Notif_ChannelChatMsg struct {
71 Payload_Sub_Notif
72
73 Condition struct {
74 BroadcasterUserId string `json:"broadcaster_user_id"`
75 UserId string `json:"user_id"`
76 } `json:"condition"`
77 }
78
79 type Payload_Event_Notif_ChannelChatMsg struct {
80 BroadcasterUserId string `json:"broadcaster_user_id"`
81 BroadcasterUserLogin string `json:"broadcaster_user_login"`
82 BroadcasterUserName string `json:"broadcaster_user_name"`
83 ChatterUserId string `json:"chatter_user_id"`
84 ChatterUserLogin string `json:"chatter_user_login"`
85 ChatterUserName string `json:"chatter_user_name"`
86 MsgId string `json:"message_id"`
87
88 Msg struct {
89 Text string `json:"text"`
90
91 Fragments []struct {
92 Type string `json:"type"`
93 Text string `json:"text"`
94 Cheermote string `json:"cheermote"`
95 Emote string `json:"emote"`
96 Mention string `json:"mention"`
97 } `json:"fragments"`
98 } `json:"message"`
99
100 Color string `json:"color"`
101
102 Badges []struct {
103 SetId string `json:"set_id"`
104 Id string `json:"id"`
105 Info string `json:"info"`
106 } `json:"badges"`
107
108 MsgType string `json:"message_type"`
109 Cheer string `json:"cheer"`
110 Reply string `json:"reply"`
111 ChannelPointsCustomRewardId string `json:"channel_points_custom_reward_id"`
112 SourceBroadcasterUserId string `json:"source_broadcaster_user_id"`
113 SourceBroadcasterUserLogin string `json:"source_broadcaster_user_login"`
114 SourceBroadcasterUserName string `json:"source_broadcaster_user_name"`
115 SourceMessageId string `json:"source_message_id"`
116 SourceBadges string `json:"source_badges"`
117 }