this repo has no description
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

update lrc.proto and generate go

+130 -116
+119 -105
gen/go/lrc.pb.go
··· 369 369 370 370 type Init struct { 371 371 state protoimpl.MessageState `protogen:"open.v1"` 372 - Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` 373 - Nick string `protobuf:"bytes,2,opt,name=nick,proto3" json:"nick,omitempty"` 374 - ExternalID string `protobuf:"bytes,3,opt,name=externalID,proto3" json:"externalID,omitempty"` 375 - Color uint32 `protobuf:"varint,4,opt,name=color,proto3" json:"color,omitempty"` 376 - Echoed bool `protobuf:"varint,5,opt,name=echoed,proto3" json:"echoed,omitempty"` 372 + Id *uint32 `protobuf:"varint,1,opt,name=id,proto3,oneof" json:"id,omitempty"` 373 + Nick *string `protobuf:"bytes,2,opt,name=nick,proto3,oneof" json:"nick,omitempty"` 374 + ExternalID *string `protobuf:"bytes,3,opt,name=externalID,proto3,oneof" json:"externalID,omitempty"` 375 + Color *uint32 `protobuf:"varint,4,opt,name=color,proto3,oneof" json:"color,omitempty"` 376 + Echoed *bool `protobuf:"varint,5,opt,name=echoed,proto3,oneof" json:"echoed,omitempty"` 377 377 unknownFields protoimpl.UnknownFields 378 378 sizeCache protoimpl.SizeCache 379 379 } ··· 409 409 } 410 410 411 411 func (x *Init) GetId() uint32 { 412 - if x != nil { 413 - return x.Id 412 + if x != nil && x.Id != nil { 413 + return *x.Id 414 414 } 415 415 return 0 416 416 } 417 417 418 418 func (x *Init) GetNick() string { 419 - if x != nil { 420 - return x.Nick 419 + if x != nil && x.Nick != nil { 420 + return *x.Nick 421 421 } 422 422 return "" 423 423 } 424 424 425 425 func (x *Init) GetExternalID() string { 426 - if x != nil { 427 - return x.ExternalID 426 + if x != nil && x.ExternalID != nil { 427 + return *x.ExternalID 428 428 } 429 429 return "" 430 430 } 431 431 432 432 func (x *Init) GetColor() uint32 { 433 - if x != nil { 434 - return x.Color 433 + if x != nil && x.Color != nil { 434 + return *x.Color 435 435 } 436 436 return 0 437 437 } 438 438 439 439 func (x *Init) GetEchoed() bool { 440 - if x != nil { 441 - return x.Echoed 440 + if x != nil && x.Echoed != nil { 441 + return *x.Echoed 442 442 } 443 443 return false 444 444 } ··· 489 489 490 490 type Insert struct { 491 491 state protoimpl.MessageState `protogen:"open.v1"` 492 - Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` 492 + Id *uint32 `protobuf:"varint,1,opt,name=id,proto3,oneof" json:"id,omitempty"` 493 493 Body string `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"` 494 - ByteIndex uint32 `protobuf:"varint,3,opt,name=byteIndex,proto3" json:"byteIndex,omitempty"` 494 + Utf16Index uint32 `protobuf:"varint,3,opt,name=utf16Index,proto3" json:"utf16Index,omitempty"` 495 495 unknownFields protoimpl.UnknownFields 496 496 sizeCache protoimpl.SizeCache 497 497 } ··· 527 527 } 528 528 529 529 func (x *Insert) GetId() uint32 { 530 - if x != nil { 531 - return x.Id 530 + if x != nil && x.Id != nil { 531 + return *x.Id 532 532 } 533 533 return 0 534 534 } ··· 540 540 return "" 541 541 } 542 542 543 - func (x *Insert) GetByteIndex() uint32 { 543 + func (x *Insert) GetUtf16Index() uint32 { 544 544 if x != nil { 545 - return x.ByteIndex 545 + return x.Utf16Index 546 546 } 547 547 return 0 548 548 } 549 549 550 550 type Delete struct { 551 551 state protoimpl.MessageState `protogen:"open.v1"` 552 - Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` 553 - ByteStart uint32 `protobuf:"varint,2,opt,name=byteStart,proto3" json:"byteStart,omitempty"` 554 - ByteEnd uint32 `protobuf:"varint,3,opt,name=byteEnd,proto3" json:"byteEnd,omitempty"` 552 + Id *uint32 `protobuf:"varint,1,opt,name=id,proto3,oneof" json:"id,omitempty"` 553 + Utf16Start uint32 `protobuf:"varint,2,opt,name=utf16Start,proto3" json:"utf16Start,omitempty"` 554 + Utf16End uint32 `protobuf:"varint,3,opt,name=utf16End,proto3" json:"utf16End,omitempty"` 555 555 unknownFields protoimpl.UnknownFields 556 556 sizeCache protoimpl.SizeCache 557 557 } ··· 587 587 } 588 588 589 589 func (x *Delete) GetId() uint32 { 590 - if x != nil { 591 - return x.Id 590 + if x != nil && x.Id != nil { 591 + return *x.Id 592 592 } 593 593 return 0 594 594 } 595 595 596 - func (x *Delete) GetByteStart() uint32 { 596 + func (x *Delete) GetUtf16Start() uint32 { 597 597 if x != nil { 598 - return x.ByteStart 598 + return x.Utf16Start 599 599 } 600 600 return 0 601 601 } 602 602 603 - func (x *Delete) GetByteEnd() uint32 { 603 + func (x *Delete) GetUtf16End() uint32 { 604 604 if x != nil { 605 - return x.ByteEnd 605 + return x.Utf16End 606 606 } 607 607 return 0 608 608 } ··· 1063 1063 1064 1064 const file_lrc_proto_rawDesc = "" + 1065 1065 "\n" + 1066 - "\tlrc.proto\"\xaa\x03\n" + 1067 - "\x05Event\x12\x1b\n" + 1068 - "\x04ping\x18\x01 \x01(\v2\x05.PingH\x00R\x04ping\x12\x1b\n" + 1069 - "\x04pong\x18\x02 \x01(\v2\x05.PongH\x00R\x04pong\x12\x1b\n" + 1070 - "\x04init\x18\x03 \x01(\v2\x05.InitH\x00R\x04init\x12\x18\n" + 1071 - "\x03pub\x18\x04 \x01(\v2\x04.PubH\x00R\x03pub\x12!\n" + 1072 - "\x06insert\x18\x05 \x01(\v2\a.InsertH\x00R\x06insert\x12!\n" + 1073 - "\x06delete\x18\x06 \x01(\v2\a.DeleteH\x00R\x06delete\x12\x1b\n" + 1074 - "\x04mute\x18\a \x01(\v2\x05.MuteH\x00R\x04mute\x12!\n" + 1075 - "\x06unmute\x18\b \x01(\v2\a.UnmuteH\x00R\x06unmute\x12\x18\n" + 1076 - "\x03set\x18\t \x01(\v2\x04.SetH\x00R\x03set\x12\x18\n" + 1066 + "\tlrc.proto\x12\x06lrc.v1\"\x8c\x04\n" + 1067 + "\x05Event\x12\"\n" + 1068 + "\x04ping\x18\x01 \x01(\v2\f.lrc.v1.PingH\x00R\x04ping\x12\"\n" + 1069 + "\x04pong\x18\x02 \x01(\v2\f.lrc.v1.PongH\x00R\x04pong\x12\"\n" + 1070 + "\x04init\x18\x03 \x01(\v2\f.lrc.v1.InitH\x00R\x04init\x12\x1f\n" + 1071 + "\x03pub\x18\x04 \x01(\v2\v.lrc.v1.PubH\x00R\x03pub\x12(\n" + 1072 + "\x06insert\x18\x05 \x01(\v2\x0e.lrc.v1.InsertH\x00R\x06insert\x12(\n" + 1073 + "\x06delete\x18\x06 \x01(\v2\x0e.lrc.v1.DeleteH\x00R\x06delete\x12\"\n" + 1074 + "\x04mute\x18\a \x01(\v2\f.lrc.v1.MuteH\x00R\x04mute\x12(\n" + 1075 + "\x06unmute\x18\b \x01(\v2\x0e.lrc.v1.UnmuteH\x00R\x06unmute\x12\x1f\n" + 1076 + "\x03set\x18\t \x01(\v2\v.lrc.v1.SetH\x00R\x03set\x12\x1f\n" + 1077 1077 "\x03get\x18\n" + 1078 - " \x01(\v2\x04.GetH\x00R\x03get\x12\x1b\n" + 1079 - "\x04kick\x18\v \x01(\v2\x05.KickH\x00R\x04kick\x12\x18\n" + 1080 - "\x03hug\x18\f \x01(\v2\x04.HugH\x00R\x03hug\x12\x18\n" + 1081 - "\x03ban\x18\r \x01(\v2\x04.BanH\x00R\x03ban\x12\x1e\n" + 1082 - "\x05unban\x18\x0e \x01(\v2\x06.UnbanH\x00R\x05unbanB\x05\n" + 1078 + " \x01(\v2\v.lrc.v1.GetH\x00R\x03get\x12\"\n" + 1079 + "\x04kick\x18\v \x01(\v2\f.lrc.v1.KickH\x00R\x04kick\x12\x1f\n" + 1080 + "\x03hug\x18\f \x01(\v2\v.lrc.v1.HugH\x00R\x03hug\x12\x1f\n" + 1081 + "\x03ban\x18\r \x01(\v2\v.lrc.v1.BanH\x00R\x03ban\x12%\n" + 1082 + "\x05unban\x18\x0e \x01(\v2\r.lrc.v1.UnbanH\x00R\x05unbanB\x05\n" + 1083 1083 "\x03msg\"\x06\n" + 1084 1084 "\x04Ping\"\x06\n" + 1085 - "\x04Pong\"x\n" + 1086 - "\x04Init\x12\x0e\n" + 1087 - "\x02id\x18\x01 \x01(\rR\x02id\x12\x12\n" + 1088 - "\x04nick\x18\x02 \x01(\tR\x04nick\x12\x1e\n" + 1085 + "\x04Pong\"\xc5\x01\n" + 1086 + "\x04Init\x12\x13\n" + 1087 + "\x02id\x18\x01 \x01(\rH\x00R\x02id\x88\x01\x01\x12\x17\n" + 1088 + "\x04nick\x18\x02 \x01(\tH\x01R\x04nick\x88\x01\x01\x12#\n" + 1089 1089 "\n" + 1090 - "externalID\x18\x03 \x01(\tR\n" + 1091 - "externalID\x12\x14\n" + 1092 - "\x05color\x18\x04 \x01(\rR\x05color\x12\x16\n" + 1093 - "\x06echoed\x18\x05 \x01(\bR\x06echoed\"\x15\n" + 1090 + "externalID\x18\x03 \x01(\tH\x02R\n" + 1091 + "externalID\x88\x01\x01\x12\x19\n" + 1092 + "\x05color\x18\x04 \x01(\rH\x03R\x05color\x88\x01\x01\x12\x1b\n" + 1093 + "\x06echoed\x18\x05 \x01(\bH\x04R\x06echoed\x88\x01\x01B\x05\n" + 1094 + "\x03_idB\a\n" + 1095 + "\x05_nickB\r\n" + 1096 + "\v_externalIDB\b\n" + 1097 + "\x06_colorB\t\n" + 1098 + "\a_echoed\"\x15\n" + 1094 1099 "\x03Pub\x12\x0e\n" + 1095 - "\x02id\x18\x01 \x01(\rR\x02id\"J\n" + 1096 - "\x06Insert\x12\x0e\n" + 1097 - "\x02id\x18\x01 \x01(\rR\x02id\x12\x12\n" + 1098 - "\x04body\x18\x02 \x01(\tR\x04body\x12\x1c\n" + 1099 - "\tbyteIndex\x18\x03 \x01(\rR\tbyteIndex\"P\n" + 1100 - "\x06Delete\x12\x0e\n" + 1101 - "\x02id\x18\x01 \x01(\rR\x02id\x12\x1c\n" + 1102 - "\tbyteStart\x18\x02 \x01(\rR\tbyteStart\x12\x18\n" + 1103 - "\abyteEnd\x18\x03 \x01(\rR\abyteEnd\"\x16\n" + 1100 + "\x02id\x18\x01 \x01(\rR\x02id\"X\n" + 1101 + "\x06Insert\x12\x13\n" + 1102 + "\x02id\x18\x01 \x01(\rH\x00R\x02id\x88\x01\x01\x12\x12\n" + 1103 + "\x04body\x18\x02 \x01(\tR\x04body\x12\x1e\n" + 1104 + "\n" + 1105 + "utf16Index\x18\x03 \x01(\rR\n" + 1106 + "utf16IndexB\x05\n" + 1107 + "\x03_id\"`\n" + 1108 + "\x06Delete\x12\x13\n" + 1109 + "\x02id\x18\x01 \x01(\rH\x00R\x02id\x88\x01\x01\x12\x1e\n" + 1110 + "\n" + 1111 + "utf16Start\x18\x02 \x01(\rR\n" + 1112 + "utf16Start\x12\x1a\n" + 1113 + "\butf16End\x18\x03 \x01(\rR\butf16EndB\x05\n" + 1114 + "\x03_id\"\x16\n" + 1104 1115 "\x04Mute\x12\x0e\n" + 1105 1116 "\x02id\x18\x01 \x01(\rR\x02id\"\x18\n" + 1106 1117 "\x06Unmute\x12\x0e\n" + ··· 1124 1135 "\n" + 1125 1136 "externalID\x18\x01 \x01(\tR\n" + 1126 1137 "externalID\x12\x16\n" + 1127 - "\x06secret\x18\x02 \x01(\tR\x06secret\"=\n" + 1128 - "\x04Kick\x12%\n" + 1138 + "\x06secret\x18\x02 \x01(\tR\x06secret\"D\n" + 1139 + "\x04Kick\x12,\n" + 1129 1140 "\n" + 1130 - "privileges\x18\x01 \x01(\v2\x05.SudoR\n" + 1141 + "privileges\x18\x01 \x01(\v2\f.lrc.v1.SudoR\n" + 1131 1142 "privileges\x12\x0e\n" + 1132 1143 "\x02id\x18\x02 \x01(\rR\x02id\"\x15\n" + 1133 1144 "\x03Hug\x12\x0e\n" + 1134 - "\x02id\x18\x01 \x01(\rR\x02id\"<\n" + 1135 - "\x03Ban\x12%\n" + 1145 + "\x02id\x18\x01 \x01(\rR\x02id\"C\n" + 1146 + "\x03Ban\x12,\n" + 1136 1147 "\n" + 1137 - "privileges\x18\x01 \x01(\v2\x05.SudoR\n" + 1148 + "privileges\x18\x01 \x01(\v2\f.lrc.v1.SudoR\n" + 1138 1149 "privileges\x12\x0e\n" + 1139 - "\x02id\x18\x02 \x01(\rR\x02id\">\n" + 1140 - "\x05Unban\x12%\n" + 1150 + "\x02id\x18\x02 \x01(\rR\x02id\"E\n" + 1151 + "\x05Unban\x12,\n" + 1141 1152 "\n" + 1142 - "privileges\x18\x01 \x01(\v2\x05.SudoR\n" + 1153 + "privileges\x18\x01 \x01(\v2\f.lrc.v1.SudoR\n" + 1143 1154 "privileges\x12\x0e\n" + 1144 1155 "\x02id\x18\x02 \x01(\rR\x02idB3Z1github.com/rachel-mp4/lrcproto/gen/go/lrcpb;lrcpbb\x06proto3" 1145 1156 ··· 1157 1168 1158 1169 var file_lrc_proto_msgTypes = make([]protoimpl.MessageInfo, 16) 1159 1170 var file_lrc_proto_goTypes = []any{ 1160 - (*Event)(nil), // 0: Event 1161 - (*Ping)(nil), // 1: Ping 1162 - (*Pong)(nil), // 2: Pong 1163 - (*Init)(nil), // 3: Init 1164 - (*Pub)(nil), // 4: Pub 1165 - (*Insert)(nil), // 5: Insert 1166 - (*Delete)(nil), // 6: Delete 1167 - (*Mute)(nil), // 7: Mute 1168 - (*Unmute)(nil), // 8: Unmute 1169 - (*Set)(nil), // 9: Set 1170 - (*Get)(nil), // 10: Get 1171 - (*Sudo)(nil), // 11: Sudo 1172 - (*Kick)(nil), // 12: Kick 1173 - (*Hug)(nil), // 13: Hug 1174 - (*Ban)(nil), // 14: Ban 1175 - (*Unban)(nil), // 15: Unban 1171 + (*Event)(nil), // 0: lrc.v1.Event 1172 + (*Ping)(nil), // 1: lrc.v1.Ping 1173 + (*Pong)(nil), // 2: lrc.v1.Pong 1174 + (*Init)(nil), // 3: lrc.v1.Init 1175 + (*Pub)(nil), // 4: lrc.v1.Pub 1176 + (*Insert)(nil), // 5: lrc.v1.Insert 1177 + (*Delete)(nil), // 6: lrc.v1.Delete 1178 + (*Mute)(nil), // 7: lrc.v1.Mute 1179 + (*Unmute)(nil), // 8: lrc.v1.Unmute 1180 + (*Set)(nil), // 9: lrc.v1.Set 1181 + (*Get)(nil), // 10: lrc.v1.Get 1182 + (*Sudo)(nil), // 11: lrc.v1.Sudo 1183 + (*Kick)(nil), // 12: lrc.v1.Kick 1184 + (*Hug)(nil), // 13: lrc.v1.Hug 1185 + (*Ban)(nil), // 14: lrc.v1.Ban 1186 + (*Unban)(nil), // 15: lrc.v1.Unban 1176 1187 } 1177 1188 var file_lrc_proto_depIdxs = []int32{ 1178 - 1, // 0: Event.ping:type_name -> Ping 1179 - 2, // 1: Event.pong:type_name -> Pong 1180 - 3, // 2: Event.init:type_name -> Init 1181 - 4, // 3: Event.pub:type_name -> Pub 1182 - 5, // 4: Event.insert:type_name -> Insert 1183 - 6, // 5: Event.delete:type_name -> Delete 1184 - 7, // 6: Event.mute:type_name -> Mute 1185 - 8, // 7: Event.unmute:type_name -> Unmute 1186 - 9, // 8: Event.set:type_name -> Set 1187 - 10, // 9: Event.get:type_name -> Get 1188 - 12, // 10: Event.kick:type_name -> Kick 1189 - 13, // 11: Event.hug:type_name -> Hug 1190 - 14, // 12: Event.ban:type_name -> Ban 1191 - 15, // 13: Event.unban:type_name -> Unban 1192 - 11, // 14: Kick.privileges:type_name -> Sudo 1193 - 11, // 15: Ban.privileges:type_name -> Sudo 1194 - 11, // 16: Unban.privileges:type_name -> Sudo 1189 + 1, // 0: lrc.v1.Event.ping:type_name -> lrc.v1.Ping 1190 + 2, // 1: lrc.v1.Event.pong:type_name -> lrc.v1.Pong 1191 + 3, // 2: lrc.v1.Event.init:type_name -> lrc.v1.Init 1192 + 4, // 3: lrc.v1.Event.pub:type_name -> lrc.v1.Pub 1193 + 5, // 4: lrc.v1.Event.insert:type_name -> lrc.v1.Insert 1194 + 6, // 5: lrc.v1.Event.delete:type_name -> lrc.v1.Delete 1195 + 7, // 6: lrc.v1.Event.mute:type_name -> lrc.v1.Mute 1196 + 8, // 7: lrc.v1.Event.unmute:type_name -> lrc.v1.Unmute 1197 + 9, // 8: lrc.v1.Event.set:type_name -> lrc.v1.Set 1198 + 10, // 9: lrc.v1.Event.get:type_name -> lrc.v1.Get 1199 + 12, // 10: lrc.v1.Event.kick:type_name -> lrc.v1.Kick 1200 + 13, // 11: lrc.v1.Event.hug:type_name -> lrc.v1.Hug 1201 + 14, // 12: lrc.v1.Event.ban:type_name -> lrc.v1.Ban 1202 + 15, // 13: lrc.v1.Event.unban:type_name -> lrc.v1.Unban 1203 + 11, // 14: lrc.v1.Kick.privileges:type_name -> lrc.v1.Sudo 1204 + 11, // 15: lrc.v1.Ban.privileges:type_name -> lrc.v1.Sudo 1205 + 11, // 16: lrc.v1.Unban.privileges:type_name -> lrc.v1.Sudo 1195 1206 17, // [17:17] is the sub-list for method output_type 1196 1207 17, // [17:17] is the sub-list for method input_type 1197 1208 17, // [17:17] is the sub-list for extension type_name ··· 1220 1231 (*Event_Ban)(nil), 1221 1232 (*Event_Unban)(nil), 1222 1233 } 1234 + file_lrc_proto_msgTypes[3].OneofWrappers = []any{} 1235 + file_lrc_proto_msgTypes[5].OneofWrappers = []any{} 1236 + file_lrc_proto_msgTypes[6].OneofWrappers = []any{} 1223 1237 file_lrc_proto_msgTypes[9].OneofWrappers = []any{} 1224 1238 file_lrc_proto_msgTypes[10].OneofWrappers = []any{} 1225 1239 type x struct{}
+11 -11
lrc.proto
··· 1 1 syntax = "proto3"; 2 - 2 + package lrc.v1; 3 3 option go_package = "github.com/rachel-mp4/lrcproto/gen/go/lrcpb;lrcpb"; 4 4 5 5 message Event { ··· 26 26 message Pong {} 27 27 28 28 message Init { 29 - uint32 id = 1; 30 - string nick = 2; 31 - string externalID = 3; 32 - uint32 color = 4; 33 - bool echoed = 5; 29 + optional uint32 id = 1; 30 + optional string nick = 2; 31 + optional string externalID = 3; 32 + optional uint32 color = 4; 33 + optional bool echoed = 5; 34 34 } 35 35 36 36 message Pub { uint32 id = 1; } 37 37 38 38 message Insert { 39 - uint32 id = 1; 39 + optional uint32 id = 1; 40 40 string body = 2; 41 - uint32 byteIndex = 3; 41 + uint32 utf16Index = 3; 42 42 } 43 43 44 44 message Delete { 45 - uint32 id = 1; 46 - uint32 byteStart = 2; 47 - uint32 byteEnd = 3; 45 + optional uint32 id = 1; 46 + uint32 utf16Start = 2; 47 + uint32 utf16End = 3; 48 48 } 49 49 50 50 message Mute { uint32 id = 1; }