snap.pb.go 8.6 KB

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