snap.pb.go 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  2. // source: snap.proto
  3. /*
  4. Package snappb is a generated protocol buffer package.
  5. It is generated from these files:
  6. snap.proto
  7. It has these top-level messages:
  8. Snapshot
  9. */
  10. package snappb
  11. import (
  12. "fmt"
  13. proto "github.com/golang/protobuf/proto"
  14. math "math"
  15. _ "github.com/gogo/protobuf/gogoproto"
  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 encodeVarintSnap(dAtA []byte, offset int, v uint64) int {
  68. for v >= 1<<7 {
  69. dAtA[offset] = uint8(v&0x7f | 0x80)
  70. v >>= 7
  71. offset++
  72. }
  73. dAtA[offset] = uint8(v)
  74. return offset + 1
  75. }
  76. func (m *Snapshot) Size() (n int) {
  77. var l int
  78. _ = l
  79. n += 1 + sovSnap(uint64(m.Crc))
  80. if m.Data != nil {
  81. l = len(m.Data)
  82. n += 1 + l + sovSnap(uint64(l))
  83. }
  84. if m.XXX_unrecognized != nil {
  85. n += len(m.XXX_unrecognized)
  86. }
  87. return n
  88. }
  89. func sovSnap(x uint64) (n int) {
  90. for {
  91. n++
  92. x >>= 7
  93. if x == 0 {
  94. break
  95. }
  96. }
  97. return n
  98. }
  99. func sozSnap(x uint64) (n int) {
  100. return sovSnap(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  101. }
  102. func (m *Snapshot) Unmarshal(dAtA []byte) error {
  103. l := len(dAtA)
  104. iNdEx := 0
  105. for iNdEx < l {
  106. preIndex := iNdEx
  107. var wire uint64
  108. for shift := uint(0); ; shift += 7 {
  109. if shift >= 64 {
  110. return ErrIntOverflowSnap
  111. }
  112. if iNdEx >= l {
  113. return io.ErrUnexpectedEOF
  114. }
  115. b := dAtA[iNdEx]
  116. iNdEx++
  117. wire |= (uint64(b) & 0x7F) << shift
  118. if b < 0x80 {
  119. break
  120. }
  121. }
  122. fieldNum := int32(wire >> 3)
  123. wireType := int(wire & 0x7)
  124. if wireType == 4 {
  125. return fmt.Errorf("proto: snapshot: wiretype end group for non-group")
  126. }
  127. if fieldNum <= 0 {
  128. return fmt.Errorf("proto: snapshot: illegal tag %d (wire type %d)", fieldNum, wire)
  129. }
  130. switch fieldNum {
  131. case 1:
  132. if wireType != 0 {
  133. return fmt.Errorf("proto: wrong wireType = %d for field Crc", wireType)
  134. }
  135. m.Crc = 0
  136. for shift := uint(0); ; shift += 7 {
  137. if shift >= 64 {
  138. return ErrIntOverflowSnap
  139. }
  140. if iNdEx >= l {
  141. return io.ErrUnexpectedEOF
  142. }
  143. b := dAtA[iNdEx]
  144. iNdEx++
  145. m.Crc |= (uint32(b) & 0x7F) << shift
  146. if b < 0x80 {
  147. break
  148. }
  149. }
  150. case 2:
  151. if wireType != 2 {
  152. return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType)
  153. }
  154. var byteLen int
  155. for shift := uint(0); ; shift += 7 {
  156. if shift >= 64 {
  157. return ErrIntOverflowSnap
  158. }
  159. if iNdEx >= l {
  160. return io.ErrUnexpectedEOF
  161. }
  162. b := dAtA[iNdEx]
  163. iNdEx++
  164. byteLen |= (int(b) & 0x7F) << shift
  165. if b < 0x80 {
  166. break
  167. }
  168. }
  169. if byteLen < 0 {
  170. return ErrInvalidLengthSnap
  171. }
  172. postIndex := iNdEx + byteLen
  173. if postIndex > l {
  174. return io.ErrUnexpectedEOF
  175. }
  176. m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...)
  177. if m.Data == nil {
  178. m.Data = []byte{}
  179. }
  180. iNdEx = postIndex
  181. default:
  182. iNdEx = preIndex
  183. skippy, err := skipSnap(dAtA[iNdEx:])
  184. if err != nil {
  185. return err
  186. }
  187. if skippy < 0 {
  188. return ErrInvalidLengthSnap
  189. }
  190. if (iNdEx + skippy) > l {
  191. return io.ErrUnexpectedEOF
  192. }
  193. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  194. iNdEx += skippy
  195. }
  196. }
  197. if iNdEx > l {
  198. return io.ErrUnexpectedEOF
  199. }
  200. return nil
  201. }
  202. func skipSnap(dAtA []byte) (n int, err error) {
  203. l := len(dAtA)
  204. iNdEx := 0
  205. for iNdEx < l {
  206. var wire uint64
  207. for shift := uint(0); ; shift += 7 {
  208. if shift >= 64 {
  209. return 0, ErrIntOverflowSnap
  210. }
  211. if iNdEx >= l {
  212. return 0, io.ErrUnexpectedEOF
  213. }
  214. b := dAtA[iNdEx]
  215. iNdEx++
  216. wire |= (uint64(b) & 0x7F) << shift
  217. if b < 0x80 {
  218. break
  219. }
  220. }
  221. wireType := int(wire & 0x7)
  222. switch wireType {
  223. case 0:
  224. for shift := uint(0); ; shift += 7 {
  225. if shift >= 64 {
  226. return 0, ErrIntOverflowSnap
  227. }
  228. if iNdEx >= l {
  229. return 0, io.ErrUnexpectedEOF
  230. }
  231. iNdEx++
  232. if dAtA[iNdEx-1] < 0x80 {
  233. break
  234. }
  235. }
  236. return iNdEx, nil
  237. case 1:
  238. iNdEx += 8
  239. return iNdEx, nil
  240. case 2:
  241. var length int
  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. b := dAtA[iNdEx]
  250. iNdEx++
  251. length |= (int(b) & 0x7F) << shift
  252. if b < 0x80 {
  253. break
  254. }
  255. }
  256. iNdEx += length
  257. if length < 0 {
  258. return 0, ErrInvalidLengthSnap
  259. }
  260. return iNdEx, nil
  261. case 3:
  262. for {
  263. var innerWire uint64
  264. var start int = iNdEx
  265. for shift := uint(0); ; shift += 7 {
  266. if shift >= 64 {
  267. return 0, ErrIntOverflowSnap
  268. }
  269. if iNdEx >= l {
  270. return 0, io.ErrUnexpectedEOF
  271. }
  272. b := dAtA[iNdEx]
  273. iNdEx++
  274. innerWire |= (uint64(b) & 0x7F) << shift
  275. if b < 0x80 {
  276. break
  277. }
  278. }
  279. innerWireType := int(innerWire & 0x7)
  280. if innerWireType == 4 {
  281. break
  282. }
  283. next, err := skipSnap(dAtA[start:])
  284. if err != nil {
  285. return 0, err
  286. }
  287. iNdEx = start + next
  288. }
  289. return iNdEx, nil
  290. case 4:
  291. return iNdEx, nil
  292. case 5:
  293. iNdEx += 4
  294. return iNdEx, nil
  295. default:
  296. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  297. }
  298. }
  299. panic("unreachable")
  300. }
  301. var (
  302. ErrInvalidLengthSnap = fmt.Errorf("proto: negative length found during unmarshaling")
  303. ErrIntOverflowSnap = fmt.Errorf("proto: integer overflow")
  304. )
  305. func init() { proto.RegisterFile("snap.proto", fileDescriptorSnap) }
  306. var fileDescriptorSnap = []byte{
  307. // 126 bytes of a gzipped FileDescriptorProto
  308. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2a, 0xce, 0x4b, 0x2c,
  309. 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x03, 0xb1, 0x0b, 0x92, 0xa4, 0x44, 0xd2, 0xf3,
  310. 0xd3, 0xf3, 0xc1, 0x42, 0xfa, 0x20, 0x16, 0x44, 0x56, 0xc9, 0x8c, 0x8b, 0x03, 0x24, 0x5f, 0x9c,
  311. 0x91, 0x5f, 0x22, 0x24, 0xc6, 0xc5, 0x9c, 0x5c, 0x94, 0x2c, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0xeb,
  312. 0xc4, 0x72, 0xe2, 0x9e, 0x3c, 0x43, 0x10, 0x48, 0x40, 0x48, 0x88, 0x8b, 0x25, 0x25, 0xb1, 0x24,
  313. 0x51, 0x82, 0x49, 0x81, 0x51, 0x83, 0x27, 0x08, 0xcc, 0x76, 0x12, 0x39, 0xf1, 0x50, 0x8e, 0xe1,
  314. 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf1, 0x58, 0x8e,
  315. 0x01, 0x10, 0x00, 0x00, 0xff, 0xff, 0xd8, 0x0f, 0x32, 0xb2, 0x78, 0x00, 0x00, 0x00,
  316. }