auth.pb.go 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509
  1. // Code generated by protoc-gen-gogo.
  2. // source: auth.proto
  3. // DO NOT EDIT!
  4. /*
  5. Package authpb is a generated protocol buffer package.
  6. It is generated from these files:
  7. auth.proto
  8. It has these top-level messages:
  9. User
  10. Role
  11. */
  12. package authpb
  13. import (
  14. "fmt"
  15. proto "github.com/gogo/protobuf/proto"
  16. )
  17. import math "math"
  18. import io "io"
  19. // Reference imports to suppress errors if they are not otherwise used.
  20. var _ = proto.Marshal
  21. var _ = fmt.Errorf
  22. var _ = math.Inf
  23. // User is a single entry in the bucket authUsers
  24. type User struct {
  25. Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
  26. Password []byte `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
  27. Tombstone int64 `protobuf:"varint,3,opt,name=tombstone,proto3" json:"tombstone,omitempty"`
  28. }
  29. func (m *User) Reset() { *m = User{} }
  30. func (m *User) String() string { return proto.CompactTextString(m) }
  31. func (*User) ProtoMessage() {}
  32. // Role is a single entry in the bucket authRoles
  33. type Role struct {
  34. Name []byte `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
  35. }
  36. func (m *Role) Reset() { *m = Role{} }
  37. func (m *Role) String() string { return proto.CompactTextString(m) }
  38. func (*Role) ProtoMessage() {}
  39. func init() {
  40. proto.RegisterType((*User)(nil), "authpb.User")
  41. proto.RegisterType((*Role)(nil), "authpb.Role")
  42. }
  43. func (m *User) Marshal() (data []byte, err error) {
  44. size := m.Size()
  45. data = make([]byte, size)
  46. n, err := m.MarshalTo(data)
  47. if err != nil {
  48. return nil, err
  49. }
  50. return data[:n], nil
  51. }
  52. func (m *User) MarshalTo(data []byte) (int, error) {
  53. var i int
  54. _ = i
  55. var l int
  56. _ = l
  57. if m.Name != nil {
  58. if len(m.Name) > 0 {
  59. data[i] = 0xa
  60. i++
  61. i = encodeVarintAuth(data, i, uint64(len(m.Name)))
  62. i += copy(data[i:], m.Name)
  63. }
  64. }
  65. if m.Password != nil {
  66. if len(m.Password) > 0 {
  67. data[i] = 0x12
  68. i++
  69. i = encodeVarintAuth(data, i, uint64(len(m.Password)))
  70. i += copy(data[i:], m.Password)
  71. }
  72. }
  73. if m.Tombstone != 0 {
  74. data[i] = 0x18
  75. i++
  76. i = encodeVarintAuth(data, i, uint64(m.Tombstone))
  77. }
  78. return i, nil
  79. }
  80. func (m *Role) Marshal() (data []byte, err error) {
  81. size := m.Size()
  82. data = make([]byte, size)
  83. n, err := m.MarshalTo(data)
  84. if err != nil {
  85. return nil, err
  86. }
  87. return data[:n], nil
  88. }
  89. func (m *Role) MarshalTo(data []byte) (int, error) {
  90. var i int
  91. _ = i
  92. var l int
  93. _ = l
  94. if m.Name != nil {
  95. if len(m.Name) > 0 {
  96. data[i] = 0x12
  97. i++
  98. i = encodeVarintAuth(data, i, uint64(len(m.Name)))
  99. i += copy(data[i:], m.Name)
  100. }
  101. }
  102. return i, nil
  103. }
  104. func encodeFixed64Auth(data []byte, offset int, v uint64) int {
  105. data[offset] = uint8(v)
  106. data[offset+1] = uint8(v >> 8)
  107. data[offset+2] = uint8(v >> 16)
  108. data[offset+3] = uint8(v >> 24)
  109. data[offset+4] = uint8(v >> 32)
  110. data[offset+5] = uint8(v >> 40)
  111. data[offset+6] = uint8(v >> 48)
  112. data[offset+7] = uint8(v >> 56)
  113. return offset + 8
  114. }
  115. func encodeFixed32Auth(data []byte, offset int, v uint32) int {
  116. data[offset] = uint8(v)
  117. data[offset+1] = uint8(v >> 8)
  118. data[offset+2] = uint8(v >> 16)
  119. data[offset+3] = uint8(v >> 24)
  120. return offset + 4
  121. }
  122. func encodeVarintAuth(data []byte, offset int, v uint64) int {
  123. for v >= 1<<7 {
  124. data[offset] = uint8(v&0x7f | 0x80)
  125. v >>= 7
  126. offset++
  127. }
  128. data[offset] = uint8(v)
  129. return offset + 1
  130. }
  131. func (m *User) Size() (n int) {
  132. var l int
  133. _ = l
  134. if m.Name != nil {
  135. l = len(m.Name)
  136. if l > 0 {
  137. n += 1 + l + sovAuth(uint64(l))
  138. }
  139. }
  140. if m.Password != nil {
  141. l = len(m.Password)
  142. if l > 0 {
  143. n += 1 + l + sovAuth(uint64(l))
  144. }
  145. }
  146. if m.Tombstone != 0 {
  147. n += 1 + sovAuth(uint64(m.Tombstone))
  148. }
  149. return n
  150. }
  151. func (m *Role) Size() (n int) {
  152. var l int
  153. _ = l
  154. if m.Name != nil {
  155. l = len(m.Name)
  156. if l > 0 {
  157. n += 1 + l + sovAuth(uint64(l))
  158. }
  159. }
  160. return n
  161. }
  162. func sovAuth(x uint64) (n int) {
  163. for {
  164. n++
  165. x >>= 7
  166. if x == 0 {
  167. break
  168. }
  169. }
  170. return n
  171. }
  172. func sozAuth(x uint64) (n int) {
  173. return sovAuth(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  174. }
  175. func (m *User) Unmarshal(data []byte) error {
  176. l := len(data)
  177. iNdEx := 0
  178. for iNdEx < l {
  179. preIndex := iNdEx
  180. var wire uint64
  181. for shift := uint(0); ; shift += 7 {
  182. if shift >= 64 {
  183. return ErrIntOverflowAuth
  184. }
  185. if iNdEx >= l {
  186. return io.ErrUnexpectedEOF
  187. }
  188. b := data[iNdEx]
  189. iNdEx++
  190. wire |= (uint64(b) & 0x7F) << shift
  191. if b < 0x80 {
  192. break
  193. }
  194. }
  195. fieldNum := int32(wire >> 3)
  196. wireType := int(wire & 0x7)
  197. if wireType == 4 {
  198. return fmt.Errorf("proto: User: wiretype end group for non-group")
  199. }
  200. if fieldNum <= 0 {
  201. return fmt.Errorf("proto: User: illegal tag %d (wire type %d)", fieldNum, wire)
  202. }
  203. switch fieldNum {
  204. case 1:
  205. if wireType != 2 {
  206. return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
  207. }
  208. var byteLen int
  209. for shift := uint(0); ; shift += 7 {
  210. if shift >= 64 {
  211. return ErrIntOverflowAuth
  212. }
  213. if iNdEx >= l {
  214. return io.ErrUnexpectedEOF
  215. }
  216. b := data[iNdEx]
  217. iNdEx++
  218. byteLen |= (int(b) & 0x7F) << shift
  219. if b < 0x80 {
  220. break
  221. }
  222. }
  223. if byteLen < 0 {
  224. return ErrInvalidLengthAuth
  225. }
  226. postIndex := iNdEx + byteLen
  227. if postIndex > l {
  228. return io.ErrUnexpectedEOF
  229. }
  230. m.Name = append(m.Name[:0], data[iNdEx:postIndex]...)
  231. if m.Name == nil {
  232. m.Name = []byte{}
  233. }
  234. iNdEx = postIndex
  235. case 2:
  236. if wireType != 2 {
  237. return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType)
  238. }
  239. var byteLen int
  240. for shift := uint(0); ; shift += 7 {
  241. if shift >= 64 {
  242. return ErrIntOverflowAuth
  243. }
  244. if iNdEx >= l {
  245. return io.ErrUnexpectedEOF
  246. }
  247. b := data[iNdEx]
  248. iNdEx++
  249. byteLen |= (int(b) & 0x7F) << shift
  250. if b < 0x80 {
  251. break
  252. }
  253. }
  254. if byteLen < 0 {
  255. return ErrInvalidLengthAuth
  256. }
  257. postIndex := iNdEx + byteLen
  258. if postIndex > l {
  259. return io.ErrUnexpectedEOF
  260. }
  261. m.Password = append(m.Password[:0], data[iNdEx:postIndex]...)
  262. if m.Password == nil {
  263. m.Password = []byte{}
  264. }
  265. iNdEx = postIndex
  266. case 3:
  267. if wireType != 0 {
  268. return fmt.Errorf("proto: wrong wireType = %d for field Tombstone", wireType)
  269. }
  270. m.Tombstone = 0
  271. for shift := uint(0); ; shift += 7 {
  272. if shift >= 64 {
  273. return ErrIntOverflowAuth
  274. }
  275. if iNdEx >= l {
  276. return io.ErrUnexpectedEOF
  277. }
  278. b := data[iNdEx]
  279. iNdEx++
  280. m.Tombstone |= (int64(b) & 0x7F) << shift
  281. if b < 0x80 {
  282. break
  283. }
  284. }
  285. default:
  286. iNdEx = preIndex
  287. skippy, err := skipAuth(data[iNdEx:])
  288. if err != nil {
  289. return err
  290. }
  291. if skippy < 0 {
  292. return ErrInvalidLengthAuth
  293. }
  294. if (iNdEx + skippy) > l {
  295. return io.ErrUnexpectedEOF
  296. }
  297. iNdEx += skippy
  298. }
  299. }
  300. if iNdEx > l {
  301. return io.ErrUnexpectedEOF
  302. }
  303. return nil
  304. }
  305. func (m *Role) Unmarshal(data []byte) error {
  306. l := len(data)
  307. iNdEx := 0
  308. for iNdEx < l {
  309. preIndex := iNdEx
  310. var wire uint64
  311. for shift := uint(0); ; shift += 7 {
  312. if shift >= 64 {
  313. return ErrIntOverflowAuth
  314. }
  315. if iNdEx >= l {
  316. return io.ErrUnexpectedEOF
  317. }
  318. b := data[iNdEx]
  319. iNdEx++
  320. wire |= (uint64(b) & 0x7F) << shift
  321. if b < 0x80 {
  322. break
  323. }
  324. }
  325. fieldNum := int32(wire >> 3)
  326. wireType := int(wire & 0x7)
  327. if wireType == 4 {
  328. return fmt.Errorf("proto: Role: wiretype end group for non-group")
  329. }
  330. if fieldNum <= 0 {
  331. return fmt.Errorf("proto: Role: illegal tag %d (wire type %d)", fieldNum, wire)
  332. }
  333. switch fieldNum {
  334. case 2:
  335. if wireType != 2 {
  336. return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
  337. }
  338. var byteLen int
  339. for shift := uint(0); ; shift += 7 {
  340. if shift >= 64 {
  341. return ErrIntOverflowAuth
  342. }
  343. if iNdEx >= l {
  344. return io.ErrUnexpectedEOF
  345. }
  346. b := data[iNdEx]
  347. iNdEx++
  348. byteLen |= (int(b) & 0x7F) << shift
  349. if b < 0x80 {
  350. break
  351. }
  352. }
  353. if byteLen < 0 {
  354. return ErrInvalidLengthAuth
  355. }
  356. postIndex := iNdEx + byteLen
  357. if postIndex > l {
  358. return io.ErrUnexpectedEOF
  359. }
  360. m.Name = append(m.Name[:0], data[iNdEx:postIndex]...)
  361. if m.Name == nil {
  362. m.Name = []byte{}
  363. }
  364. iNdEx = postIndex
  365. default:
  366. iNdEx = preIndex
  367. skippy, err := skipAuth(data[iNdEx:])
  368. if err != nil {
  369. return err
  370. }
  371. if skippy < 0 {
  372. return ErrInvalidLengthAuth
  373. }
  374. if (iNdEx + skippy) > l {
  375. return io.ErrUnexpectedEOF
  376. }
  377. iNdEx += skippy
  378. }
  379. }
  380. if iNdEx > l {
  381. return io.ErrUnexpectedEOF
  382. }
  383. return nil
  384. }
  385. func skipAuth(data []byte) (n int, err error) {
  386. l := len(data)
  387. iNdEx := 0
  388. for iNdEx < l {
  389. var wire uint64
  390. for shift := uint(0); ; shift += 7 {
  391. if shift >= 64 {
  392. return 0, ErrIntOverflowAuth
  393. }
  394. if iNdEx >= l {
  395. return 0, io.ErrUnexpectedEOF
  396. }
  397. b := data[iNdEx]
  398. iNdEx++
  399. wire |= (uint64(b) & 0x7F) << shift
  400. if b < 0x80 {
  401. break
  402. }
  403. }
  404. wireType := int(wire & 0x7)
  405. switch wireType {
  406. case 0:
  407. for shift := uint(0); ; shift += 7 {
  408. if shift >= 64 {
  409. return 0, ErrIntOverflowAuth
  410. }
  411. if iNdEx >= l {
  412. return 0, io.ErrUnexpectedEOF
  413. }
  414. iNdEx++
  415. if data[iNdEx-1] < 0x80 {
  416. break
  417. }
  418. }
  419. return iNdEx, nil
  420. case 1:
  421. iNdEx += 8
  422. return iNdEx, nil
  423. case 2:
  424. var length int
  425. for shift := uint(0); ; shift += 7 {
  426. if shift >= 64 {
  427. return 0, ErrIntOverflowAuth
  428. }
  429. if iNdEx >= l {
  430. return 0, io.ErrUnexpectedEOF
  431. }
  432. b := data[iNdEx]
  433. iNdEx++
  434. length |= (int(b) & 0x7F) << shift
  435. if b < 0x80 {
  436. break
  437. }
  438. }
  439. iNdEx += length
  440. if length < 0 {
  441. return 0, ErrInvalidLengthAuth
  442. }
  443. return iNdEx, nil
  444. case 3:
  445. for {
  446. var innerWire uint64
  447. var start int = iNdEx
  448. for shift := uint(0); ; shift += 7 {
  449. if shift >= 64 {
  450. return 0, ErrIntOverflowAuth
  451. }
  452. if iNdEx >= l {
  453. return 0, io.ErrUnexpectedEOF
  454. }
  455. b := data[iNdEx]
  456. iNdEx++
  457. innerWire |= (uint64(b) & 0x7F) << shift
  458. if b < 0x80 {
  459. break
  460. }
  461. }
  462. innerWireType := int(innerWire & 0x7)
  463. if innerWireType == 4 {
  464. break
  465. }
  466. next, err := skipAuth(data[start:])
  467. if err != nil {
  468. return 0, err
  469. }
  470. iNdEx = start + next
  471. }
  472. return iNdEx, nil
  473. case 4:
  474. return iNdEx, nil
  475. case 5:
  476. iNdEx += 4
  477. return iNdEx, nil
  478. default:
  479. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  480. }
  481. }
  482. panic("unreachable")
  483. }
  484. var (
  485. ErrInvalidLengthAuth = fmt.Errorf("proto: negative length found during unmarshaling")
  486. ErrIntOverflowAuth = fmt.Errorf("proto: integer overflow")
  487. )