lease.pb.go 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  1. // Code generated by protoc-gen-gogo.
  2. // source: lease.proto
  3. // DO NOT EDIT!
  4. /*
  5. Package leasepb is a generated protocol buffer package.
  6. It is generated from these files:
  7. lease.proto
  8. It has these top-level messages:
  9. Lease
  10. */
  11. package leasepb
  12. import (
  13. "fmt"
  14. proto "github.com/gogo/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.GoGoProtoPackageIsVersion1
  25. type Lease struct {
  26. ID int64 `protobuf:"varint,1,opt,name=ID,json=iD,proto3" json:"ID,omitempty"`
  27. TTL int64 `protobuf:"varint,2,opt,name=TTL,json=tTL,proto3" json:"TTL,omitempty"`
  28. }
  29. func (m *Lease) Reset() { *m = Lease{} }
  30. func (m *Lease) String() string { return proto.CompactTextString(m) }
  31. func (*Lease) ProtoMessage() {}
  32. func (*Lease) Descriptor() ([]byte, []int) { return fileDescriptorLease, []int{0} }
  33. func init() {
  34. proto.RegisterType((*Lease)(nil), "leasepb.Lease")
  35. }
  36. func (m *Lease) Marshal() (data []byte, err error) {
  37. size := m.Size()
  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 *Lease) MarshalTo(data []byte) (int, error) {
  46. var i int
  47. _ = i
  48. var l int
  49. _ = l
  50. if m.ID != 0 {
  51. data[i] = 0x8
  52. i++
  53. i = encodeVarintLease(data, i, uint64(m.ID))
  54. }
  55. if m.TTL != 0 {
  56. data[i] = 0x10
  57. i++
  58. i = encodeVarintLease(data, i, uint64(m.TTL))
  59. }
  60. return i, nil
  61. }
  62. func encodeFixed64Lease(data []byte, offset int, v uint64) int {
  63. data[offset] = uint8(v)
  64. data[offset+1] = uint8(v >> 8)
  65. data[offset+2] = uint8(v >> 16)
  66. data[offset+3] = uint8(v >> 24)
  67. data[offset+4] = uint8(v >> 32)
  68. data[offset+5] = uint8(v >> 40)
  69. data[offset+6] = uint8(v >> 48)
  70. data[offset+7] = uint8(v >> 56)
  71. return offset + 8
  72. }
  73. func encodeFixed32Lease(data []byte, offset int, v uint32) int {
  74. data[offset] = uint8(v)
  75. data[offset+1] = uint8(v >> 8)
  76. data[offset+2] = uint8(v >> 16)
  77. data[offset+3] = uint8(v >> 24)
  78. return offset + 4
  79. }
  80. func encodeVarintLease(data []byte, offset int, v uint64) int {
  81. for v >= 1<<7 {
  82. data[offset] = uint8(v&0x7f | 0x80)
  83. v >>= 7
  84. offset++
  85. }
  86. data[offset] = uint8(v)
  87. return offset + 1
  88. }
  89. func (m *Lease) Size() (n int) {
  90. var l int
  91. _ = l
  92. if m.ID != 0 {
  93. n += 1 + sovLease(uint64(m.ID))
  94. }
  95. if m.TTL != 0 {
  96. n += 1 + sovLease(uint64(m.TTL))
  97. }
  98. return n
  99. }
  100. func sovLease(x uint64) (n int) {
  101. for {
  102. n++
  103. x >>= 7
  104. if x == 0 {
  105. break
  106. }
  107. }
  108. return n
  109. }
  110. func sozLease(x uint64) (n int) {
  111. return sovLease(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  112. }
  113. func (m *Lease) Unmarshal(data []byte) error {
  114. l := len(data)
  115. iNdEx := 0
  116. for iNdEx < l {
  117. preIndex := iNdEx
  118. var wire uint64
  119. for shift := uint(0); ; shift += 7 {
  120. if shift >= 64 {
  121. return ErrIntOverflowLease
  122. }
  123. if iNdEx >= l {
  124. return io.ErrUnexpectedEOF
  125. }
  126. b := data[iNdEx]
  127. iNdEx++
  128. wire |= (uint64(b) & 0x7F) << shift
  129. if b < 0x80 {
  130. break
  131. }
  132. }
  133. fieldNum := int32(wire >> 3)
  134. wireType := int(wire & 0x7)
  135. if wireType == 4 {
  136. return fmt.Errorf("proto: Lease: wiretype end group for non-group")
  137. }
  138. if fieldNum <= 0 {
  139. return fmt.Errorf("proto: Lease: illegal tag %d (wire type %d)", fieldNum, wire)
  140. }
  141. switch fieldNum {
  142. case 1:
  143. if wireType != 0 {
  144. return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
  145. }
  146. m.ID = 0
  147. for shift := uint(0); ; shift += 7 {
  148. if shift >= 64 {
  149. return ErrIntOverflowLease
  150. }
  151. if iNdEx >= l {
  152. return io.ErrUnexpectedEOF
  153. }
  154. b := data[iNdEx]
  155. iNdEx++
  156. m.ID |= (int64(b) & 0x7F) << shift
  157. if b < 0x80 {
  158. break
  159. }
  160. }
  161. case 2:
  162. if wireType != 0 {
  163. return fmt.Errorf("proto: wrong wireType = %d for field TTL", wireType)
  164. }
  165. m.TTL = 0
  166. for shift := uint(0); ; shift += 7 {
  167. if shift >= 64 {
  168. return ErrIntOverflowLease
  169. }
  170. if iNdEx >= l {
  171. return io.ErrUnexpectedEOF
  172. }
  173. b := data[iNdEx]
  174. iNdEx++
  175. m.TTL |= (int64(b) & 0x7F) << shift
  176. if b < 0x80 {
  177. break
  178. }
  179. }
  180. default:
  181. iNdEx = preIndex
  182. skippy, err := skipLease(data[iNdEx:])
  183. if err != nil {
  184. return err
  185. }
  186. if skippy < 0 {
  187. return ErrInvalidLengthLease
  188. }
  189. if (iNdEx + skippy) > l {
  190. return io.ErrUnexpectedEOF
  191. }
  192. iNdEx += skippy
  193. }
  194. }
  195. if iNdEx > l {
  196. return io.ErrUnexpectedEOF
  197. }
  198. return nil
  199. }
  200. func skipLease(data []byte) (n int, err error) {
  201. l := len(data)
  202. iNdEx := 0
  203. for iNdEx < l {
  204. var wire uint64
  205. for shift := uint(0); ; shift += 7 {
  206. if shift >= 64 {
  207. return 0, ErrIntOverflowLease
  208. }
  209. if iNdEx >= l {
  210. return 0, io.ErrUnexpectedEOF
  211. }
  212. b := data[iNdEx]
  213. iNdEx++
  214. wire |= (uint64(b) & 0x7F) << shift
  215. if b < 0x80 {
  216. break
  217. }
  218. }
  219. wireType := int(wire & 0x7)
  220. switch wireType {
  221. case 0:
  222. for shift := uint(0); ; shift += 7 {
  223. if shift >= 64 {
  224. return 0, ErrIntOverflowLease
  225. }
  226. if iNdEx >= l {
  227. return 0, io.ErrUnexpectedEOF
  228. }
  229. iNdEx++
  230. if data[iNdEx-1] < 0x80 {
  231. break
  232. }
  233. }
  234. return iNdEx, nil
  235. case 1:
  236. iNdEx += 8
  237. return iNdEx, nil
  238. case 2:
  239. var length int
  240. for shift := uint(0); ; shift += 7 {
  241. if shift >= 64 {
  242. return 0, ErrIntOverflowLease
  243. }
  244. if iNdEx >= l {
  245. return 0, io.ErrUnexpectedEOF
  246. }
  247. b := data[iNdEx]
  248. iNdEx++
  249. length |= (int(b) & 0x7F) << shift
  250. if b < 0x80 {
  251. break
  252. }
  253. }
  254. iNdEx += length
  255. if length < 0 {
  256. return 0, ErrInvalidLengthLease
  257. }
  258. return iNdEx, nil
  259. case 3:
  260. for {
  261. var innerWire uint64
  262. var start int = iNdEx
  263. for shift := uint(0); ; shift += 7 {
  264. if shift >= 64 {
  265. return 0, ErrIntOverflowLease
  266. }
  267. if iNdEx >= l {
  268. return 0, io.ErrUnexpectedEOF
  269. }
  270. b := data[iNdEx]
  271. iNdEx++
  272. innerWire |= (uint64(b) & 0x7F) << shift
  273. if b < 0x80 {
  274. break
  275. }
  276. }
  277. innerWireType := int(innerWire & 0x7)
  278. if innerWireType == 4 {
  279. break
  280. }
  281. next, err := skipLease(data[start:])
  282. if err != nil {
  283. return 0, err
  284. }
  285. iNdEx = start + next
  286. }
  287. return iNdEx, nil
  288. case 4:
  289. return iNdEx, nil
  290. case 5:
  291. iNdEx += 4
  292. return iNdEx, nil
  293. default:
  294. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  295. }
  296. }
  297. panic("unreachable")
  298. }
  299. var (
  300. ErrInvalidLengthLease = fmt.Errorf("proto: negative length found during unmarshaling")
  301. ErrIntOverflowLease = fmt.Errorf("proto: integer overflow")
  302. )
  303. var fileDescriptorLease = []byte{
  304. // 117 bytes of a gzipped FileDescriptorProto
  305. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0xce, 0x49, 0x4d, 0x2c,
  306. 0x4e, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x07, 0x73, 0x0a, 0x92, 0xa4, 0x44, 0xd2,
  307. 0xf3, 0xd3, 0xf3, 0xc1, 0x62, 0xfa, 0x20, 0x16, 0x44, 0x5a, 0x49, 0x93, 0x8b, 0xd5, 0x07, 0xa4,
  308. 0x40, 0x88, 0x8f, 0x8b, 0xc9, 0xd3, 0x45, 0x82, 0x51, 0x81, 0x51, 0x83, 0x39, 0x88, 0x29, 0xd3,
  309. 0x45, 0x48, 0x80, 0x8b, 0x39, 0x24, 0xc4, 0x47, 0x82, 0x09, 0x2c, 0xc0, 0x5c, 0x12, 0xe2, 0xe3,
  310. 0x24, 0x72, 0xe2, 0xa1, 0x1c, 0xc3, 0x05, 0x20, 0x3e, 0xf1, 0x48, 0x8e, 0xf1, 0x02, 0x10, 0x3f,
  311. 0x00, 0xe2, 0x24, 0x36, 0xb0, 0x39, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x8c, 0x1d, 0x92,
  312. 0xdc, 0x75, 0x00, 0x00, 0x00,
  313. }