snap.pb.go 7.8 KB

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