demo.pb.go 54 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212
  1. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  2. // source: demo.proto
  3. package v1
  4. import proto "github.com/gogo/protobuf/proto"
  5. import fmt "fmt"
  6. import math "math"
  7. import _ "github.com/gogo/protobuf/gogoproto"
  8. import _ "google.golang.org/genproto/googleapis/api/annotations"
  9. import (
  10. context "golang.org/x/net/context"
  11. grpc "google.golang.org/grpc"
  12. )
  13. import encoding_binary "encoding/binary"
  14. import io "io"
  15. // Reference imports to suppress errors if they are not otherwise used.
  16. var _ = proto.Marshal
  17. var _ = fmt.Errorf
  18. var _ = math.Inf
  19. // This is a compile-time assertion to ensure that this generated file
  20. // is compatible with the proto package it is being compiled against.
  21. // A compilation error at this line likely means your copy of the
  22. // proto package needs to be updated.
  23. const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
  24. // Bar请求
  25. type Bar1Req struct {
  26. // 用户uid
  27. //
  28. // aaa
  29. Uid int32 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty" form:"uid"`
  30. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  31. XXX_unrecognized []byte `json:"-"`
  32. XXX_sizecache int32 `json:"-"`
  33. }
  34. func (m *Bar1Req) Reset() { *m = Bar1Req{} }
  35. func (m *Bar1Req) String() string { return proto.CompactTextString(m) }
  36. func (*Bar1Req) ProtoMessage() {}
  37. func (*Bar1Req) Descriptor() ([]byte, []int) {
  38. return fileDescriptor_demo_4b2170f3d67b04fe, []int{0}
  39. }
  40. func (m *Bar1Req) XXX_Unmarshal(b []byte) error {
  41. return m.Unmarshal(b)
  42. }
  43. func (m *Bar1Req) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  44. if deterministic {
  45. return xxx_messageInfo_Bar1Req.Marshal(b, m, deterministic)
  46. } else {
  47. b = b[:cap(b)]
  48. n, err := m.MarshalTo(b)
  49. if err != nil {
  50. return nil, err
  51. }
  52. return b[:n], nil
  53. }
  54. }
  55. func (dst *Bar1Req) XXX_Merge(src proto.Message) {
  56. xxx_messageInfo_Bar1Req.Merge(dst, src)
  57. }
  58. func (m *Bar1Req) XXX_Size() int {
  59. return m.Size()
  60. }
  61. func (m *Bar1Req) XXX_DiscardUnknown() {
  62. xxx_messageInfo_Bar1Req.DiscardUnknown(m)
  63. }
  64. var xxx_messageInfo_Bar1Req proto.InternalMessageInfo
  65. func (m *Bar1Req) GetUid() int32 {
  66. if m != nil {
  67. return m.Uid
  68. }
  69. return 0
  70. }
  71. // Bar 相应
  72. type Bar1Resp struct {
  73. // 用户名
  74. // `mock:"hello"`
  75. Uname string `protobuf:"bytes,2,opt,name=uname,proto3" json:"uname"`
  76. // idshaha
  77. // `mock:"343242"`
  78. Ids []int32 `protobuf:"varint,3,rep,packed,name=ids" json:"ids"`
  79. List []*Bar1Resp_List `protobuf:"bytes,4,rep,name=list" json:"list"`
  80. Alist *Bar1Resp_List `protobuf:"bytes,5,opt,name=alist" json:"alist"`
  81. Amap map[string]*Bar1Resp_List `protobuf:"bytes,6,rep,name=amap" json:"amap" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value"`
  82. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  83. XXX_unrecognized []byte `json:"-"`
  84. XXX_sizecache int32 `json:"-"`
  85. }
  86. func (m *Bar1Resp) Reset() { *m = Bar1Resp{} }
  87. func (m *Bar1Resp) String() string { return proto.CompactTextString(m) }
  88. func (*Bar1Resp) ProtoMessage() {}
  89. func (*Bar1Resp) Descriptor() ([]byte, []int) {
  90. return fileDescriptor_demo_4b2170f3d67b04fe, []int{1}
  91. }
  92. func (m *Bar1Resp) XXX_Unmarshal(b []byte) error {
  93. return m.Unmarshal(b)
  94. }
  95. func (m *Bar1Resp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  96. if deterministic {
  97. return xxx_messageInfo_Bar1Resp.Marshal(b, m, deterministic)
  98. } else {
  99. b = b[:cap(b)]
  100. n, err := m.MarshalTo(b)
  101. if err != nil {
  102. return nil, err
  103. }
  104. return b[:n], nil
  105. }
  106. }
  107. func (dst *Bar1Resp) XXX_Merge(src proto.Message) {
  108. xxx_messageInfo_Bar1Resp.Merge(dst, src)
  109. }
  110. func (m *Bar1Resp) XXX_Size() int {
  111. return m.Size()
  112. }
  113. func (m *Bar1Resp) XXX_DiscardUnknown() {
  114. xxx_messageInfo_Bar1Resp.DiscardUnknown(m)
  115. }
  116. var xxx_messageInfo_Bar1Resp proto.InternalMessageInfo
  117. func (m *Bar1Resp) GetUname() string {
  118. if m != nil {
  119. return m.Uname
  120. }
  121. return ""
  122. }
  123. func (m *Bar1Resp) GetIds() []int32 {
  124. if m != nil {
  125. return m.Ids
  126. }
  127. return nil
  128. }
  129. func (m *Bar1Resp) GetList() []*Bar1Resp_List {
  130. if m != nil {
  131. return m.List
  132. }
  133. return nil
  134. }
  135. func (m *Bar1Resp) GetAlist() *Bar1Resp_List {
  136. if m != nil {
  137. return m.Alist
  138. }
  139. return nil
  140. }
  141. func (m *Bar1Resp) GetAmap() map[string]*Bar1Resp_List {
  142. if m != nil {
  143. return m.Amap
  144. }
  145. return nil
  146. }
  147. type Bar1Resp_List struct {
  148. // `mock:"\"withquote"`
  149. Hello string `protobuf:"bytes,1,opt,name=hello,proto3" json:"hello"`
  150. World string `protobuf:"bytes,2,opt,name=world,proto3" json:"world"`
  151. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  152. XXX_unrecognized []byte `json:"-"`
  153. XXX_sizecache int32 `json:"-"`
  154. }
  155. func (m *Bar1Resp_List) Reset() { *m = Bar1Resp_List{} }
  156. func (m *Bar1Resp_List) String() string { return proto.CompactTextString(m) }
  157. func (*Bar1Resp_List) ProtoMessage() {}
  158. func (*Bar1Resp_List) Descriptor() ([]byte, []int) {
  159. return fileDescriptor_demo_4b2170f3d67b04fe, []int{1, 0}
  160. }
  161. func (m *Bar1Resp_List) XXX_Unmarshal(b []byte) error {
  162. return m.Unmarshal(b)
  163. }
  164. func (m *Bar1Resp_List) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  165. if deterministic {
  166. return xxx_messageInfo_Bar1Resp_List.Marshal(b, m, deterministic)
  167. } else {
  168. b = b[:cap(b)]
  169. n, err := m.MarshalTo(b)
  170. if err != nil {
  171. return nil, err
  172. }
  173. return b[:n], nil
  174. }
  175. }
  176. func (dst *Bar1Resp_List) XXX_Merge(src proto.Message) {
  177. xxx_messageInfo_Bar1Resp_List.Merge(dst, src)
  178. }
  179. func (m *Bar1Resp_List) XXX_Size() int {
  180. return m.Size()
  181. }
  182. func (m *Bar1Resp_List) XXX_DiscardUnknown() {
  183. xxx_messageInfo_Bar1Resp_List.DiscardUnknown(m)
  184. }
  185. var xxx_messageInfo_Bar1Resp_List proto.InternalMessageInfo
  186. func (m *Bar1Resp_List) GetHello() string {
  187. if m != nil {
  188. return m.Hello
  189. }
  190. return ""
  191. }
  192. func (m *Bar1Resp_List) GetWorld() string {
  193. if m != nil {
  194. return m.World
  195. }
  196. return ""
  197. }
  198. // 获取房间信息请求
  199. type GetInfoReq struct {
  200. // 房间id
  201. // `mock:"123"
  202. RoomId int64 `protobuf:"varint,1,opt,name=room_id,json=roomId,proto3" json:"room_id,omitempty" form:"room_id" validate:"required"`
  203. ManyIds []int64 `protobuf:"varint,2,rep,packed,name=many_ids,json=manyIds" json:"many_ids,omitempty" form:"many_ids"`
  204. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  205. XXX_unrecognized []byte `json:"-"`
  206. XXX_sizecache int32 `json:"-"`
  207. }
  208. func (m *GetInfoReq) Reset() { *m = GetInfoReq{} }
  209. func (m *GetInfoReq) String() string { return proto.CompactTextString(m) }
  210. func (*GetInfoReq) ProtoMessage() {}
  211. func (*GetInfoReq) Descriptor() ([]byte, []int) {
  212. return fileDescriptor_demo_4b2170f3d67b04fe, []int{2}
  213. }
  214. func (m *GetInfoReq) XXX_Unmarshal(b []byte) error {
  215. return m.Unmarshal(b)
  216. }
  217. func (m *GetInfoReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  218. if deterministic {
  219. return xxx_messageInfo_GetInfoReq.Marshal(b, m, deterministic)
  220. } else {
  221. b = b[:cap(b)]
  222. n, err := m.MarshalTo(b)
  223. if err != nil {
  224. return nil, err
  225. }
  226. return b[:n], nil
  227. }
  228. }
  229. func (dst *GetInfoReq) XXX_Merge(src proto.Message) {
  230. xxx_messageInfo_GetInfoReq.Merge(dst, src)
  231. }
  232. func (m *GetInfoReq) XXX_Size() int {
  233. return m.Size()
  234. }
  235. func (m *GetInfoReq) XXX_DiscardUnknown() {
  236. xxx_messageInfo_GetInfoReq.DiscardUnknown(m)
  237. }
  238. var xxx_messageInfo_GetInfoReq proto.InternalMessageInfo
  239. func (m *GetInfoReq) GetRoomId() int64 {
  240. if m != nil {
  241. return m.RoomId
  242. }
  243. return 0
  244. }
  245. func (m *GetInfoReq) GetManyIds() []int64 {
  246. if m != nil {
  247. return m.ManyIds
  248. }
  249. return nil
  250. }
  251. // 获取房间信息响应
  252. type GetInfoResp struct {
  253. // 房间id 注释貌似只有放在前面才能被识别,放到字段声明后面是没用的
  254. Roomid int64 `protobuf:"varint,1,opt,name=roomid,proto3" json:"roomid"`
  255. // 用户名
  256. Uname string `protobuf:"bytes,2,opt,name=uname,proto3" json:"uname"`
  257. // 开播时间
  258. LiveTime string `protobuf:"bytes,3,opt,name=live_time,json=liveTime,proto3" json:"live_time"`
  259. Amap map[int32]string `protobuf:"bytes,4,rep,name=amap" json:"amap" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
  260. // `mock:"6.02214129e23"`
  261. Rate float32 `protobuf:"fixed32,5,opt,name=rate,proto3" json:"rate"`
  262. // 用户mid
  263. Mid int64 `protobuf:"varint,6,opt,name=mid,proto3" json:"mid"`
  264. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  265. XXX_unrecognized []byte `json:"-"`
  266. XXX_sizecache int32 `json:"-"`
  267. }
  268. func (m *GetInfoResp) Reset() { *m = GetInfoResp{} }
  269. func (m *GetInfoResp) String() string { return proto.CompactTextString(m) }
  270. func (*GetInfoResp) ProtoMessage() {}
  271. func (*GetInfoResp) Descriptor() ([]byte, []int) {
  272. return fileDescriptor_demo_4b2170f3d67b04fe, []int{3}
  273. }
  274. func (m *GetInfoResp) XXX_Unmarshal(b []byte) error {
  275. return m.Unmarshal(b)
  276. }
  277. func (m *GetInfoResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  278. if deterministic {
  279. return xxx_messageInfo_GetInfoResp.Marshal(b, m, deterministic)
  280. } else {
  281. b = b[:cap(b)]
  282. n, err := m.MarshalTo(b)
  283. if err != nil {
  284. return nil, err
  285. }
  286. return b[:n], nil
  287. }
  288. }
  289. func (dst *GetInfoResp) XXX_Merge(src proto.Message) {
  290. xxx_messageInfo_GetInfoResp.Merge(dst, src)
  291. }
  292. func (m *GetInfoResp) XXX_Size() int {
  293. return m.Size()
  294. }
  295. func (m *GetInfoResp) XXX_DiscardUnknown() {
  296. xxx_messageInfo_GetInfoResp.DiscardUnknown(m)
  297. }
  298. var xxx_messageInfo_GetInfoResp proto.InternalMessageInfo
  299. func (m *GetInfoResp) GetRoomid() int64 {
  300. if m != nil {
  301. return m.Roomid
  302. }
  303. return 0
  304. }
  305. func (m *GetInfoResp) GetUname() string {
  306. if m != nil {
  307. return m.Uname
  308. }
  309. return ""
  310. }
  311. func (m *GetInfoResp) GetLiveTime() string {
  312. if m != nil {
  313. return m.LiveTime
  314. }
  315. return ""
  316. }
  317. func (m *GetInfoResp) GetAmap() map[int32]string {
  318. if m != nil {
  319. return m.Amap
  320. }
  321. return nil
  322. }
  323. func (m *GetInfoResp) GetRate() float32 {
  324. if m != nil {
  325. return m.Rate
  326. }
  327. return 0
  328. }
  329. func (m *GetInfoResp) GetMid() int64 {
  330. if m != nil {
  331. return m.Mid
  332. }
  333. return 0
  334. }
  335. func init() {
  336. proto.RegisterType((*Bar1Req)(nil), "live.livedemo.v1.Bar1Req")
  337. proto.RegisterType((*Bar1Resp)(nil), "live.livedemo.v1.Bar1Resp")
  338. proto.RegisterMapType((map[string]*Bar1Resp_List)(nil), "live.livedemo.v1.Bar1Resp.AmapEntry")
  339. proto.RegisterType((*Bar1Resp_List)(nil), "live.livedemo.v1.Bar1Resp.List")
  340. proto.RegisterType((*GetInfoReq)(nil), "live.livedemo.v1.GetInfoReq")
  341. proto.RegisterType((*GetInfoResp)(nil), "live.livedemo.v1.GetInfoResp")
  342. proto.RegisterMapType((map[int32]string)(nil), "live.livedemo.v1.GetInfoResp.AmapEntry")
  343. }
  344. // Reference imports to suppress errors if they are not otherwise used.
  345. var _ context.Context
  346. var _ grpc.ClientConn
  347. // This is a compile-time assertion to ensure that this generated file
  348. // is compatible with the grpc package it is being compiled against.
  349. const _ = grpc.SupportPackageIsVersion4
  350. // FooClient is the client API for Foo service.
  351. //
  352. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
  353. type FooClient interface {
  354. // 根据uid得到uname
  355. // `method:"post" midware:"auth,verify"`
  356. //
  357. // 这是详细说明
  358. UnameByUid(ctx context.Context, in *Bar1Req, opts ...grpc.CallOption) (*Bar1Resp, error)
  359. // 获取房间信息
  360. // `midware:"guest"`
  361. GetInfo(ctx context.Context, in *GetInfoReq, opts ...grpc.CallOption) (*GetInfoResp, error)
  362. // 根据uid得到uname v3
  363. UnameByUid3(ctx context.Context, in *Bar1Req, opts ...grpc.CallOption) (*Bar1Resp, error)
  364. // test comment
  365. // `internal:"true"`
  366. UnameByUid4(ctx context.Context, in *Bar1Req, opts ...grpc.CallOption) (*Bar1Resp, error)
  367. // `dynamic_resp:"true"`
  368. GetDynamic(ctx context.Context, in *Bar1Req, opts ...grpc.CallOption) (*Bar1Resp, error)
  369. // `dynamic:"true"`
  370. Nointerface(ctx context.Context, in *Bar1Req, opts ...grpc.CallOption) (*Bar1Resp, error)
  371. }
  372. type fooClient struct {
  373. cc *grpc.ClientConn
  374. }
  375. func NewFooClient(cc *grpc.ClientConn) FooClient {
  376. return &fooClient{cc}
  377. }
  378. func (c *fooClient) UnameByUid(ctx context.Context, in *Bar1Req, opts ...grpc.CallOption) (*Bar1Resp, error) {
  379. out := new(Bar1Resp)
  380. err := c.cc.Invoke(ctx, "/live.livedemo.v1.Foo/uname_by_uid", in, out, opts...)
  381. if err != nil {
  382. return nil, err
  383. }
  384. return out, nil
  385. }
  386. func (c *fooClient) GetInfo(ctx context.Context, in *GetInfoReq, opts ...grpc.CallOption) (*GetInfoResp, error) {
  387. out := new(GetInfoResp)
  388. err := c.cc.Invoke(ctx, "/live.livedemo.v1.Foo/get_info", in, out, opts...)
  389. if err != nil {
  390. return nil, err
  391. }
  392. return out, nil
  393. }
  394. func (c *fooClient) UnameByUid3(ctx context.Context, in *Bar1Req, opts ...grpc.CallOption) (*Bar1Resp, error) {
  395. out := new(Bar1Resp)
  396. err := c.cc.Invoke(ctx, "/live.livedemo.v1.Foo/uname_by_uid3", in, out, opts...)
  397. if err != nil {
  398. return nil, err
  399. }
  400. return out, nil
  401. }
  402. func (c *fooClient) UnameByUid4(ctx context.Context, in *Bar1Req, opts ...grpc.CallOption) (*Bar1Resp, error) {
  403. out := new(Bar1Resp)
  404. err := c.cc.Invoke(ctx, "/live.livedemo.v1.Foo/uname_by_uid4", in, out, opts...)
  405. if err != nil {
  406. return nil, err
  407. }
  408. return out, nil
  409. }
  410. func (c *fooClient) GetDynamic(ctx context.Context, in *Bar1Req, opts ...grpc.CallOption) (*Bar1Resp, error) {
  411. out := new(Bar1Resp)
  412. err := c.cc.Invoke(ctx, "/live.livedemo.v1.Foo/get_dynamic", in, out, opts...)
  413. if err != nil {
  414. return nil, err
  415. }
  416. return out, nil
  417. }
  418. func (c *fooClient) Nointerface(ctx context.Context, in *Bar1Req, opts ...grpc.CallOption) (*Bar1Resp, error) {
  419. out := new(Bar1Resp)
  420. err := c.cc.Invoke(ctx, "/live.livedemo.v1.Foo/nointerface", in, out, opts...)
  421. if err != nil {
  422. return nil, err
  423. }
  424. return out, nil
  425. }
  426. // FooServer is the server API for Foo service.
  427. type FooServer interface {
  428. // 根据uid得到uname
  429. // `method:"post" midware:"auth,verify"`
  430. //
  431. // 这是详细说明
  432. UnameByUid(context.Context, *Bar1Req) (*Bar1Resp, error)
  433. // 获取房间信息
  434. // `midware:"guest"`
  435. GetInfo(context.Context, *GetInfoReq) (*GetInfoResp, error)
  436. // 根据uid得到uname v3
  437. UnameByUid3(context.Context, *Bar1Req) (*Bar1Resp, error)
  438. // test comment
  439. // `internal:"true"`
  440. UnameByUid4(context.Context, *Bar1Req) (*Bar1Resp, error)
  441. // `dynamic_resp:"true"`
  442. GetDynamic(context.Context, *Bar1Req) (*Bar1Resp, error)
  443. // `dynamic:"true"`
  444. Nointerface(context.Context, *Bar1Req) (*Bar1Resp, error)
  445. }
  446. func RegisterFooServer(s *grpc.Server, srv FooServer) {
  447. s.RegisterService(&_Foo_serviceDesc, srv)
  448. }
  449. func _Foo_UnameByUid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  450. in := new(Bar1Req)
  451. if err := dec(in); err != nil {
  452. return nil, err
  453. }
  454. if interceptor == nil {
  455. return srv.(FooServer).UnameByUid(ctx, in)
  456. }
  457. info := &grpc.UnaryServerInfo{
  458. Server: srv,
  459. FullMethod: "/live.livedemo.v1.Foo/UnameByUid",
  460. }
  461. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  462. return srv.(FooServer).UnameByUid(ctx, req.(*Bar1Req))
  463. }
  464. return interceptor(ctx, in, info, handler)
  465. }
  466. func _Foo_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  467. in := new(GetInfoReq)
  468. if err := dec(in); err != nil {
  469. return nil, err
  470. }
  471. if interceptor == nil {
  472. return srv.(FooServer).GetInfo(ctx, in)
  473. }
  474. info := &grpc.UnaryServerInfo{
  475. Server: srv,
  476. FullMethod: "/live.livedemo.v1.Foo/GetInfo",
  477. }
  478. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  479. return srv.(FooServer).GetInfo(ctx, req.(*GetInfoReq))
  480. }
  481. return interceptor(ctx, in, info, handler)
  482. }
  483. func _Foo_UnameByUid3_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  484. in := new(Bar1Req)
  485. if err := dec(in); err != nil {
  486. return nil, err
  487. }
  488. if interceptor == nil {
  489. return srv.(FooServer).UnameByUid3(ctx, in)
  490. }
  491. info := &grpc.UnaryServerInfo{
  492. Server: srv,
  493. FullMethod: "/live.livedemo.v1.Foo/UnameByUid3",
  494. }
  495. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  496. return srv.(FooServer).UnameByUid3(ctx, req.(*Bar1Req))
  497. }
  498. return interceptor(ctx, in, info, handler)
  499. }
  500. func _Foo_UnameByUid4_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  501. in := new(Bar1Req)
  502. if err := dec(in); err != nil {
  503. return nil, err
  504. }
  505. if interceptor == nil {
  506. return srv.(FooServer).UnameByUid4(ctx, in)
  507. }
  508. info := &grpc.UnaryServerInfo{
  509. Server: srv,
  510. FullMethod: "/live.livedemo.v1.Foo/UnameByUid4",
  511. }
  512. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  513. return srv.(FooServer).UnameByUid4(ctx, req.(*Bar1Req))
  514. }
  515. return interceptor(ctx, in, info, handler)
  516. }
  517. func _Foo_GetDynamic_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  518. in := new(Bar1Req)
  519. if err := dec(in); err != nil {
  520. return nil, err
  521. }
  522. if interceptor == nil {
  523. return srv.(FooServer).GetDynamic(ctx, in)
  524. }
  525. info := &grpc.UnaryServerInfo{
  526. Server: srv,
  527. FullMethod: "/live.livedemo.v1.Foo/GetDynamic",
  528. }
  529. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  530. return srv.(FooServer).GetDynamic(ctx, req.(*Bar1Req))
  531. }
  532. return interceptor(ctx, in, info, handler)
  533. }
  534. func _Foo_Nointerface_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  535. in := new(Bar1Req)
  536. if err := dec(in); err != nil {
  537. return nil, err
  538. }
  539. if interceptor == nil {
  540. return srv.(FooServer).Nointerface(ctx, in)
  541. }
  542. info := &grpc.UnaryServerInfo{
  543. Server: srv,
  544. FullMethod: "/live.livedemo.v1.Foo/Nointerface",
  545. }
  546. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  547. return srv.(FooServer).Nointerface(ctx, req.(*Bar1Req))
  548. }
  549. return interceptor(ctx, in, info, handler)
  550. }
  551. var _Foo_serviceDesc = grpc.ServiceDesc{
  552. ServiceName: "live.livedemo.v1.Foo",
  553. HandlerType: (*FooServer)(nil),
  554. Methods: []grpc.MethodDesc{
  555. {
  556. MethodName: "uname_by_uid",
  557. Handler: _Foo_UnameByUid_Handler,
  558. },
  559. {
  560. MethodName: "get_info",
  561. Handler: _Foo_GetInfo_Handler,
  562. },
  563. {
  564. MethodName: "uname_by_uid3",
  565. Handler: _Foo_UnameByUid3_Handler,
  566. },
  567. {
  568. MethodName: "uname_by_uid4",
  569. Handler: _Foo_UnameByUid4_Handler,
  570. },
  571. {
  572. MethodName: "get_dynamic",
  573. Handler: _Foo_GetDynamic_Handler,
  574. },
  575. {
  576. MethodName: "nointerface",
  577. Handler: _Foo_Nointerface_Handler,
  578. },
  579. },
  580. Streams: []grpc.StreamDesc{},
  581. Metadata: "demo.proto",
  582. }
  583. // Foo2Client is the client API for Foo2 service.
  584. //
  585. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
  586. type Foo2Client interface {
  587. Hello(ctx context.Context, in *Bar1Req, opts ...grpc.CallOption) (*Bar1Resp, error)
  588. }
  589. type foo2Client struct {
  590. cc *grpc.ClientConn
  591. }
  592. func NewFoo2Client(cc *grpc.ClientConn) Foo2Client {
  593. return &foo2Client{cc}
  594. }
  595. func (c *foo2Client) Hello(ctx context.Context, in *Bar1Req, opts ...grpc.CallOption) (*Bar1Resp, error) {
  596. out := new(Bar1Resp)
  597. err := c.cc.Invoke(ctx, "/live.livedemo.v1.Foo2/hello", in, out, opts...)
  598. if err != nil {
  599. return nil, err
  600. }
  601. return out, nil
  602. }
  603. // Foo2Server is the server API for Foo2 service.
  604. type Foo2Server interface {
  605. Hello(context.Context, *Bar1Req) (*Bar1Resp, error)
  606. }
  607. func RegisterFoo2Server(s *grpc.Server, srv Foo2Server) {
  608. s.RegisterService(&_Foo2_serviceDesc, srv)
  609. }
  610. func _Foo2_Hello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  611. in := new(Bar1Req)
  612. if err := dec(in); err != nil {
  613. return nil, err
  614. }
  615. if interceptor == nil {
  616. return srv.(Foo2Server).Hello(ctx, in)
  617. }
  618. info := &grpc.UnaryServerInfo{
  619. Server: srv,
  620. FullMethod: "/live.livedemo.v1.Foo2/Hello",
  621. }
  622. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  623. return srv.(Foo2Server).Hello(ctx, req.(*Bar1Req))
  624. }
  625. return interceptor(ctx, in, info, handler)
  626. }
  627. var _Foo2_serviceDesc = grpc.ServiceDesc{
  628. ServiceName: "live.livedemo.v1.Foo2",
  629. HandlerType: (*Foo2Server)(nil),
  630. Methods: []grpc.MethodDesc{
  631. {
  632. MethodName: "hello",
  633. Handler: _Foo2_Hello_Handler,
  634. },
  635. },
  636. Streams: []grpc.StreamDesc{},
  637. Metadata: "demo.proto",
  638. }
  639. func (m *Bar1Req) Marshal() (dAtA []byte, err error) {
  640. size := m.Size()
  641. dAtA = make([]byte, size)
  642. n, err := m.MarshalTo(dAtA)
  643. if err != nil {
  644. return nil, err
  645. }
  646. return dAtA[:n], nil
  647. }
  648. func (m *Bar1Req) MarshalTo(dAtA []byte) (int, error) {
  649. var i int
  650. _ = i
  651. var l int
  652. _ = l
  653. if m.Uid != 0 {
  654. dAtA[i] = 0x8
  655. i++
  656. i = encodeVarintDemo(dAtA, i, uint64(m.Uid))
  657. }
  658. if m.XXX_unrecognized != nil {
  659. i += copy(dAtA[i:], m.XXX_unrecognized)
  660. }
  661. return i, nil
  662. }
  663. func (m *Bar1Resp) Marshal() (dAtA []byte, err error) {
  664. size := m.Size()
  665. dAtA = make([]byte, size)
  666. n, err := m.MarshalTo(dAtA)
  667. if err != nil {
  668. return nil, err
  669. }
  670. return dAtA[:n], nil
  671. }
  672. func (m *Bar1Resp) MarshalTo(dAtA []byte) (int, error) {
  673. var i int
  674. _ = i
  675. var l int
  676. _ = l
  677. if len(m.Uname) > 0 {
  678. dAtA[i] = 0x12
  679. i++
  680. i = encodeVarintDemo(dAtA, i, uint64(len(m.Uname)))
  681. i += copy(dAtA[i:], m.Uname)
  682. }
  683. if len(m.Ids) > 0 {
  684. dAtA2 := make([]byte, len(m.Ids)*10)
  685. var j1 int
  686. for _, num1 := range m.Ids {
  687. num := uint64(num1)
  688. for num >= 1<<7 {
  689. dAtA2[j1] = uint8(uint64(num)&0x7f | 0x80)
  690. num >>= 7
  691. j1++
  692. }
  693. dAtA2[j1] = uint8(num)
  694. j1++
  695. }
  696. dAtA[i] = 0x1a
  697. i++
  698. i = encodeVarintDemo(dAtA, i, uint64(j1))
  699. i += copy(dAtA[i:], dAtA2[:j1])
  700. }
  701. if len(m.List) > 0 {
  702. for _, msg := range m.List {
  703. dAtA[i] = 0x22
  704. i++
  705. i = encodeVarintDemo(dAtA, i, uint64(msg.Size()))
  706. n, err := msg.MarshalTo(dAtA[i:])
  707. if err != nil {
  708. return 0, err
  709. }
  710. i += n
  711. }
  712. }
  713. if m.Alist != nil {
  714. dAtA[i] = 0x2a
  715. i++
  716. i = encodeVarintDemo(dAtA, i, uint64(m.Alist.Size()))
  717. n3, err := m.Alist.MarshalTo(dAtA[i:])
  718. if err != nil {
  719. return 0, err
  720. }
  721. i += n3
  722. }
  723. if len(m.Amap) > 0 {
  724. for k, _ := range m.Amap {
  725. dAtA[i] = 0x32
  726. i++
  727. v := m.Amap[k]
  728. msgSize := 0
  729. if v != nil {
  730. msgSize = v.Size()
  731. msgSize += 1 + sovDemo(uint64(msgSize))
  732. }
  733. mapSize := 1 + len(k) + sovDemo(uint64(len(k))) + msgSize
  734. i = encodeVarintDemo(dAtA, i, uint64(mapSize))
  735. dAtA[i] = 0xa
  736. i++
  737. i = encodeVarintDemo(dAtA, i, uint64(len(k)))
  738. i += copy(dAtA[i:], k)
  739. if v != nil {
  740. dAtA[i] = 0x12
  741. i++
  742. i = encodeVarintDemo(dAtA, i, uint64(v.Size()))
  743. n4, err := v.MarshalTo(dAtA[i:])
  744. if err != nil {
  745. return 0, err
  746. }
  747. i += n4
  748. }
  749. }
  750. }
  751. if m.XXX_unrecognized != nil {
  752. i += copy(dAtA[i:], m.XXX_unrecognized)
  753. }
  754. return i, nil
  755. }
  756. func (m *Bar1Resp_List) Marshal() (dAtA []byte, err error) {
  757. size := m.Size()
  758. dAtA = make([]byte, size)
  759. n, err := m.MarshalTo(dAtA)
  760. if err != nil {
  761. return nil, err
  762. }
  763. return dAtA[:n], nil
  764. }
  765. func (m *Bar1Resp_List) MarshalTo(dAtA []byte) (int, error) {
  766. var i int
  767. _ = i
  768. var l int
  769. _ = l
  770. if len(m.Hello) > 0 {
  771. dAtA[i] = 0xa
  772. i++
  773. i = encodeVarintDemo(dAtA, i, uint64(len(m.Hello)))
  774. i += copy(dAtA[i:], m.Hello)
  775. }
  776. if len(m.World) > 0 {
  777. dAtA[i] = 0x12
  778. i++
  779. i = encodeVarintDemo(dAtA, i, uint64(len(m.World)))
  780. i += copy(dAtA[i:], m.World)
  781. }
  782. if m.XXX_unrecognized != nil {
  783. i += copy(dAtA[i:], m.XXX_unrecognized)
  784. }
  785. return i, nil
  786. }
  787. func (m *GetInfoReq) Marshal() (dAtA []byte, err error) {
  788. size := m.Size()
  789. dAtA = make([]byte, size)
  790. n, err := m.MarshalTo(dAtA)
  791. if err != nil {
  792. return nil, err
  793. }
  794. return dAtA[:n], nil
  795. }
  796. func (m *GetInfoReq) MarshalTo(dAtA []byte) (int, error) {
  797. var i int
  798. _ = i
  799. var l int
  800. _ = l
  801. if m.RoomId != 0 {
  802. dAtA[i] = 0x8
  803. i++
  804. i = encodeVarintDemo(dAtA, i, uint64(m.RoomId))
  805. }
  806. if len(m.ManyIds) > 0 {
  807. dAtA6 := make([]byte, len(m.ManyIds)*10)
  808. var j5 int
  809. for _, num1 := range m.ManyIds {
  810. num := uint64(num1)
  811. for num >= 1<<7 {
  812. dAtA6[j5] = uint8(uint64(num)&0x7f | 0x80)
  813. num >>= 7
  814. j5++
  815. }
  816. dAtA6[j5] = uint8(num)
  817. j5++
  818. }
  819. dAtA[i] = 0x12
  820. i++
  821. i = encodeVarintDemo(dAtA, i, uint64(j5))
  822. i += copy(dAtA[i:], dAtA6[:j5])
  823. }
  824. if m.XXX_unrecognized != nil {
  825. i += copy(dAtA[i:], m.XXX_unrecognized)
  826. }
  827. return i, nil
  828. }
  829. func (m *GetInfoResp) Marshal() (dAtA []byte, err error) {
  830. size := m.Size()
  831. dAtA = make([]byte, size)
  832. n, err := m.MarshalTo(dAtA)
  833. if err != nil {
  834. return nil, err
  835. }
  836. return dAtA[:n], nil
  837. }
  838. func (m *GetInfoResp) MarshalTo(dAtA []byte) (int, error) {
  839. var i int
  840. _ = i
  841. var l int
  842. _ = l
  843. if m.Roomid != 0 {
  844. dAtA[i] = 0x8
  845. i++
  846. i = encodeVarintDemo(dAtA, i, uint64(m.Roomid))
  847. }
  848. if len(m.Uname) > 0 {
  849. dAtA[i] = 0x12
  850. i++
  851. i = encodeVarintDemo(dAtA, i, uint64(len(m.Uname)))
  852. i += copy(dAtA[i:], m.Uname)
  853. }
  854. if len(m.LiveTime) > 0 {
  855. dAtA[i] = 0x1a
  856. i++
  857. i = encodeVarintDemo(dAtA, i, uint64(len(m.LiveTime)))
  858. i += copy(dAtA[i:], m.LiveTime)
  859. }
  860. if len(m.Amap) > 0 {
  861. for k, _ := range m.Amap {
  862. dAtA[i] = 0x22
  863. i++
  864. v := m.Amap[k]
  865. mapSize := 1 + sovDemo(uint64(k)) + 1 + len(v) + sovDemo(uint64(len(v)))
  866. i = encodeVarintDemo(dAtA, i, uint64(mapSize))
  867. dAtA[i] = 0x8
  868. i++
  869. i = encodeVarintDemo(dAtA, i, uint64(k))
  870. dAtA[i] = 0x12
  871. i++
  872. i = encodeVarintDemo(dAtA, i, uint64(len(v)))
  873. i += copy(dAtA[i:], v)
  874. }
  875. }
  876. if m.Rate != 0 {
  877. dAtA[i] = 0x2d
  878. i++
  879. encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.Rate))))
  880. i += 4
  881. }
  882. if m.Mid != 0 {
  883. dAtA[i] = 0x30
  884. i++
  885. i = encodeVarintDemo(dAtA, i, uint64(m.Mid))
  886. }
  887. if m.XXX_unrecognized != nil {
  888. i += copy(dAtA[i:], m.XXX_unrecognized)
  889. }
  890. return i, nil
  891. }
  892. func encodeVarintDemo(dAtA []byte, offset int, v uint64) int {
  893. for v >= 1<<7 {
  894. dAtA[offset] = uint8(v&0x7f | 0x80)
  895. v >>= 7
  896. offset++
  897. }
  898. dAtA[offset] = uint8(v)
  899. return offset + 1
  900. }
  901. func (m *Bar1Req) Size() (n int) {
  902. if m == nil {
  903. return 0
  904. }
  905. var l int
  906. _ = l
  907. if m.Uid != 0 {
  908. n += 1 + sovDemo(uint64(m.Uid))
  909. }
  910. if m.XXX_unrecognized != nil {
  911. n += len(m.XXX_unrecognized)
  912. }
  913. return n
  914. }
  915. func (m *Bar1Resp) Size() (n int) {
  916. if m == nil {
  917. return 0
  918. }
  919. var l int
  920. _ = l
  921. l = len(m.Uname)
  922. if l > 0 {
  923. n += 1 + l + sovDemo(uint64(l))
  924. }
  925. if len(m.Ids) > 0 {
  926. l = 0
  927. for _, e := range m.Ids {
  928. l += sovDemo(uint64(e))
  929. }
  930. n += 1 + sovDemo(uint64(l)) + l
  931. }
  932. if len(m.List) > 0 {
  933. for _, e := range m.List {
  934. l = e.Size()
  935. n += 1 + l + sovDemo(uint64(l))
  936. }
  937. }
  938. if m.Alist != nil {
  939. l = m.Alist.Size()
  940. n += 1 + l + sovDemo(uint64(l))
  941. }
  942. if len(m.Amap) > 0 {
  943. for k, v := range m.Amap {
  944. _ = k
  945. _ = v
  946. l = 0
  947. if v != nil {
  948. l = v.Size()
  949. l += 1 + sovDemo(uint64(l))
  950. }
  951. mapEntrySize := 1 + len(k) + sovDemo(uint64(len(k))) + l
  952. n += mapEntrySize + 1 + sovDemo(uint64(mapEntrySize))
  953. }
  954. }
  955. if m.XXX_unrecognized != nil {
  956. n += len(m.XXX_unrecognized)
  957. }
  958. return n
  959. }
  960. func (m *Bar1Resp_List) Size() (n int) {
  961. if m == nil {
  962. return 0
  963. }
  964. var l int
  965. _ = l
  966. l = len(m.Hello)
  967. if l > 0 {
  968. n += 1 + l + sovDemo(uint64(l))
  969. }
  970. l = len(m.World)
  971. if l > 0 {
  972. n += 1 + l + sovDemo(uint64(l))
  973. }
  974. if m.XXX_unrecognized != nil {
  975. n += len(m.XXX_unrecognized)
  976. }
  977. return n
  978. }
  979. func (m *GetInfoReq) Size() (n int) {
  980. if m == nil {
  981. return 0
  982. }
  983. var l int
  984. _ = l
  985. if m.RoomId != 0 {
  986. n += 1 + sovDemo(uint64(m.RoomId))
  987. }
  988. if len(m.ManyIds) > 0 {
  989. l = 0
  990. for _, e := range m.ManyIds {
  991. l += sovDemo(uint64(e))
  992. }
  993. n += 1 + sovDemo(uint64(l)) + l
  994. }
  995. if m.XXX_unrecognized != nil {
  996. n += len(m.XXX_unrecognized)
  997. }
  998. return n
  999. }
  1000. func (m *GetInfoResp) Size() (n int) {
  1001. if m == nil {
  1002. return 0
  1003. }
  1004. var l int
  1005. _ = l
  1006. if m.Roomid != 0 {
  1007. n += 1 + sovDemo(uint64(m.Roomid))
  1008. }
  1009. l = len(m.Uname)
  1010. if l > 0 {
  1011. n += 1 + l + sovDemo(uint64(l))
  1012. }
  1013. l = len(m.LiveTime)
  1014. if l > 0 {
  1015. n += 1 + l + sovDemo(uint64(l))
  1016. }
  1017. if len(m.Amap) > 0 {
  1018. for k, v := range m.Amap {
  1019. _ = k
  1020. _ = v
  1021. mapEntrySize := 1 + sovDemo(uint64(k)) + 1 + len(v) + sovDemo(uint64(len(v)))
  1022. n += mapEntrySize + 1 + sovDemo(uint64(mapEntrySize))
  1023. }
  1024. }
  1025. if m.Rate != 0 {
  1026. n += 5
  1027. }
  1028. if m.Mid != 0 {
  1029. n += 1 + sovDemo(uint64(m.Mid))
  1030. }
  1031. if m.XXX_unrecognized != nil {
  1032. n += len(m.XXX_unrecognized)
  1033. }
  1034. return n
  1035. }
  1036. func sovDemo(x uint64) (n int) {
  1037. for {
  1038. n++
  1039. x >>= 7
  1040. if x == 0 {
  1041. break
  1042. }
  1043. }
  1044. return n
  1045. }
  1046. func sozDemo(x uint64) (n int) {
  1047. return sovDemo(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  1048. }
  1049. func (m *Bar1Req) Unmarshal(dAtA []byte) error {
  1050. l := len(dAtA)
  1051. iNdEx := 0
  1052. for iNdEx < l {
  1053. preIndex := iNdEx
  1054. var wire uint64
  1055. for shift := uint(0); ; shift += 7 {
  1056. if shift >= 64 {
  1057. return ErrIntOverflowDemo
  1058. }
  1059. if iNdEx >= l {
  1060. return io.ErrUnexpectedEOF
  1061. }
  1062. b := dAtA[iNdEx]
  1063. iNdEx++
  1064. wire |= (uint64(b) & 0x7F) << shift
  1065. if b < 0x80 {
  1066. break
  1067. }
  1068. }
  1069. fieldNum := int32(wire >> 3)
  1070. wireType := int(wire & 0x7)
  1071. if wireType == 4 {
  1072. return fmt.Errorf("proto: Bar1Req: wiretype end group for non-group")
  1073. }
  1074. if fieldNum <= 0 {
  1075. return fmt.Errorf("proto: Bar1Req: illegal tag %d (wire type %d)", fieldNum, wire)
  1076. }
  1077. switch fieldNum {
  1078. case 1:
  1079. if wireType != 0 {
  1080. return fmt.Errorf("proto: wrong wireType = %d for field Uid", wireType)
  1081. }
  1082. m.Uid = 0
  1083. for shift := uint(0); ; shift += 7 {
  1084. if shift >= 64 {
  1085. return ErrIntOverflowDemo
  1086. }
  1087. if iNdEx >= l {
  1088. return io.ErrUnexpectedEOF
  1089. }
  1090. b := dAtA[iNdEx]
  1091. iNdEx++
  1092. m.Uid |= (int32(b) & 0x7F) << shift
  1093. if b < 0x80 {
  1094. break
  1095. }
  1096. }
  1097. default:
  1098. iNdEx = preIndex
  1099. skippy, err := skipDemo(dAtA[iNdEx:])
  1100. if err != nil {
  1101. return err
  1102. }
  1103. if skippy < 0 {
  1104. return ErrInvalidLengthDemo
  1105. }
  1106. if (iNdEx + skippy) > l {
  1107. return io.ErrUnexpectedEOF
  1108. }
  1109. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  1110. iNdEx += skippy
  1111. }
  1112. }
  1113. if iNdEx > l {
  1114. return io.ErrUnexpectedEOF
  1115. }
  1116. return nil
  1117. }
  1118. func (m *Bar1Resp) Unmarshal(dAtA []byte) error {
  1119. l := len(dAtA)
  1120. iNdEx := 0
  1121. for iNdEx < l {
  1122. preIndex := iNdEx
  1123. var wire uint64
  1124. for shift := uint(0); ; shift += 7 {
  1125. if shift >= 64 {
  1126. return ErrIntOverflowDemo
  1127. }
  1128. if iNdEx >= l {
  1129. return io.ErrUnexpectedEOF
  1130. }
  1131. b := dAtA[iNdEx]
  1132. iNdEx++
  1133. wire |= (uint64(b) & 0x7F) << shift
  1134. if b < 0x80 {
  1135. break
  1136. }
  1137. }
  1138. fieldNum := int32(wire >> 3)
  1139. wireType := int(wire & 0x7)
  1140. if wireType == 4 {
  1141. return fmt.Errorf("proto: Bar1Resp: wiretype end group for non-group")
  1142. }
  1143. if fieldNum <= 0 {
  1144. return fmt.Errorf("proto: Bar1Resp: illegal tag %d (wire type %d)", fieldNum, wire)
  1145. }
  1146. switch fieldNum {
  1147. case 2:
  1148. if wireType != 2 {
  1149. return fmt.Errorf("proto: wrong wireType = %d for field Uname", wireType)
  1150. }
  1151. var stringLen uint64
  1152. for shift := uint(0); ; shift += 7 {
  1153. if shift >= 64 {
  1154. return ErrIntOverflowDemo
  1155. }
  1156. if iNdEx >= l {
  1157. return io.ErrUnexpectedEOF
  1158. }
  1159. b := dAtA[iNdEx]
  1160. iNdEx++
  1161. stringLen |= (uint64(b) & 0x7F) << shift
  1162. if b < 0x80 {
  1163. break
  1164. }
  1165. }
  1166. intStringLen := int(stringLen)
  1167. if intStringLen < 0 {
  1168. return ErrInvalidLengthDemo
  1169. }
  1170. postIndex := iNdEx + intStringLen
  1171. if postIndex > l {
  1172. return io.ErrUnexpectedEOF
  1173. }
  1174. m.Uname = string(dAtA[iNdEx:postIndex])
  1175. iNdEx = postIndex
  1176. case 3:
  1177. if wireType == 0 {
  1178. var v int32
  1179. for shift := uint(0); ; shift += 7 {
  1180. if shift >= 64 {
  1181. return ErrIntOverflowDemo
  1182. }
  1183. if iNdEx >= l {
  1184. return io.ErrUnexpectedEOF
  1185. }
  1186. b := dAtA[iNdEx]
  1187. iNdEx++
  1188. v |= (int32(b) & 0x7F) << shift
  1189. if b < 0x80 {
  1190. break
  1191. }
  1192. }
  1193. m.Ids = append(m.Ids, v)
  1194. } else if wireType == 2 {
  1195. var packedLen int
  1196. for shift := uint(0); ; shift += 7 {
  1197. if shift >= 64 {
  1198. return ErrIntOverflowDemo
  1199. }
  1200. if iNdEx >= l {
  1201. return io.ErrUnexpectedEOF
  1202. }
  1203. b := dAtA[iNdEx]
  1204. iNdEx++
  1205. packedLen |= (int(b) & 0x7F) << shift
  1206. if b < 0x80 {
  1207. break
  1208. }
  1209. }
  1210. if packedLen < 0 {
  1211. return ErrInvalidLengthDemo
  1212. }
  1213. postIndex := iNdEx + packedLen
  1214. if postIndex > l {
  1215. return io.ErrUnexpectedEOF
  1216. }
  1217. var elementCount int
  1218. var count int
  1219. for _, integer := range dAtA {
  1220. if integer < 128 {
  1221. count++
  1222. }
  1223. }
  1224. elementCount = count
  1225. if elementCount != 0 && len(m.Ids) == 0 {
  1226. m.Ids = make([]int32, 0, elementCount)
  1227. }
  1228. for iNdEx < postIndex {
  1229. var v int32
  1230. for shift := uint(0); ; shift += 7 {
  1231. if shift >= 64 {
  1232. return ErrIntOverflowDemo
  1233. }
  1234. if iNdEx >= l {
  1235. return io.ErrUnexpectedEOF
  1236. }
  1237. b := dAtA[iNdEx]
  1238. iNdEx++
  1239. v |= (int32(b) & 0x7F) << shift
  1240. if b < 0x80 {
  1241. break
  1242. }
  1243. }
  1244. m.Ids = append(m.Ids, v)
  1245. }
  1246. } else {
  1247. return fmt.Errorf("proto: wrong wireType = %d for field Ids", wireType)
  1248. }
  1249. case 4:
  1250. if wireType != 2 {
  1251. return fmt.Errorf("proto: wrong wireType = %d for field List", wireType)
  1252. }
  1253. var msglen int
  1254. for shift := uint(0); ; shift += 7 {
  1255. if shift >= 64 {
  1256. return ErrIntOverflowDemo
  1257. }
  1258. if iNdEx >= l {
  1259. return io.ErrUnexpectedEOF
  1260. }
  1261. b := dAtA[iNdEx]
  1262. iNdEx++
  1263. msglen |= (int(b) & 0x7F) << shift
  1264. if b < 0x80 {
  1265. break
  1266. }
  1267. }
  1268. if msglen < 0 {
  1269. return ErrInvalidLengthDemo
  1270. }
  1271. postIndex := iNdEx + msglen
  1272. if postIndex > l {
  1273. return io.ErrUnexpectedEOF
  1274. }
  1275. m.List = append(m.List, &Bar1Resp_List{})
  1276. if err := m.List[len(m.List)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1277. return err
  1278. }
  1279. iNdEx = postIndex
  1280. case 5:
  1281. if wireType != 2 {
  1282. return fmt.Errorf("proto: wrong wireType = %d for field Alist", wireType)
  1283. }
  1284. var msglen int
  1285. for shift := uint(0); ; shift += 7 {
  1286. if shift >= 64 {
  1287. return ErrIntOverflowDemo
  1288. }
  1289. if iNdEx >= l {
  1290. return io.ErrUnexpectedEOF
  1291. }
  1292. b := dAtA[iNdEx]
  1293. iNdEx++
  1294. msglen |= (int(b) & 0x7F) << shift
  1295. if b < 0x80 {
  1296. break
  1297. }
  1298. }
  1299. if msglen < 0 {
  1300. return ErrInvalidLengthDemo
  1301. }
  1302. postIndex := iNdEx + msglen
  1303. if postIndex > l {
  1304. return io.ErrUnexpectedEOF
  1305. }
  1306. if m.Alist == nil {
  1307. m.Alist = &Bar1Resp_List{}
  1308. }
  1309. if err := m.Alist.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1310. return err
  1311. }
  1312. iNdEx = postIndex
  1313. case 6:
  1314. if wireType != 2 {
  1315. return fmt.Errorf("proto: wrong wireType = %d for field Amap", wireType)
  1316. }
  1317. var msglen int
  1318. for shift := uint(0); ; shift += 7 {
  1319. if shift >= 64 {
  1320. return ErrIntOverflowDemo
  1321. }
  1322. if iNdEx >= l {
  1323. return io.ErrUnexpectedEOF
  1324. }
  1325. b := dAtA[iNdEx]
  1326. iNdEx++
  1327. msglen |= (int(b) & 0x7F) << shift
  1328. if b < 0x80 {
  1329. break
  1330. }
  1331. }
  1332. if msglen < 0 {
  1333. return ErrInvalidLengthDemo
  1334. }
  1335. postIndex := iNdEx + msglen
  1336. if postIndex > l {
  1337. return io.ErrUnexpectedEOF
  1338. }
  1339. if m.Amap == nil {
  1340. m.Amap = make(map[string]*Bar1Resp_List)
  1341. }
  1342. var mapkey string
  1343. var mapvalue *Bar1Resp_List
  1344. for iNdEx < postIndex {
  1345. entryPreIndex := iNdEx
  1346. var wire uint64
  1347. for shift := uint(0); ; shift += 7 {
  1348. if shift >= 64 {
  1349. return ErrIntOverflowDemo
  1350. }
  1351. if iNdEx >= l {
  1352. return io.ErrUnexpectedEOF
  1353. }
  1354. b := dAtA[iNdEx]
  1355. iNdEx++
  1356. wire |= (uint64(b) & 0x7F) << shift
  1357. if b < 0x80 {
  1358. break
  1359. }
  1360. }
  1361. fieldNum := int32(wire >> 3)
  1362. if fieldNum == 1 {
  1363. var stringLenmapkey uint64
  1364. for shift := uint(0); ; shift += 7 {
  1365. if shift >= 64 {
  1366. return ErrIntOverflowDemo
  1367. }
  1368. if iNdEx >= l {
  1369. return io.ErrUnexpectedEOF
  1370. }
  1371. b := dAtA[iNdEx]
  1372. iNdEx++
  1373. stringLenmapkey |= (uint64(b) & 0x7F) << shift
  1374. if b < 0x80 {
  1375. break
  1376. }
  1377. }
  1378. intStringLenmapkey := int(stringLenmapkey)
  1379. if intStringLenmapkey < 0 {
  1380. return ErrInvalidLengthDemo
  1381. }
  1382. postStringIndexmapkey := iNdEx + intStringLenmapkey
  1383. if postStringIndexmapkey > l {
  1384. return io.ErrUnexpectedEOF
  1385. }
  1386. mapkey = string(dAtA[iNdEx:postStringIndexmapkey])
  1387. iNdEx = postStringIndexmapkey
  1388. } else if fieldNum == 2 {
  1389. var mapmsglen int
  1390. for shift := uint(0); ; shift += 7 {
  1391. if shift >= 64 {
  1392. return ErrIntOverflowDemo
  1393. }
  1394. if iNdEx >= l {
  1395. return io.ErrUnexpectedEOF
  1396. }
  1397. b := dAtA[iNdEx]
  1398. iNdEx++
  1399. mapmsglen |= (int(b) & 0x7F) << shift
  1400. if b < 0x80 {
  1401. break
  1402. }
  1403. }
  1404. if mapmsglen < 0 {
  1405. return ErrInvalidLengthDemo
  1406. }
  1407. postmsgIndex := iNdEx + mapmsglen
  1408. if mapmsglen < 0 {
  1409. return ErrInvalidLengthDemo
  1410. }
  1411. if postmsgIndex > l {
  1412. return io.ErrUnexpectedEOF
  1413. }
  1414. mapvalue = &Bar1Resp_List{}
  1415. if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil {
  1416. return err
  1417. }
  1418. iNdEx = postmsgIndex
  1419. } else {
  1420. iNdEx = entryPreIndex
  1421. skippy, err := skipDemo(dAtA[iNdEx:])
  1422. if err != nil {
  1423. return err
  1424. }
  1425. if skippy < 0 {
  1426. return ErrInvalidLengthDemo
  1427. }
  1428. if (iNdEx + skippy) > postIndex {
  1429. return io.ErrUnexpectedEOF
  1430. }
  1431. iNdEx += skippy
  1432. }
  1433. }
  1434. m.Amap[mapkey] = mapvalue
  1435. iNdEx = postIndex
  1436. default:
  1437. iNdEx = preIndex
  1438. skippy, err := skipDemo(dAtA[iNdEx:])
  1439. if err != nil {
  1440. return err
  1441. }
  1442. if skippy < 0 {
  1443. return ErrInvalidLengthDemo
  1444. }
  1445. if (iNdEx + skippy) > l {
  1446. return io.ErrUnexpectedEOF
  1447. }
  1448. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  1449. iNdEx += skippy
  1450. }
  1451. }
  1452. if iNdEx > l {
  1453. return io.ErrUnexpectedEOF
  1454. }
  1455. return nil
  1456. }
  1457. func (m *Bar1Resp_List) Unmarshal(dAtA []byte) error {
  1458. l := len(dAtA)
  1459. iNdEx := 0
  1460. for iNdEx < l {
  1461. preIndex := iNdEx
  1462. var wire uint64
  1463. for shift := uint(0); ; shift += 7 {
  1464. if shift >= 64 {
  1465. return ErrIntOverflowDemo
  1466. }
  1467. if iNdEx >= l {
  1468. return io.ErrUnexpectedEOF
  1469. }
  1470. b := dAtA[iNdEx]
  1471. iNdEx++
  1472. wire |= (uint64(b) & 0x7F) << shift
  1473. if b < 0x80 {
  1474. break
  1475. }
  1476. }
  1477. fieldNum := int32(wire >> 3)
  1478. wireType := int(wire & 0x7)
  1479. if wireType == 4 {
  1480. return fmt.Errorf("proto: List: wiretype end group for non-group")
  1481. }
  1482. if fieldNum <= 0 {
  1483. return fmt.Errorf("proto: List: illegal tag %d (wire type %d)", fieldNum, wire)
  1484. }
  1485. switch fieldNum {
  1486. case 1:
  1487. if wireType != 2 {
  1488. return fmt.Errorf("proto: wrong wireType = %d for field Hello", wireType)
  1489. }
  1490. var stringLen uint64
  1491. for shift := uint(0); ; shift += 7 {
  1492. if shift >= 64 {
  1493. return ErrIntOverflowDemo
  1494. }
  1495. if iNdEx >= l {
  1496. return io.ErrUnexpectedEOF
  1497. }
  1498. b := dAtA[iNdEx]
  1499. iNdEx++
  1500. stringLen |= (uint64(b) & 0x7F) << shift
  1501. if b < 0x80 {
  1502. break
  1503. }
  1504. }
  1505. intStringLen := int(stringLen)
  1506. if intStringLen < 0 {
  1507. return ErrInvalidLengthDemo
  1508. }
  1509. postIndex := iNdEx + intStringLen
  1510. if postIndex > l {
  1511. return io.ErrUnexpectedEOF
  1512. }
  1513. m.Hello = string(dAtA[iNdEx:postIndex])
  1514. iNdEx = postIndex
  1515. case 2:
  1516. if wireType != 2 {
  1517. return fmt.Errorf("proto: wrong wireType = %d for field World", wireType)
  1518. }
  1519. var stringLen uint64
  1520. for shift := uint(0); ; shift += 7 {
  1521. if shift >= 64 {
  1522. return ErrIntOverflowDemo
  1523. }
  1524. if iNdEx >= l {
  1525. return io.ErrUnexpectedEOF
  1526. }
  1527. b := dAtA[iNdEx]
  1528. iNdEx++
  1529. stringLen |= (uint64(b) & 0x7F) << shift
  1530. if b < 0x80 {
  1531. break
  1532. }
  1533. }
  1534. intStringLen := int(stringLen)
  1535. if intStringLen < 0 {
  1536. return ErrInvalidLengthDemo
  1537. }
  1538. postIndex := iNdEx + intStringLen
  1539. if postIndex > l {
  1540. return io.ErrUnexpectedEOF
  1541. }
  1542. m.World = string(dAtA[iNdEx:postIndex])
  1543. iNdEx = postIndex
  1544. default:
  1545. iNdEx = preIndex
  1546. skippy, err := skipDemo(dAtA[iNdEx:])
  1547. if err != nil {
  1548. return err
  1549. }
  1550. if skippy < 0 {
  1551. return ErrInvalidLengthDemo
  1552. }
  1553. if (iNdEx + skippy) > l {
  1554. return io.ErrUnexpectedEOF
  1555. }
  1556. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  1557. iNdEx += skippy
  1558. }
  1559. }
  1560. if iNdEx > l {
  1561. return io.ErrUnexpectedEOF
  1562. }
  1563. return nil
  1564. }
  1565. func (m *GetInfoReq) Unmarshal(dAtA []byte) error {
  1566. l := len(dAtA)
  1567. iNdEx := 0
  1568. for iNdEx < l {
  1569. preIndex := iNdEx
  1570. var wire uint64
  1571. for shift := uint(0); ; shift += 7 {
  1572. if shift >= 64 {
  1573. return ErrIntOverflowDemo
  1574. }
  1575. if iNdEx >= l {
  1576. return io.ErrUnexpectedEOF
  1577. }
  1578. b := dAtA[iNdEx]
  1579. iNdEx++
  1580. wire |= (uint64(b) & 0x7F) << shift
  1581. if b < 0x80 {
  1582. break
  1583. }
  1584. }
  1585. fieldNum := int32(wire >> 3)
  1586. wireType := int(wire & 0x7)
  1587. if wireType == 4 {
  1588. return fmt.Errorf("proto: GetInfoReq: wiretype end group for non-group")
  1589. }
  1590. if fieldNum <= 0 {
  1591. return fmt.Errorf("proto: GetInfoReq: illegal tag %d (wire type %d)", fieldNum, wire)
  1592. }
  1593. switch fieldNum {
  1594. case 1:
  1595. if wireType != 0 {
  1596. return fmt.Errorf("proto: wrong wireType = %d for field RoomId", wireType)
  1597. }
  1598. m.RoomId = 0
  1599. for shift := uint(0); ; shift += 7 {
  1600. if shift >= 64 {
  1601. return ErrIntOverflowDemo
  1602. }
  1603. if iNdEx >= l {
  1604. return io.ErrUnexpectedEOF
  1605. }
  1606. b := dAtA[iNdEx]
  1607. iNdEx++
  1608. m.RoomId |= (int64(b) & 0x7F) << shift
  1609. if b < 0x80 {
  1610. break
  1611. }
  1612. }
  1613. case 2:
  1614. if wireType == 0 {
  1615. var v int64
  1616. for shift := uint(0); ; shift += 7 {
  1617. if shift >= 64 {
  1618. return ErrIntOverflowDemo
  1619. }
  1620. if iNdEx >= l {
  1621. return io.ErrUnexpectedEOF
  1622. }
  1623. b := dAtA[iNdEx]
  1624. iNdEx++
  1625. v |= (int64(b) & 0x7F) << shift
  1626. if b < 0x80 {
  1627. break
  1628. }
  1629. }
  1630. m.ManyIds = append(m.ManyIds, v)
  1631. } else if wireType == 2 {
  1632. var packedLen int
  1633. for shift := uint(0); ; shift += 7 {
  1634. if shift >= 64 {
  1635. return ErrIntOverflowDemo
  1636. }
  1637. if iNdEx >= l {
  1638. return io.ErrUnexpectedEOF
  1639. }
  1640. b := dAtA[iNdEx]
  1641. iNdEx++
  1642. packedLen |= (int(b) & 0x7F) << shift
  1643. if b < 0x80 {
  1644. break
  1645. }
  1646. }
  1647. if packedLen < 0 {
  1648. return ErrInvalidLengthDemo
  1649. }
  1650. postIndex := iNdEx + packedLen
  1651. if postIndex > l {
  1652. return io.ErrUnexpectedEOF
  1653. }
  1654. var elementCount int
  1655. var count int
  1656. for _, integer := range dAtA {
  1657. if integer < 128 {
  1658. count++
  1659. }
  1660. }
  1661. elementCount = count
  1662. if elementCount != 0 && len(m.ManyIds) == 0 {
  1663. m.ManyIds = make([]int64, 0, elementCount)
  1664. }
  1665. for iNdEx < postIndex {
  1666. var v int64
  1667. for shift := uint(0); ; shift += 7 {
  1668. if shift >= 64 {
  1669. return ErrIntOverflowDemo
  1670. }
  1671. if iNdEx >= l {
  1672. return io.ErrUnexpectedEOF
  1673. }
  1674. b := dAtA[iNdEx]
  1675. iNdEx++
  1676. v |= (int64(b) & 0x7F) << shift
  1677. if b < 0x80 {
  1678. break
  1679. }
  1680. }
  1681. m.ManyIds = append(m.ManyIds, v)
  1682. }
  1683. } else {
  1684. return fmt.Errorf("proto: wrong wireType = %d for field ManyIds", wireType)
  1685. }
  1686. default:
  1687. iNdEx = preIndex
  1688. skippy, err := skipDemo(dAtA[iNdEx:])
  1689. if err != nil {
  1690. return err
  1691. }
  1692. if skippy < 0 {
  1693. return ErrInvalidLengthDemo
  1694. }
  1695. if (iNdEx + skippy) > l {
  1696. return io.ErrUnexpectedEOF
  1697. }
  1698. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  1699. iNdEx += skippy
  1700. }
  1701. }
  1702. if iNdEx > l {
  1703. return io.ErrUnexpectedEOF
  1704. }
  1705. return nil
  1706. }
  1707. func (m *GetInfoResp) Unmarshal(dAtA []byte) error {
  1708. l := len(dAtA)
  1709. iNdEx := 0
  1710. for iNdEx < l {
  1711. preIndex := iNdEx
  1712. var wire uint64
  1713. for shift := uint(0); ; shift += 7 {
  1714. if shift >= 64 {
  1715. return ErrIntOverflowDemo
  1716. }
  1717. if iNdEx >= l {
  1718. return io.ErrUnexpectedEOF
  1719. }
  1720. b := dAtA[iNdEx]
  1721. iNdEx++
  1722. wire |= (uint64(b) & 0x7F) << shift
  1723. if b < 0x80 {
  1724. break
  1725. }
  1726. }
  1727. fieldNum := int32(wire >> 3)
  1728. wireType := int(wire & 0x7)
  1729. if wireType == 4 {
  1730. return fmt.Errorf("proto: GetInfoResp: wiretype end group for non-group")
  1731. }
  1732. if fieldNum <= 0 {
  1733. return fmt.Errorf("proto: GetInfoResp: illegal tag %d (wire type %d)", fieldNum, wire)
  1734. }
  1735. switch fieldNum {
  1736. case 1:
  1737. if wireType != 0 {
  1738. return fmt.Errorf("proto: wrong wireType = %d for field Roomid", wireType)
  1739. }
  1740. m.Roomid = 0
  1741. for shift := uint(0); ; shift += 7 {
  1742. if shift >= 64 {
  1743. return ErrIntOverflowDemo
  1744. }
  1745. if iNdEx >= l {
  1746. return io.ErrUnexpectedEOF
  1747. }
  1748. b := dAtA[iNdEx]
  1749. iNdEx++
  1750. m.Roomid |= (int64(b) & 0x7F) << shift
  1751. if b < 0x80 {
  1752. break
  1753. }
  1754. }
  1755. case 2:
  1756. if wireType != 2 {
  1757. return fmt.Errorf("proto: wrong wireType = %d for field Uname", wireType)
  1758. }
  1759. var stringLen uint64
  1760. for shift := uint(0); ; shift += 7 {
  1761. if shift >= 64 {
  1762. return ErrIntOverflowDemo
  1763. }
  1764. if iNdEx >= l {
  1765. return io.ErrUnexpectedEOF
  1766. }
  1767. b := dAtA[iNdEx]
  1768. iNdEx++
  1769. stringLen |= (uint64(b) & 0x7F) << shift
  1770. if b < 0x80 {
  1771. break
  1772. }
  1773. }
  1774. intStringLen := int(stringLen)
  1775. if intStringLen < 0 {
  1776. return ErrInvalidLengthDemo
  1777. }
  1778. postIndex := iNdEx + intStringLen
  1779. if postIndex > l {
  1780. return io.ErrUnexpectedEOF
  1781. }
  1782. m.Uname = string(dAtA[iNdEx:postIndex])
  1783. iNdEx = postIndex
  1784. case 3:
  1785. if wireType != 2 {
  1786. return fmt.Errorf("proto: wrong wireType = %d for field LiveTime", wireType)
  1787. }
  1788. var stringLen uint64
  1789. for shift := uint(0); ; shift += 7 {
  1790. if shift >= 64 {
  1791. return ErrIntOverflowDemo
  1792. }
  1793. if iNdEx >= l {
  1794. return io.ErrUnexpectedEOF
  1795. }
  1796. b := dAtA[iNdEx]
  1797. iNdEx++
  1798. stringLen |= (uint64(b) & 0x7F) << shift
  1799. if b < 0x80 {
  1800. break
  1801. }
  1802. }
  1803. intStringLen := int(stringLen)
  1804. if intStringLen < 0 {
  1805. return ErrInvalidLengthDemo
  1806. }
  1807. postIndex := iNdEx + intStringLen
  1808. if postIndex > l {
  1809. return io.ErrUnexpectedEOF
  1810. }
  1811. m.LiveTime = string(dAtA[iNdEx:postIndex])
  1812. iNdEx = postIndex
  1813. case 4:
  1814. if wireType != 2 {
  1815. return fmt.Errorf("proto: wrong wireType = %d for field Amap", wireType)
  1816. }
  1817. var msglen int
  1818. for shift := uint(0); ; shift += 7 {
  1819. if shift >= 64 {
  1820. return ErrIntOverflowDemo
  1821. }
  1822. if iNdEx >= l {
  1823. return io.ErrUnexpectedEOF
  1824. }
  1825. b := dAtA[iNdEx]
  1826. iNdEx++
  1827. msglen |= (int(b) & 0x7F) << shift
  1828. if b < 0x80 {
  1829. break
  1830. }
  1831. }
  1832. if msglen < 0 {
  1833. return ErrInvalidLengthDemo
  1834. }
  1835. postIndex := iNdEx + msglen
  1836. if postIndex > l {
  1837. return io.ErrUnexpectedEOF
  1838. }
  1839. if m.Amap == nil {
  1840. m.Amap = make(map[int32]string)
  1841. }
  1842. var mapkey int32
  1843. var mapvalue string
  1844. for iNdEx < postIndex {
  1845. entryPreIndex := iNdEx
  1846. var wire uint64
  1847. for shift := uint(0); ; shift += 7 {
  1848. if shift >= 64 {
  1849. return ErrIntOverflowDemo
  1850. }
  1851. if iNdEx >= l {
  1852. return io.ErrUnexpectedEOF
  1853. }
  1854. b := dAtA[iNdEx]
  1855. iNdEx++
  1856. wire |= (uint64(b) & 0x7F) << shift
  1857. if b < 0x80 {
  1858. break
  1859. }
  1860. }
  1861. fieldNum := int32(wire >> 3)
  1862. if fieldNum == 1 {
  1863. for shift := uint(0); ; shift += 7 {
  1864. if shift >= 64 {
  1865. return ErrIntOverflowDemo
  1866. }
  1867. if iNdEx >= l {
  1868. return io.ErrUnexpectedEOF
  1869. }
  1870. b := dAtA[iNdEx]
  1871. iNdEx++
  1872. mapkey |= (int32(b) & 0x7F) << shift
  1873. if b < 0x80 {
  1874. break
  1875. }
  1876. }
  1877. } else if fieldNum == 2 {
  1878. var stringLenmapvalue uint64
  1879. for shift := uint(0); ; shift += 7 {
  1880. if shift >= 64 {
  1881. return ErrIntOverflowDemo
  1882. }
  1883. if iNdEx >= l {
  1884. return io.ErrUnexpectedEOF
  1885. }
  1886. b := dAtA[iNdEx]
  1887. iNdEx++
  1888. stringLenmapvalue |= (uint64(b) & 0x7F) << shift
  1889. if b < 0x80 {
  1890. break
  1891. }
  1892. }
  1893. intStringLenmapvalue := int(stringLenmapvalue)
  1894. if intStringLenmapvalue < 0 {
  1895. return ErrInvalidLengthDemo
  1896. }
  1897. postStringIndexmapvalue := iNdEx + intStringLenmapvalue
  1898. if postStringIndexmapvalue > l {
  1899. return io.ErrUnexpectedEOF
  1900. }
  1901. mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue])
  1902. iNdEx = postStringIndexmapvalue
  1903. } else {
  1904. iNdEx = entryPreIndex
  1905. skippy, err := skipDemo(dAtA[iNdEx:])
  1906. if err != nil {
  1907. return err
  1908. }
  1909. if skippy < 0 {
  1910. return ErrInvalidLengthDemo
  1911. }
  1912. if (iNdEx + skippy) > postIndex {
  1913. return io.ErrUnexpectedEOF
  1914. }
  1915. iNdEx += skippy
  1916. }
  1917. }
  1918. m.Amap[mapkey] = mapvalue
  1919. iNdEx = postIndex
  1920. case 5:
  1921. if wireType != 5 {
  1922. return fmt.Errorf("proto: wrong wireType = %d for field Rate", wireType)
  1923. }
  1924. var v uint32
  1925. if (iNdEx + 4) > l {
  1926. return io.ErrUnexpectedEOF
  1927. }
  1928. v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:]))
  1929. iNdEx += 4
  1930. m.Rate = float32(math.Float32frombits(v))
  1931. case 6:
  1932. if wireType != 0 {
  1933. return fmt.Errorf("proto: wrong wireType = %d for field Mid", wireType)
  1934. }
  1935. m.Mid = 0
  1936. for shift := uint(0); ; shift += 7 {
  1937. if shift >= 64 {
  1938. return ErrIntOverflowDemo
  1939. }
  1940. if iNdEx >= l {
  1941. return io.ErrUnexpectedEOF
  1942. }
  1943. b := dAtA[iNdEx]
  1944. iNdEx++
  1945. m.Mid |= (int64(b) & 0x7F) << shift
  1946. if b < 0x80 {
  1947. break
  1948. }
  1949. }
  1950. default:
  1951. iNdEx = preIndex
  1952. skippy, err := skipDemo(dAtA[iNdEx:])
  1953. if err != nil {
  1954. return err
  1955. }
  1956. if skippy < 0 {
  1957. return ErrInvalidLengthDemo
  1958. }
  1959. if (iNdEx + skippy) > l {
  1960. return io.ErrUnexpectedEOF
  1961. }
  1962. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  1963. iNdEx += skippy
  1964. }
  1965. }
  1966. if iNdEx > l {
  1967. return io.ErrUnexpectedEOF
  1968. }
  1969. return nil
  1970. }
  1971. func skipDemo(dAtA []byte) (n int, err error) {
  1972. l := len(dAtA)
  1973. iNdEx := 0
  1974. for iNdEx < l {
  1975. var wire uint64
  1976. for shift := uint(0); ; shift += 7 {
  1977. if shift >= 64 {
  1978. return 0, ErrIntOverflowDemo
  1979. }
  1980. if iNdEx >= l {
  1981. return 0, io.ErrUnexpectedEOF
  1982. }
  1983. b := dAtA[iNdEx]
  1984. iNdEx++
  1985. wire |= (uint64(b) & 0x7F) << shift
  1986. if b < 0x80 {
  1987. break
  1988. }
  1989. }
  1990. wireType := int(wire & 0x7)
  1991. switch wireType {
  1992. case 0:
  1993. for shift := uint(0); ; shift += 7 {
  1994. if shift >= 64 {
  1995. return 0, ErrIntOverflowDemo
  1996. }
  1997. if iNdEx >= l {
  1998. return 0, io.ErrUnexpectedEOF
  1999. }
  2000. iNdEx++
  2001. if dAtA[iNdEx-1] < 0x80 {
  2002. break
  2003. }
  2004. }
  2005. return iNdEx, nil
  2006. case 1:
  2007. iNdEx += 8
  2008. return iNdEx, nil
  2009. case 2:
  2010. var length int
  2011. for shift := uint(0); ; shift += 7 {
  2012. if shift >= 64 {
  2013. return 0, ErrIntOverflowDemo
  2014. }
  2015. if iNdEx >= l {
  2016. return 0, io.ErrUnexpectedEOF
  2017. }
  2018. b := dAtA[iNdEx]
  2019. iNdEx++
  2020. length |= (int(b) & 0x7F) << shift
  2021. if b < 0x80 {
  2022. break
  2023. }
  2024. }
  2025. iNdEx += length
  2026. if length < 0 {
  2027. return 0, ErrInvalidLengthDemo
  2028. }
  2029. return iNdEx, nil
  2030. case 3:
  2031. for {
  2032. var innerWire uint64
  2033. var start int = iNdEx
  2034. for shift := uint(0); ; shift += 7 {
  2035. if shift >= 64 {
  2036. return 0, ErrIntOverflowDemo
  2037. }
  2038. if iNdEx >= l {
  2039. return 0, io.ErrUnexpectedEOF
  2040. }
  2041. b := dAtA[iNdEx]
  2042. iNdEx++
  2043. innerWire |= (uint64(b) & 0x7F) << shift
  2044. if b < 0x80 {
  2045. break
  2046. }
  2047. }
  2048. innerWireType := int(innerWire & 0x7)
  2049. if innerWireType == 4 {
  2050. break
  2051. }
  2052. next, err := skipDemo(dAtA[start:])
  2053. if err != nil {
  2054. return 0, err
  2055. }
  2056. iNdEx = start + next
  2057. }
  2058. return iNdEx, nil
  2059. case 4:
  2060. return iNdEx, nil
  2061. case 5:
  2062. iNdEx += 4
  2063. return iNdEx, nil
  2064. default:
  2065. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  2066. }
  2067. }
  2068. panic("unreachable")
  2069. }
  2070. var (
  2071. ErrInvalidLengthDemo = fmt.Errorf("proto: negative length found during unmarshaling")
  2072. ErrIntOverflowDemo = fmt.Errorf("proto: integer overflow")
  2073. )
  2074. func init() { proto.RegisterFile("demo.proto", fileDescriptor_demo_4b2170f3d67b04fe) }
  2075. var fileDescriptor_demo_4b2170f3d67b04fe = []byte{
  2076. // 704 bytes of a gzipped FileDescriptorProto
  2077. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0x4b, 0x6b, 0xdb, 0x4a,
  2078. 0x14, 0x46, 0x96, 0x9f, 0x27, 0x37, 0xf7, 0x86, 0xb9, 0x77, 0xe1, 0x88, 0xdc, 0x48, 0x88, 0xd2,
  2079. 0x9a, 0x3e, 0x24, 0xec, 0xa4, 0xb4, 0x04, 0xfa, 0x12, 0x8d, 0xd3, 0x40, 0x57, 0x43, 0x17, 0xa5,
  2080. 0x1b, 0x31, 0xb6, 0xc6, 0xce, 0x50, 0x49, 0x63, 0xeb, 0xe1, 0xd6, 0x94, 0x6e, 0xfa, 0x17, 0xfa,
  2081. 0x43, 0xba, 0xec, 0x5f, 0xe8, 0xb2, 0xd0, 0xbd, 0x28, 0xa1, 0x50, 0xf0, 0x32, 0xbf, 0xa0, 0xcc,
  2082. 0x8c, 0x93, 0x9a, 0x14, 0x27, 0xc5, 0xdd, 0x9c, 0x33, 0x73, 0x1e, 0xdf, 0x99, 0x73, 0xbe, 0xc3,
  2083. 0x00, 0x04, 0x34, 0xe2, 0xce, 0x28, 0xe1, 0x19, 0x47, 0x1b, 0x21, 0x9b, 0x50, 0x47, 0x08, 0x69,
  2084. 0x9c, 0xb4, 0x8d, 0x5b, 0x43, 0x96, 0x1d, 0xe5, 0x3d, 0xa7, 0xcf, 0x23, 0x77, 0xc8, 0x87, 0xdc,
  2085. 0x95, 0x81, 0xbd, 0x7c, 0x20, 0x6f, 0xf2, 0x22, 0x4f, 0x0a, 0xc0, 0xd8, 0x1a, 0x72, 0x3e, 0x0c,
  2086. 0xa9, 0x4b, 0x46, 0xcc, 0x25, 0x71, 0xcc, 0x33, 0x92, 0x31, 0x1e, 0xa7, 0xca, 0x6b, 0xdf, 0x80,
  2087. 0x9a, 0x47, 0x92, 0x36, 0xa6, 0x63, 0x64, 0x81, 0x9e, 0xb3, 0xa0, 0xa9, 0x59, 0x5a, 0xab, 0xe2,
  2088. 0xfd, 0x7d, 0x52, 0x98, 0x30, 0xe0, 0x49, 0xb4, 0x67, 0xe7, 0x2c, 0xb0, 0xb1, 0x70, 0xd9, 0x1f,
  2089. 0x74, 0xa8, 0xab, 0xe8, 0x74, 0x84, 0x4c, 0xa8, 0xe4, 0x31, 0x89, 0x68, 0xb3, 0x64, 0x69, 0xad,
  2090. 0x86, 0xd7, 0x98, 0x15, 0xa6, 0x32, 0x60, 0xa5, 0xd0, 0x26, 0xe8, 0x2c, 0x48, 0x9b, 0xba, 0xa5,
  2091. 0xb7, 0x2a, 0x5e, 0x6d, 0x56, 0x98, 0xe2, 0x8a, 0x85, 0x40, 0xf7, 0xa0, 0x1c, 0xb2, 0x34, 0x6b,
  2092. 0x96, 0x2d, 0xbd, 0xb5, 0xd6, 0x31, 0x9d, 0xf3, 0x3d, 0x3a, 0xa7, 0x55, 0x9c, 0xa7, 0x2c, 0xcd,
  2093. 0xbc, 0xfa, 0xac, 0x30, 0x65, 0x02, 0x96, 0x12, 0x3d, 0x84, 0x0a, 0x91, 0xf9, 0x15, 0x4b, 0xfb,
  2094. 0x9d, 0x7c, 0xf9, 0x36, 0x99, 0x81, 0x95, 0x42, 0x1e, 0x94, 0x49, 0x44, 0x46, 0xcd, 0xaa, 0x7c,
  2095. 0xc0, 0x95, 0x0b, 0x00, 0x1e, 0x45, 0x64, 0xb4, 0x1f, 0x67, 0xc9, 0x54, 0xbd, 0x42, 0x64, 0x61,
  2096. 0x29, 0x8d, 0x27, 0x50, 0x16, 0xe8, 0x62, 0x10, 0x47, 0x34, 0x0c, 0xb9, 0x9c, 0xdc, 0x7c, 0x10,
  2097. 0xd2, 0x80, 0x95, 0x12, 0x01, 0xaf, 0x78, 0x12, 0x06, 0x8b, 0x93, 0x92, 0x06, 0xac, 0x94, 0xf1,
  2098. 0x1c, 0x1a, 0x67, 0x65, 0xd0, 0x06, 0xe8, 0x2f, 0xe9, 0x54, 0x81, 0x61, 0x71, 0x44, 0xb7, 0xa1,
  2099. 0x32, 0x21, 0x61, 0xae, 0x26, 0x7d, 0x79, 0xbb, 0x58, 0x45, 0xef, 0x95, 0xee, 0x6a, 0xf6, 0x5b,
  2100. 0x80, 0x03, 0x9a, 0x1d, 0xc6, 0x03, 0x2e, 0x18, 0x7e, 0x00, 0xb5, 0x84, 0xf3, 0xc8, 0x9f, 0xb3,
  2101. 0xac, 0x7b, 0x57, 0x4f, 0x0a, 0xd3, 0x56, 0x2c, 0xcf, 0x1d, 0xb6, 0x35, 0x21, 0x21, 0x0b, 0x48,
  2102. 0x46, 0xf7, 0xec, 0x84, 0x8e, 0x73, 0x96, 0xd0, 0xc0, 0xc6, 0x55, 0xe1, 0x3d, 0x0c, 0x90, 0x03,
  2103. 0xf5, 0x88, 0xc4, 0x53, 0x5f, 0xf0, 0x5a, 0xb2, 0xf4, 0x96, 0xee, 0xfd, 0x7b, 0x52, 0x98, 0xff,
  2104. 0x28, 0x84, 0x53, 0x8f, 0x8d, 0x6b, 0xe2, 0x78, 0x18, 0xa4, 0xf6, 0xc7, 0x12, 0xac, 0x9d, 0xd5,
  2105. 0x4f, 0x47, 0xc8, 0x06, 0x89, 0x74, 0x56, 0x1f, 0x66, 0x85, 0x39, 0xb7, 0xe0, 0xb9, 0xbe, 0x7c,
  2106. 0xaf, 0xae, 0x43, 0x43, 0xf4, 0xee, 0x67, 0x2c, 0xa2, 0x4d, 0x5d, 0x06, 0xad, 0xcf, 0x0a, 0xf3,
  2107. 0xa7, 0x11, 0xd7, 0xc5, 0xf1, 0x19, 0x8b, 0x28, 0xda, 0x9f, 0xf3, 0xac, 0x16, 0xed, 0xda, 0xaf,
  2108. 0x93, 0x5b, 0x78, 0xdd, 0x72, 0xaa, 0xd1, 0x16, 0x94, 0x13, 0x92, 0x51, 0xb9, 0x6f, 0x25, 0xe5,
  2109. 0x15, 0x77, 0x2c, 0xa5, 0x58, 0x74, 0xd1, 0x52, 0x55, 0xb6, 0x24, 0x17, 0x5d, 0xf4, 0x23, 0x84,
  2110. 0x71, 0x67, 0x09, 0xb3, 0x15, 0xc5, 0xec, 0x7f, 0x8b, 0xcc, 0x36, 0x16, 0x88, 0xeb, 0x7c, 0xd7,
  2111. 0x41, 0xef, 0x72, 0x8e, 0xde, 0xc0, 0x5f, 0xb2, 0x6b, 0xbf, 0x37, 0xf5, 0x73, 0x16, 0xa0, 0xcd,
  2112. 0x65, 0xe4, 0x8f, 0x0d, 0x63, 0xf9, 0x5e, 0xd8, 0xbb, 0xef, 0xbe, 0x7c, 0x7b, 0x5f, 0x72, 0xd0,
  2113. 0x4d, 0xf7, 0xb5, 0xf0, 0xbb, 0x22, 0xc0, 0x9d, 0xb4, 0xdd, 0x01, 0xe7, 0xee, 0x22, 0xbe, 0xdf,
  2114. 0xcf, 0xd3, 0x8c, 0x47, 0x7e, 0xc2, 0xf3, 0x8c, 0xa2, 0x03, 0xa8, 0x0f, 0x69, 0xe6, 0xb3, 0x78,
  2115. 0xc0, 0xd1, 0xd6, 0x05, 0xb3, 0x1b, 0x1b, 0xff, 0x5f, 0x38, 0x59, 0xd4, 0x85, 0xf5, 0xc5, 0x2a,
  2116. 0x3b, 0x2b, 0xb6, 0x71, 0x1e, 0x67, 0x77, 0x55, 0x9c, 0xc7, 0xb0, 0x26, 0x1a, 0x0b, 0xa6, 0x31,
  2117. 0x89, 0x58, 0xff, 0x0f, 0x50, 0x62, 0xce, 0xe2, 0x8c, 0x26, 0x03, 0xd2, 0xa7, 0x2b, 0xa2, 0x74,
  2118. 0xba, 0x50, 0xee, 0x72, 0xde, 0x41, 0xf7, 0xe7, 0xdf, 0xc8, 0x8a, 0x38, 0xde, 0xc6, 0xa7, 0xe3,
  2119. 0x6d, 0xed, 0xf3, 0xf1, 0xb6, 0xf6, 0xf5, 0x78, 0x5b, 0x7b, 0x51, 0x9a, 0xb4, 0x7b, 0x55, 0xf9,
  2120. 0xc5, 0xef, 0xfc, 0x08, 0x00, 0x00, 0xff, 0xff, 0xa2, 0xe5, 0x8c, 0xeb, 0x4f, 0x06, 0x00, 0x00,
  2121. }