snap.pb.go 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  1. // Code generated by protoc-gen-gogo.
  2. // source: snap.proto
  3. // DO NOT EDIT!
  4. /*
  5. Package snappb is a generated protocol buffer package.
  6. It is generated from these files:
  7. snap.proto
  8. It has these top-level messages:
  9. Snapshot
  10. */
  11. package snappb
  12. import (
  13. "fmt"
  14. proto "github.com/golang/protobuf/proto"
  15. math "math"
  16. io "io"
  17. )
  18. // Reference imports to suppress errors if they are not otherwise used.
  19. var _ = proto.Marshal
  20. var _ = fmt.Errorf
  21. var _ = math.Inf
  22. // This is a compile-time assertion to ensure that this generated file
  23. // is compatible with the proto package it is being compiled against.
  24. // A compilation error at this line likely means your copy of the
  25. // proto package needs to be updated.
  26. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
  27. type Snapshot struct {
  28. Crc uint32 `protobuf:"varint,1,opt,name=crc" json:"crc"`
  29. Data []byte `protobuf:"bytes,2,opt,name=data" json:"data,omitempty"`
  30. XXX_unrecognized []byte `json:"-"`
  31. }
  32. func (m *Snapshot) Reset() { *m = Snapshot{} }
  33. func (m *Snapshot) String() string { return proto.CompactTextString(m) }
  34. func (*Snapshot) ProtoMessage() {}
  35. func (*Snapshot) Descriptor() ([]byte, []int) { return fileDescriptorSnap, []int{0} }
  36. func init() {
  37. proto.RegisterType((*Snapshot)(nil), "snappb.snapshot")
  38. }
  39. func (m *Snapshot) Marshal() (dAtA []byte, err error) {
  40. size := m.Size()
  41. dAtA = make([]byte, size)
  42. n, err := m.MarshalTo(dAtA)
  43. if err != nil {
  44. return nil, err
  45. }
  46. return dAtA[:n], nil
  47. }
  48. func (m *Snapshot) MarshalTo(dAtA []byte) (int, error) {
  49. var i int
  50. _ = i
  51. var l int
  52. _ = l
  53. dAtA[i] = 0x8
  54. i++
  55. i = encodeVarintSnap(dAtA, i, uint64(m.Crc))
  56. if m.Data != nil {
  57. dAtA[i] = 0x12
  58. i++
  59. i = encodeVarintSnap(dAtA, i, uint64(len(m.Data)))
  60. i += copy(dAtA[i:], m.Data)
  61. }
  62. if m.XXX_unrecognized != nil {
  63. i += copy(dAtA[i:], m.XXX_unrecognized)
  64. }
  65. return i, nil
  66. }
  67. func encodeFixed64Snap(dAtA []byte, offset int, v uint64) int {
  68. dAtA[offset] = uint8(v)
  69. dAtA[offset+1] = uint8(v >> 8)
  70. dAtA[offset+2] = uint8(v >> 16)
  71. dAtA[offset+3] = uint8(v >> 24)
  72. dAtA[offset+4] = uint8(v >> 32)
  73. dAtA[offset+5] = uint8(v >> 40)
  74. dAtA[offset+6] = uint8(v >> 48)
  75. dAtA[offset+7] = uint8(v >> 56)
  76. return offset + 8
  77. }
  78. func encodeFixed32Snap(dAtA []byte, offset int, v uint32) 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. return offset + 4
  84. }
  85. func encodeVarintSnap(dAtA []byte, offset int, v uint64) int {
  86. for v >= 1<<7 {
  87. dAtA[offset] = uint8(v&0x7f | 0x80)
  88. v >>= 7
  89. offset++
  90. }
  91. dAtA[offset] = uint8(v)
  92. return offset + 1
  93. }
  94. func (m *Snapshot) Size() (n int) {
  95. var l int
  96. _ = l
  97. n += 1 + sovSnap(uint64(m.Crc))
  98. if m.Data != nil {
  99. l = len(m.Data)
  100. n += 1 + l + sovSnap(uint64(l))
  101. }
  102. if m.XXX_unrecognized != nil {
  103. n += len(m.XXX_unrecognized)
  104. }
  105. return n
  106. }
  107. func sovSnap(x uint64) (n int) {
  108. for {
  109. n++
  110. x >>= 7
  111. if x == 0 {
  112. break
  113. }
  114. }
  115. return n
  116. }
  117. func sozSnap(x uint64) (n int) {
  118. return sovSnap(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  119. }
  120. func (m *Snapshot) Unmarshal(dAtA []byte) error {
  121. l := len(dAtA)
  122. iNdEx := 0
  123. for iNdEx < l {
  124. preIndex := iNdEx
  125. var wire uint64
  126. for shift := uint(0); ; shift += 7 {
  127. if shift >= 64 {
  128. return ErrIntOverflowSnap
  129. }
  130. if iNdEx >= l {
  131. return io.ErrUnexpectedEOF
  132. }
  133. b := dAtA[iNdEx]
  134. iNdEx++
  135. wire |= (uint64(b) & 0x7F) << shift
  136. if b < 0x80 {
  137. break
  138. }
  139. }
  140. fieldNum := int32(wire >> 3)
  141. wireType := int(wire & 0x7)
  142. if wireType == 4 {
  143. return fmt.Errorf("proto: snapshot: wiretype end group for non-group")
  144. }
  145. if fieldNum <= 0 {
  146. return fmt.Errorf("proto: snapshot: illegal tag %d (wire type %d)", fieldNum, wire)
  147. }
  148. switch fieldNum {
  149. case 1:
  150. if wireType != 0 {
  151. return fmt.Errorf("proto: wrong wireType = %d for field Crc", wireType)
  152. }
  153. m.Crc = 0
  154. for shift := uint(0); ; shift += 7 {
  155. if shift >= 64 {
  156. return ErrIntOverflowSnap
  157. }
  158. if iNdEx >= l {
  159. return io.ErrUnexpectedEOF
  160. }
  161. b := dAtA[iNdEx]
  162. iNdEx++
  163. m.Crc |= (uint32(b) & 0x7F) << shift
  164. if b < 0x80 {
  165. break
  166. }
  167. }
  168. case 2:
  169. if wireType != 2 {
  170. return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType)
  171. }
  172. var byteLen int
  173. for shift := uint(0); ; shift += 7 {
  174. if shift >= 64 {
  175. return ErrIntOverflowSnap
  176. }
  177. if iNdEx >= l {
  178. return io.ErrUnexpectedEOF
  179. }
  180. b := dAtA[iNdEx]
  181. iNdEx++
  182. byteLen |= (int(b) & 0x7F) << shift
  183. if b < 0x80 {
  184. break
  185. }
  186. }
  187. if byteLen < 0 {
  188. return ErrInvalidLengthSnap
  189. }
  190. postIndex := iNdEx + byteLen
  191. if postIndex > l {
  192. return io.ErrUnexpectedEOF
  193. }
  194. m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...)
  195. if m.Data == nil {
  196. m.Data = []byte{}
  197. }
  198. iNdEx = postIndex
  199. default:
  200. iNdEx = preIndex
  201. skippy, err := skipSnap(dAtA[iNdEx:])
  202. if err != nil {
  203. return err
  204. }
  205. if skippy < 0 {
  206. return ErrInvalidLengthSnap
  207. }
  208. if (iNdEx + skippy) > l {
  209. return io.ErrUnexpectedEOF
  210. }
  211. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  212. iNdEx += skippy
  213. }
  214. }
  215. if iNdEx > l {
  216. return io.ErrUnexpectedEOF
  217. }
  218. return nil
  219. }
  220. func skipSnap(dAtA []byte) (n int, err error) {
  221. l := len(dAtA)
  222. iNdEx := 0
  223. for iNdEx < l {
  224. var wire uint64
  225. for shift := uint(0); ; shift += 7 {
  226. if shift >= 64 {
  227. return 0, ErrIntOverflowSnap
  228. }
  229. if iNdEx >= l {
  230. return 0, io.ErrUnexpectedEOF
  231. }
  232. b := dAtA[iNdEx]
  233. iNdEx++
  234. wire |= (uint64(b) & 0x7F) << shift
  235. if b < 0x80 {
  236. break
  237. }
  238. }
  239. wireType := int(wire & 0x7)
  240. switch wireType {
  241. case 0:
  242. for shift := uint(0); ; shift += 7 {
  243. if shift >= 64 {
  244. return 0, ErrIntOverflowSnap
  245. }
  246. if iNdEx >= l {
  247. return 0, io.ErrUnexpectedEOF
  248. }
  249. iNdEx++
  250. if dAtA[iNdEx-1] < 0x80 {
  251. break
  252. }
  253. }
  254. return iNdEx, nil
  255. case 1:
  256. iNdEx += 8
  257. return iNdEx, nil
  258. case 2:
  259. var length int
  260. for shift := uint(0); ; shift += 7 {
  261. if shift >= 64 {
  262. return 0, ErrIntOverflowSnap
  263. }
  264. if iNdEx >= l {
  265. return 0, io.ErrUnexpectedEOF
  266. }
  267. b := dAtA[iNdEx]
  268. iNdEx++
  269. length |= (int(b) & 0x7F) << shift
  270. if b < 0x80 {
  271. break
  272. }
  273. }
  274. iNdEx += length
  275. if length < 0 {
  276. return 0, ErrInvalidLengthSnap
  277. }
  278. return iNdEx, nil
  279. case 3:
  280. for {
  281. var innerWire uint64
  282. var start int = iNdEx
  283. for shift := uint(0); ; shift += 7 {
  284. if shift >= 64 {
  285. return 0, ErrIntOverflowSnap
  286. }
  287. if iNdEx >= l {
  288. return 0, io.ErrUnexpectedEOF
  289. }
  290. b := dAtA[iNdEx]
  291. iNdEx++
  292. innerWire |= (uint64(b) & 0x7F) << shift
  293. if b < 0x80 {
  294. break
  295. }
  296. }
  297. innerWireType := int(innerWire & 0x7)
  298. if innerWireType == 4 {
  299. break
  300. }
  301. next, err := skipSnap(dAtA[start:])
  302. if err != nil {
  303. return 0, err
  304. }
  305. iNdEx = start + next
  306. }
  307. return iNdEx, nil
  308. case 4:
  309. return iNdEx, nil
  310. case 5:
  311. iNdEx += 4
  312. return iNdEx, nil
  313. default:
  314. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  315. }
  316. }
  317. panic("unreachable")
  318. }
  319. var (
  320. ErrInvalidLengthSnap = fmt.Errorf("proto: negative length found during unmarshaling")
  321. ErrIntOverflowSnap = fmt.Errorf("proto: integer overflow")
  322. )
  323. func init() { proto.RegisterFile("snap.proto", fileDescriptorSnap) }
  324. var fileDescriptorSnap = []byte{
  325. // 126 bytes of a gzipped FileDescriptorProto
  326. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0x2a, 0xce, 0x4b, 0x2c,
  327. 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x03, 0xb1, 0x0b, 0x92, 0xa4, 0x44, 0xd2, 0xf3,
  328. 0xd3, 0xf3, 0xc1, 0x42, 0xfa, 0x20, 0x16, 0x44, 0x56, 0xc9, 0x8c, 0x8b, 0x03, 0x24, 0x5f, 0x9c,
  329. 0x91, 0x5f, 0x22, 0x24, 0xc6, 0xc5, 0x9c, 0x5c, 0x94, 0x2c, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0xeb,
  330. 0xc4, 0x72, 0xe2, 0x9e, 0x3c, 0x43, 0x10, 0x48, 0x40, 0x48, 0x88, 0x8b, 0x25, 0x25, 0xb1, 0x24,
  331. 0x51, 0x82, 0x49, 0x81, 0x51, 0x83, 0x27, 0x08, 0xcc, 0x76, 0x12, 0x39, 0xf1, 0x50, 0x8e, 0xe1,
  332. 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf1, 0x58, 0x8e,
  333. 0x01, 0x10, 0x00, 0x00, 0xff, 0xff, 0xd8, 0x0f, 0x32, 0xb2, 0x78, 0x00, 0x00, 0x00,
  334. }