local.pb.go 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398
  1. // Code generated by protoc-gen-gogo.
  2. // source: local.proto
  3. // DO NOT EDIT!
  4. /*
  5. Package discover is a generated protocol buffer package.
  6. It is generated from these files:
  7. local.proto
  8. It has these top-level messages:
  9. Announce
  10. */
  11. package discover
  12. import proto "github.com/gogo/protobuf/proto"
  13. import fmt "fmt"
  14. import math "math"
  15. import _ "github.com/gogo/protobuf/gogoproto"
  16. import io "io"
  17. // Reference imports to suppress errors if they are not otherwise used.
  18. var _ = proto.Marshal
  19. var _ = fmt.Errorf
  20. var _ = math.Inf
  21. // This is a compile-time assertion to ensure that this generated file
  22. // is compatible with the proto package it is being compiled against.
  23. const _ = proto.GoGoProtoPackageIsVersion1
  24. type Announce struct {
  25. ID []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
  26. Addresses []string `protobuf:"bytes,2,rep,name=addresses" json:"addresses,omitempty"`
  27. InstanceID int64 `protobuf:"varint,3,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"`
  28. }
  29. func (m *Announce) Reset() { *m = Announce{} }
  30. func (m *Announce) String() string { return proto.CompactTextString(m) }
  31. func (*Announce) ProtoMessage() {}
  32. func (*Announce) Descriptor() ([]byte, []int) { return fileDescriptorLocal, []int{0} }
  33. func init() {
  34. proto.RegisterType((*Announce)(nil), "discover.Announce")
  35. }
  36. func (m *Announce) Marshal() (data []byte, err error) {
  37. size := m.ProtoSize()
  38. data = make([]byte, size)
  39. n, err := m.MarshalTo(data)
  40. if err != nil {
  41. return nil, err
  42. }
  43. return data[:n], nil
  44. }
  45. func (m *Announce) MarshalTo(data []byte) (int, error) {
  46. var i int
  47. _ = i
  48. var l int
  49. _ = l
  50. if len(m.ID) > 0 {
  51. data[i] = 0xa
  52. i++
  53. i = encodeVarintLocal(data, i, uint64(len(m.ID)))
  54. i += copy(data[i:], m.ID)
  55. }
  56. if len(m.Addresses) > 0 {
  57. for _, s := range m.Addresses {
  58. data[i] = 0x12
  59. i++
  60. l = len(s)
  61. for l >= 1<<7 {
  62. data[i] = uint8(uint64(l)&0x7f | 0x80)
  63. l >>= 7
  64. i++
  65. }
  66. data[i] = uint8(l)
  67. i++
  68. i += copy(data[i:], s)
  69. }
  70. }
  71. if m.InstanceID != 0 {
  72. data[i] = 0x18
  73. i++
  74. i = encodeVarintLocal(data, i, uint64(m.InstanceID))
  75. }
  76. return i, nil
  77. }
  78. func encodeFixed64Local(data []byte, offset int, v uint64) int {
  79. data[offset] = uint8(v)
  80. data[offset+1] = uint8(v >> 8)
  81. data[offset+2] = uint8(v >> 16)
  82. data[offset+3] = uint8(v >> 24)
  83. data[offset+4] = uint8(v >> 32)
  84. data[offset+5] = uint8(v >> 40)
  85. data[offset+6] = uint8(v >> 48)
  86. data[offset+7] = uint8(v >> 56)
  87. return offset + 8
  88. }
  89. func encodeFixed32Local(data []byte, offset int, v uint32) int {
  90. data[offset] = uint8(v)
  91. data[offset+1] = uint8(v >> 8)
  92. data[offset+2] = uint8(v >> 16)
  93. data[offset+3] = uint8(v >> 24)
  94. return offset + 4
  95. }
  96. func encodeVarintLocal(data []byte, offset int, v uint64) int {
  97. for v >= 1<<7 {
  98. data[offset] = uint8(v&0x7f | 0x80)
  99. v >>= 7
  100. offset++
  101. }
  102. data[offset] = uint8(v)
  103. return offset + 1
  104. }
  105. func (m *Announce) ProtoSize() (n int) {
  106. var l int
  107. _ = l
  108. l = len(m.ID)
  109. if l > 0 {
  110. n += 1 + l + sovLocal(uint64(l))
  111. }
  112. if len(m.Addresses) > 0 {
  113. for _, s := range m.Addresses {
  114. l = len(s)
  115. n += 1 + l + sovLocal(uint64(l))
  116. }
  117. }
  118. if m.InstanceID != 0 {
  119. n += 1 + sovLocal(uint64(m.InstanceID))
  120. }
  121. return n
  122. }
  123. func sovLocal(x uint64) (n int) {
  124. for {
  125. n++
  126. x >>= 7
  127. if x == 0 {
  128. break
  129. }
  130. }
  131. return n
  132. }
  133. func sozLocal(x uint64) (n int) {
  134. return sovLocal(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  135. }
  136. func (m *Announce) Unmarshal(data []byte) error {
  137. l := len(data)
  138. iNdEx := 0
  139. for iNdEx < l {
  140. preIndex := iNdEx
  141. var wire uint64
  142. for shift := uint(0); ; shift += 7 {
  143. if shift >= 64 {
  144. return ErrIntOverflowLocal
  145. }
  146. if iNdEx >= l {
  147. return io.ErrUnexpectedEOF
  148. }
  149. b := data[iNdEx]
  150. iNdEx++
  151. wire |= (uint64(b) & 0x7F) << shift
  152. if b < 0x80 {
  153. break
  154. }
  155. }
  156. fieldNum := int32(wire >> 3)
  157. wireType := int(wire & 0x7)
  158. if wireType == 4 {
  159. return fmt.Errorf("proto: Announce: wiretype end group for non-group")
  160. }
  161. if fieldNum <= 0 {
  162. return fmt.Errorf("proto: Announce: illegal tag %d (wire type %d)", fieldNum, wire)
  163. }
  164. switch fieldNum {
  165. case 1:
  166. if wireType != 2 {
  167. return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
  168. }
  169. var byteLen int
  170. for shift := uint(0); ; shift += 7 {
  171. if shift >= 64 {
  172. return ErrIntOverflowLocal
  173. }
  174. if iNdEx >= l {
  175. return io.ErrUnexpectedEOF
  176. }
  177. b := data[iNdEx]
  178. iNdEx++
  179. byteLen |= (int(b) & 0x7F) << shift
  180. if b < 0x80 {
  181. break
  182. }
  183. }
  184. if byteLen < 0 {
  185. return ErrInvalidLengthLocal
  186. }
  187. postIndex := iNdEx + byteLen
  188. if postIndex > l {
  189. return io.ErrUnexpectedEOF
  190. }
  191. m.ID = append(m.ID[:0], data[iNdEx:postIndex]...)
  192. if m.ID == nil {
  193. m.ID = []byte{}
  194. }
  195. iNdEx = postIndex
  196. case 2:
  197. if wireType != 2 {
  198. return fmt.Errorf("proto: wrong wireType = %d for field Addresses", wireType)
  199. }
  200. var stringLen uint64
  201. for shift := uint(0); ; shift += 7 {
  202. if shift >= 64 {
  203. return ErrIntOverflowLocal
  204. }
  205. if iNdEx >= l {
  206. return io.ErrUnexpectedEOF
  207. }
  208. b := data[iNdEx]
  209. iNdEx++
  210. stringLen |= (uint64(b) & 0x7F) << shift
  211. if b < 0x80 {
  212. break
  213. }
  214. }
  215. intStringLen := int(stringLen)
  216. if intStringLen < 0 {
  217. return ErrInvalidLengthLocal
  218. }
  219. postIndex := iNdEx + intStringLen
  220. if postIndex > l {
  221. return io.ErrUnexpectedEOF
  222. }
  223. m.Addresses = append(m.Addresses, string(data[iNdEx:postIndex]))
  224. iNdEx = postIndex
  225. case 3:
  226. if wireType != 0 {
  227. return fmt.Errorf("proto: wrong wireType = %d for field InstanceID", wireType)
  228. }
  229. m.InstanceID = 0
  230. for shift := uint(0); ; shift += 7 {
  231. if shift >= 64 {
  232. return ErrIntOverflowLocal
  233. }
  234. if iNdEx >= l {
  235. return io.ErrUnexpectedEOF
  236. }
  237. b := data[iNdEx]
  238. iNdEx++
  239. m.InstanceID |= (int64(b) & 0x7F) << shift
  240. if b < 0x80 {
  241. break
  242. }
  243. }
  244. default:
  245. iNdEx = preIndex
  246. skippy, err := skipLocal(data[iNdEx:])
  247. if err != nil {
  248. return err
  249. }
  250. if skippy < 0 {
  251. return ErrInvalidLengthLocal
  252. }
  253. if (iNdEx + skippy) > l {
  254. return io.ErrUnexpectedEOF
  255. }
  256. iNdEx += skippy
  257. }
  258. }
  259. if iNdEx > l {
  260. return io.ErrUnexpectedEOF
  261. }
  262. return nil
  263. }
  264. func skipLocal(data []byte) (n int, err error) {
  265. l := len(data)
  266. iNdEx := 0
  267. for iNdEx < l {
  268. var wire uint64
  269. for shift := uint(0); ; shift += 7 {
  270. if shift >= 64 {
  271. return 0, ErrIntOverflowLocal
  272. }
  273. if iNdEx >= l {
  274. return 0, io.ErrUnexpectedEOF
  275. }
  276. b := data[iNdEx]
  277. iNdEx++
  278. wire |= (uint64(b) & 0x7F) << shift
  279. if b < 0x80 {
  280. break
  281. }
  282. }
  283. wireType := int(wire & 0x7)
  284. switch wireType {
  285. case 0:
  286. for shift := uint(0); ; shift += 7 {
  287. if shift >= 64 {
  288. return 0, ErrIntOverflowLocal
  289. }
  290. if iNdEx >= l {
  291. return 0, io.ErrUnexpectedEOF
  292. }
  293. iNdEx++
  294. if data[iNdEx-1] < 0x80 {
  295. break
  296. }
  297. }
  298. return iNdEx, nil
  299. case 1:
  300. iNdEx += 8
  301. return iNdEx, nil
  302. case 2:
  303. var length int
  304. for shift := uint(0); ; shift += 7 {
  305. if shift >= 64 {
  306. return 0, ErrIntOverflowLocal
  307. }
  308. if iNdEx >= l {
  309. return 0, io.ErrUnexpectedEOF
  310. }
  311. b := data[iNdEx]
  312. iNdEx++
  313. length |= (int(b) & 0x7F) << shift
  314. if b < 0x80 {
  315. break
  316. }
  317. }
  318. iNdEx += length
  319. if length < 0 {
  320. return 0, ErrInvalidLengthLocal
  321. }
  322. return iNdEx, nil
  323. case 3:
  324. for {
  325. var innerWire uint64
  326. var start int = iNdEx
  327. for shift := uint(0); ; shift += 7 {
  328. if shift >= 64 {
  329. return 0, ErrIntOverflowLocal
  330. }
  331. if iNdEx >= l {
  332. return 0, io.ErrUnexpectedEOF
  333. }
  334. b := data[iNdEx]
  335. iNdEx++
  336. innerWire |= (uint64(b) & 0x7F) << shift
  337. if b < 0x80 {
  338. break
  339. }
  340. }
  341. innerWireType := int(innerWire & 0x7)
  342. if innerWireType == 4 {
  343. break
  344. }
  345. next, err := skipLocal(data[start:])
  346. if err != nil {
  347. return 0, err
  348. }
  349. iNdEx = start + next
  350. }
  351. return iNdEx, nil
  352. case 4:
  353. return iNdEx, nil
  354. case 5:
  355. iNdEx += 4
  356. return iNdEx, nil
  357. default:
  358. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  359. }
  360. }
  361. panic("unreachable")
  362. }
  363. var (
  364. ErrInvalidLengthLocal = fmt.Errorf("proto: negative length found during unmarshaling")
  365. ErrIntOverflowLocal = fmt.Errorf("proto: integer overflow")
  366. )
  367. var fileDescriptorLocal = []byte{
  368. // 194 bytes of a gzipped FileDescriptorProto
  369. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0xce, 0xc9, 0x4f, 0x4e,
  370. 0xcc, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x48, 0xc9, 0x2c, 0x4e, 0xce, 0x2f, 0x4b,
  371. 0x2d, 0x92, 0xd2, 0x4d, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xcf,
  372. 0x4f, 0xcf, 0xd7, 0x07, 0x2b, 0x48, 0x2a, 0x4d, 0x03, 0xf3, 0xc0, 0x1c, 0x30, 0x0b, 0xa2, 0x51,
  373. 0xa9, 0x90, 0x8b, 0xc3, 0x31, 0x2f, 0x2f, 0xbf, 0x34, 0x2f, 0x39, 0x55, 0x48, 0x8c, 0x8b, 0x29,
  374. 0x33, 0x45, 0x82, 0x51, 0x81, 0x51, 0x83, 0xc7, 0x89, 0xed, 0xd1, 0x3d, 0x79, 0x26, 0x4f, 0x97,
  375. 0x20, 0xa0, 0x88, 0x90, 0x0c, 0x17, 0x67, 0x62, 0x4a, 0x4a, 0x51, 0x6a, 0x71, 0x71, 0x6a, 0xb1,
  376. 0x04, 0x93, 0x02, 0xb3, 0x06, 0x67, 0x10, 0x42, 0x40, 0x48, 0x9f, 0x8b, 0x3b, 0x33, 0xaf, 0xb8,
  377. 0x24, 0x11, 0x68, 0x42, 0x3c, 0x50, 0x3b, 0x33, 0x50, 0x3b, 0xb3, 0x13, 0x1f, 0x50, 0x3b, 0x97,
  378. 0x27, 0x54, 0x18, 0x68, 0x0c, 0x17, 0x4c, 0x89, 0x67, 0x8a, 0x93, 0xc8, 0x89, 0x87, 0x72, 0x0c,
  379. 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x00, 0xe2, 0x07, 0x8f, 0xe4, 0x18, 0x16, 0x3c, 0x96, 0x63, 0x4c,
  380. 0x62, 0x03, 0xbb, 0xc7, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x91, 0x3f, 0x96, 0x25, 0xd7, 0x00,
  381. 0x00, 0x00,
  382. }