tokenset.pb.go 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411
  1. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  2. // source: lib/api/tokenset.proto
  3. package api
  4. import (
  5. fmt "fmt"
  6. proto "github.com/gogo/protobuf/proto"
  7. io "io"
  8. math "math"
  9. math_bits "math/bits"
  10. )
  11. // Reference imports to suppress errors if they are not otherwise used.
  12. var _ = proto.Marshal
  13. var _ = fmt.Errorf
  14. var _ = math.Inf
  15. // This is a compile-time assertion to ensure that this generated file
  16. // is compatible with the proto package it is being compiled against.
  17. // A compilation error at this line likely means your copy of the
  18. // proto package needs to be updated.
  19. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
  20. type TokenSet struct {
  21. // token -> expiry time (epoch nanoseconds)
  22. Tokens map[string]int64 `protobuf:"bytes,1,rep,name=tokens,proto3" json:"tokens" xml:"token" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
  23. }
  24. func (m *TokenSet) Reset() { *m = TokenSet{} }
  25. func (m *TokenSet) String() string { return proto.CompactTextString(m) }
  26. func (*TokenSet) ProtoMessage() {}
  27. func (*TokenSet) Descriptor() ([]byte, []int) {
  28. return fileDescriptor_9ea8707737c33b38, []int{0}
  29. }
  30. func (m *TokenSet) XXX_Unmarshal(b []byte) error {
  31. return m.Unmarshal(b)
  32. }
  33. func (m *TokenSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  34. if deterministic {
  35. return xxx_messageInfo_TokenSet.Marshal(b, m, deterministic)
  36. } else {
  37. b = b[:cap(b)]
  38. n, err := m.MarshalToSizedBuffer(b)
  39. if err != nil {
  40. return nil, err
  41. }
  42. return b[:n], nil
  43. }
  44. }
  45. func (m *TokenSet) XXX_Merge(src proto.Message) {
  46. xxx_messageInfo_TokenSet.Merge(m, src)
  47. }
  48. func (m *TokenSet) XXX_Size() int {
  49. return m.ProtoSize()
  50. }
  51. func (m *TokenSet) XXX_DiscardUnknown() {
  52. xxx_messageInfo_TokenSet.DiscardUnknown(m)
  53. }
  54. var xxx_messageInfo_TokenSet proto.InternalMessageInfo
  55. func init() {
  56. proto.RegisterType((*TokenSet)(nil), "api.TokenSet")
  57. proto.RegisterMapType((map[string]int64)(nil), "api.TokenSet.TokensEntry")
  58. }
  59. func init() { proto.RegisterFile("lib/api/tokenset.proto", fileDescriptor_9ea8707737c33b38) }
  60. var fileDescriptor_9ea8707737c33b38 = []byte{
  61. // 260 bytes of a gzipped FileDescriptorProto
  62. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xcb, 0xc9, 0x4c, 0xd2,
  63. 0x4f, 0x2c, 0xc8, 0xd4, 0x2f, 0xc9, 0xcf, 0x4e, 0xcd, 0x2b, 0x4e, 0x2d, 0xd1, 0x2b, 0x28, 0xca,
  64. 0x2f, 0xc9, 0x17, 0x62, 0x4e, 0x2c, 0xc8, 0x54, 0x3a, 0xce, 0xc8, 0xc5, 0x11, 0x02, 0x12, 0x0f,
  65. 0x4e, 0x2d, 0x11, 0x0a, 0xe0, 0x62, 0x83, 0xa8, 0x91, 0x60, 0x54, 0x60, 0xd6, 0xe0, 0x36, 0x92,
  66. 0xd4, 0x4b, 0x2c, 0xc8, 0xd4, 0x83, 0x49, 0x43, 0x18, 0xc5, 0xae, 0x79, 0x25, 0x45, 0x95, 0x4e,
  67. 0xb2, 0x27, 0xee, 0xc9, 0x33, 0xbc, 0xba, 0x27, 0x0f, 0xd5, 0xf0, 0xe9, 0x9e, 0x3c, 0x77, 0x45,
  68. 0x6e, 0x8e, 0x95, 0x12, 0x98, 0xab, 0x14, 0x04, 0x15, 0x96, 0xca, 0xe4, 0xe2, 0x46, 0xd2, 0x25,
  69. 0xa4, 0xc6, 0xc5, 0x9c, 0x9d, 0x5a, 0x29, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0xe9, 0x24, 0xf2, 0xea,
  70. 0x9e, 0x3c, 0x88, 0xfb, 0xe9, 0x9e, 0x3c, 0x27, 0x58, 0x6f, 0x76, 0x6a, 0xa5, 0x52, 0x10, 0x48,
  71. 0x44, 0x48, 0x8f, 0x8b, 0xb5, 0x2c, 0x31, 0xa7, 0x34, 0x55, 0x82, 0x49, 0x81, 0x51, 0x83, 0xd9,
  72. 0x49, 0xe2, 0xd5, 0x3d, 0x79, 0x88, 0x00, 0xdc, 0x1e, 0x30, 0x4f, 0x29, 0x08, 0x22, 0x6a, 0xc5,
  73. 0x64, 0xc1, 0xe8, 0xe4, 0x71, 0xe2, 0xa1, 0x1c, 0xc3, 0x85, 0x87, 0x72, 0x0c, 0x27, 0x1e, 0xc9,
  74. 0x31, 0x5e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x82, 0xc7, 0x72, 0x8c, 0x17, 0x1e,
  75. 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0xa5, 0x96, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97,
  76. 0x9c, 0x9f, 0xab, 0x5f, 0x5c, 0x99, 0x97, 0x5c, 0x92, 0x91, 0x99, 0x97, 0x8e, 0xc4, 0x82, 0x86,
  77. 0x53, 0x12, 0x1b, 0x38, 0x7c, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xfe, 0x25, 0x31, 0x49,
  78. 0x39, 0x01, 0x00, 0x00,
  79. }
  80. func (m *TokenSet) Marshal() (dAtA []byte, err error) {
  81. size := m.ProtoSize()
  82. dAtA = make([]byte, size)
  83. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  84. if err != nil {
  85. return nil, err
  86. }
  87. return dAtA[:n], nil
  88. }
  89. func (m *TokenSet) MarshalTo(dAtA []byte) (int, error) {
  90. size := m.ProtoSize()
  91. return m.MarshalToSizedBuffer(dAtA[:size])
  92. }
  93. func (m *TokenSet) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  94. i := len(dAtA)
  95. _ = i
  96. var l int
  97. _ = l
  98. if len(m.Tokens) > 0 {
  99. for k := range m.Tokens {
  100. v := m.Tokens[k]
  101. baseI := i
  102. i = encodeVarintTokenset(dAtA, i, uint64(v))
  103. i--
  104. dAtA[i] = 0x10
  105. i -= len(k)
  106. copy(dAtA[i:], k)
  107. i = encodeVarintTokenset(dAtA, i, uint64(len(k)))
  108. i--
  109. dAtA[i] = 0xa
  110. i = encodeVarintTokenset(dAtA, i, uint64(baseI-i))
  111. i--
  112. dAtA[i] = 0xa
  113. }
  114. }
  115. return len(dAtA) - i, nil
  116. }
  117. func encodeVarintTokenset(dAtA []byte, offset int, v uint64) int {
  118. offset -= sovTokenset(v)
  119. base := offset
  120. for v >= 1<<7 {
  121. dAtA[offset] = uint8(v&0x7f | 0x80)
  122. v >>= 7
  123. offset++
  124. }
  125. dAtA[offset] = uint8(v)
  126. return base
  127. }
  128. func (m *TokenSet) ProtoSize() (n int) {
  129. if m == nil {
  130. return 0
  131. }
  132. var l int
  133. _ = l
  134. if len(m.Tokens) > 0 {
  135. for k, v := range m.Tokens {
  136. _ = k
  137. _ = v
  138. mapEntrySize := 1 + len(k) + sovTokenset(uint64(len(k))) + 1 + sovTokenset(uint64(v))
  139. n += mapEntrySize + 1 + sovTokenset(uint64(mapEntrySize))
  140. }
  141. }
  142. return n
  143. }
  144. func sovTokenset(x uint64) (n int) {
  145. return (math_bits.Len64(x|1) + 6) / 7
  146. }
  147. func sozTokenset(x uint64) (n int) {
  148. return sovTokenset(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  149. }
  150. func (m *TokenSet) Unmarshal(dAtA []byte) error {
  151. l := len(dAtA)
  152. iNdEx := 0
  153. for iNdEx < l {
  154. preIndex := iNdEx
  155. var wire uint64
  156. for shift := uint(0); ; shift += 7 {
  157. if shift >= 64 {
  158. return ErrIntOverflowTokenset
  159. }
  160. if iNdEx >= l {
  161. return io.ErrUnexpectedEOF
  162. }
  163. b := dAtA[iNdEx]
  164. iNdEx++
  165. wire |= uint64(b&0x7F) << shift
  166. if b < 0x80 {
  167. break
  168. }
  169. }
  170. fieldNum := int32(wire >> 3)
  171. wireType := int(wire & 0x7)
  172. if wireType == 4 {
  173. return fmt.Errorf("proto: TokenSet: wiretype end group for non-group")
  174. }
  175. if fieldNum <= 0 {
  176. return fmt.Errorf("proto: TokenSet: illegal tag %d (wire type %d)", fieldNum, wire)
  177. }
  178. switch fieldNum {
  179. case 1:
  180. if wireType != 2 {
  181. return fmt.Errorf("proto: wrong wireType = %d for field Tokens", wireType)
  182. }
  183. var msglen int
  184. for shift := uint(0); ; shift += 7 {
  185. if shift >= 64 {
  186. return ErrIntOverflowTokenset
  187. }
  188. if iNdEx >= l {
  189. return io.ErrUnexpectedEOF
  190. }
  191. b := dAtA[iNdEx]
  192. iNdEx++
  193. msglen |= int(b&0x7F) << shift
  194. if b < 0x80 {
  195. break
  196. }
  197. }
  198. if msglen < 0 {
  199. return ErrInvalidLengthTokenset
  200. }
  201. postIndex := iNdEx + msglen
  202. if postIndex < 0 {
  203. return ErrInvalidLengthTokenset
  204. }
  205. if postIndex > l {
  206. return io.ErrUnexpectedEOF
  207. }
  208. if m.Tokens == nil {
  209. m.Tokens = make(map[string]int64)
  210. }
  211. var mapkey string
  212. var mapvalue int64
  213. for iNdEx < postIndex {
  214. entryPreIndex := iNdEx
  215. var wire uint64
  216. for shift := uint(0); ; shift += 7 {
  217. if shift >= 64 {
  218. return ErrIntOverflowTokenset
  219. }
  220. if iNdEx >= l {
  221. return io.ErrUnexpectedEOF
  222. }
  223. b := dAtA[iNdEx]
  224. iNdEx++
  225. wire |= uint64(b&0x7F) << shift
  226. if b < 0x80 {
  227. break
  228. }
  229. }
  230. fieldNum := int32(wire >> 3)
  231. if fieldNum == 1 {
  232. var stringLenmapkey uint64
  233. for shift := uint(0); ; shift += 7 {
  234. if shift >= 64 {
  235. return ErrIntOverflowTokenset
  236. }
  237. if iNdEx >= l {
  238. return io.ErrUnexpectedEOF
  239. }
  240. b := dAtA[iNdEx]
  241. iNdEx++
  242. stringLenmapkey |= uint64(b&0x7F) << shift
  243. if b < 0x80 {
  244. break
  245. }
  246. }
  247. intStringLenmapkey := int(stringLenmapkey)
  248. if intStringLenmapkey < 0 {
  249. return ErrInvalidLengthTokenset
  250. }
  251. postStringIndexmapkey := iNdEx + intStringLenmapkey
  252. if postStringIndexmapkey < 0 {
  253. return ErrInvalidLengthTokenset
  254. }
  255. if postStringIndexmapkey > l {
  256. return io.ErrUnexpectedEOF
  257. }
  258. mapkey = string(dAtA[iNdEx:postStringIndexmapkey])
  259. iNdEx = postStringIndexmapkey
  260. } else if fieldNum == 2 {
  261. for shift := uint(0); ; shift += 7 {
  262. if shift >= 64 {
  263. return ErrIntOverflowTokenset
  264. }
  265. if iNdEx >= l {
  266. return io.ErrUnexpectedEOF
  267. }
  268. b := dAtA[iNdEx]
  269. iNdEx++
  270. mapvalue |= int64(b&0x7F) << shift
  271. if b < 0x80 {
  272. break
  273. }
  274. }
  275. } else {
  276. iNdEx = entryPreIndex
  277. skippy, err := skipTokenset(dAtA[iNdEx:])
  278. if err != nil {
  279. return err
  280. }
  281. if (skippy < 0) || (iNdEx+skippy) < 0 {
  282. return ErrInvalidLengthTokenset
  283. }
  284. if (iNdEx + skippy) > postIndex {
  285. return io.ErrUnexpectedEOF
  286. }
  287. iNdEx += skippy
  288. }
  289. }
  290. m.Tokens[mapkey] = mapvalue
  291. iNdEx = postIndex
  292. default:
  293. iNdEx = preIndex
  294. skippy, err := skipTokenset(dAtA[iNdEx:])
  295. if err != nil {
  296. return err
  297. }
  298. if (skippy < 0) || (iNdEx+skippy) < 0 {
  299. return ErrInvalidLengthTokenset
  300. }
  301. if (iNdEx + skippy) > l {
  302. return io.ErrUnexpectedEOF
  303. }
  304. iNdEx += skippy
  305. }
  306. }
  307. if iNdEx > l {
  308. return io.ErrUnexpectedEOF
  309. }
  310. return nil
  311. }
  312. func skipTokenset(dAtA []byte) (n int, err error) {
  313. l := len(dAtA)
  314. iNdEx := 0
  315. depth := 0
  316. for iNdEx < l {
  317. var wire uint64
  318. for shift := uint(0); ; shift += 7 {
  319. if shift >= 64 {
  320. return 0, ErrIntOverflowTokenset
  321. }
  322. if iNdEx >= l {
  323. return 0, io.ErrUnexpectedEOF
  324. }
  325. b := dAtA[iNdEx]
  326. iNdEx++
  327. wire |= (uint64(b) & 0x7F) << shift
  328. if b < 0x80 {
  329. break
  330. }
  331. }
  332. wireType := int(wire & 0x7)
  333. switch wireType {
  334. case 0:
  335. for shift := uint(0); ; shift += 7 {
  336. if shift >= 64 {
  337. return 0, ErrIntOverflowTokenset
  338. }
  339. if iNdEx >= l {
  340. return 0, io.ErrUnexpectedEOF
  341. }
  342. iNdEx++
  343. if dAtA[iNdEx-1] < 0x80 {
  344. break
  345. }
  346. }
  347. case 1:
  348. iNdEx += 8
  349. case 2:
  350. var length int
  351. for shift := uint(0); ; shift += 7 {
  352. if shift >= 64 {
  353. return 0, ErrIntOverflowTokenset
  354. }
  355. if iNdEx >= l {
  356. return 0, io.ErrUnexpectedEOF
  357. }
  358. b := dAtA[iNdEx]
  359. iNdEx++
  360. length |= (int(b) & 0x7F) << shift
  361. if b < 0x80 {
  362. break
  363. }
  364. }
  365. if length < 0 {
  366. return 0, ErrInvalidLengthTokenset
  367. }
  368. iNdEx += length
  369. case 3:
  370. depth++
  371. case 4:
  372. if depth == 0 {
  373. return 0, ErrUnexpectedEndOfGroupTokenset
  374. }
  375. depth--
  376. case 5:
  377. iNdEx += 4
  378. default:
  379. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  380. }
  381. if iNdEx < 0 {
  382. return 0, ErrInvalidLengthTokenset
  383. }
  384. if depth == 0 {
  385. return iNdEx, nil
  386. }
  387. }
  388. return 0, io.ErrUnexpectedEOF
  389. }
  390. var (
  391. ErrInvalidLengthTokenset = fmt.Errorf("proto: negative length found during unmarshaling")
  392. ErrIntOverflowTokenset = fmt.Errorf("proto: integer overflow")
  393. ErrUnexpectedEndOfGroupTokenset = fmt.Errorf("proto: unexpected end of group")
  394. )