-
Notifications
You must be signed in to change notification settings - Fork 0
/
user.pb.go
1022 lines (923 loc) · 35.6 KB
/
user.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: user.proto
package api
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import empty "github.com/golang/protobuf/ptypes/empty"
import timestamp "github.com/golang/protobuf/ptypes/timestamp"
import _ "google.golang.org/genproto/googleapis/api/annotations"
import (
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type User struct {
// User ID.
// Will be set automatically on create.
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
// Username of the user.
Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
// The session timeout, in minutes.
SessionTtl int32 `protobuf:"varint,3,opt,name=session_ttl,json=sessionTTL,proto3" json:"session_ttl,omitempty"`
// Set to true to make the user a global administrator.
IsAdmin bool `protobuf:"varint,4,opt,name=is_admin,json=isAdmin,proto3" json:"is_admin,omitempty"`
// Set to false to disable the user.
IsActive bool `protobuf:"varint,5,opt,name=is_active,json=isActive,proto3" json:"is_active,omitempty"`
// E-mail of the user.
Email string `protobuf:"bytes,6,opt,name=email,proto3" json:"email,omitempty"`
// Optional note to store with the user.
Note string `protobuf:"bytes,7,opt,name=note,proto3" json:"note,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *User) Reset() { *m = User{} }
func (m *User) String() string { return proto.CompactTextString(m) }
func (*User) ProtoMessage() {}
func (*User) Descriptor() ([]byte, []int) {
return fileDescriptor_116e343673f7ffaf, []int{0}
}
func (m *User) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_User.Unmarshal(m, b)
}
func (m *User) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_User.Marshal(b, m, deterministic)
}
func (dst *User) XXX_Merge(src proto.Message) {
xxx_messageInfo_User.Merge(dst, src)
}
func (m *User) XXX_Size() int {
return xxx_messageInfo_User.Size(m)
}
func (m *User) XXX_DiscardUnknown() {
xxx_messageInfo_User.DiscardUnknown(m)
}
var xxx_messageInfo_User proto.InternalMessageInfo
func (m *User) GetId() int64 {
if m != nil {
return m.Id
}
return 0
}
func (m *User) GetUsername() string {
if m != nil {
return m.Username
}
return ""
}
func (m *User) GetSessionTtl() int32 {
if m != nil {
return m.SessionTtl
}
return 0
}
func (m *User) GetIsAdmin() bool {
if m != nil {
return m.IsAdmin
}
return false
}
func (m *User) GetIsActive() bool {
if m != nil {
return m.IsActive
}
return false
}
func (m *User) GetEmail() string {
if m != nil {
return m.Email
}
return ""
}
func (m *User) GetNote() string {
if m != nil {
return m.Note
}
return ""
}
type UserListItem struct {
// User ID.
// Will be set automatically on create.
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
// Username of the user.
Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
// The session timeout, in minutes.
SessionTtl int32 `protobuf:"varint,3,opt,name=session_ttl,json=sessionTTL,proto3" json:"session_ttl,omitempty"`
// Set to true to make the user a global administrator.
IsAdmin bool `protobuf:"varint,4,opt,name=is_admin,json=isAdmin,proto3" json:"is_admin,omitempty"`
// Set to false to disable the user.
IsActive bool `protobuf:"varint,5,opt,name=is_active,json=isActive,proto3" json:"is_active,omitempty"`
// E-mail of the user.
Email string `protobuf:"bytes,6,opt,name=email,proto3" json:"email,omitempty"`
// Optional note to store with the user.
Note string `protobuf:"bytes,7,opt,name=note,proto3" json:"note,omitempty"`
// Created at timestamp.
CreatedAt *timestamp.Timestamp `protobuf:"bytes,8,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
// Last update timestamp.
UpdatedAt *timestamp.Timestamp `protobuf:"bytes,9,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *UserListItem) Reset() { *m = UserListItem{} }
func (m *UserListItem) String() string { return proto.CompactTextString(m) }
func (*UserListItem) ProtoMessage() {}
func (*UserListItem) Descriptor() ([]byte, []int) {
return fileDescriptor_116e343673f7ffaf, []int{1}
}
func (m *UserListItem) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_UserListItem.Unmarshal(m, b)
}
func (m *UserListItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_UserListItem.Marshal(b, m, deterministic)
}
func (dst *UserListItem) XXX_Merge(src proto.Message) {
xxx_messageInfo_UserListItem.Merge(dst, src)
}
func (m *UserListItem) XXX_Size() int {
return xxx_messageInfo_UserListItem.Size(m)
}
func (m *UserListItem) XXX_DiscardUnknown() {
xxx_messageInfo_UserListItem.DiscardUnknown(m)
}
var xxx_messageInfo_UserListItem proto.InternalMessageInfo
func (m *UserListItem) GetId() int64 {
if m != nil {
return m.Id
}
return 0
}
func (m *UserListItem) GetUsername() string {
if m != nil {
return m.Username
}
return ""
}
func (m *UserListItem) GetSessionTtl() int32 {
if m != nil {
return m.SessionTtl
}
return 0
}
func (m *UserListItem) GetIsAdmin() bool {
if m != nil {
return m.IsAdmin
}
return false
}
func (m *UserListItem) GetIsActive() bool {
if m != nil {
return m.IsActive
}
return false
}
func (m *UserListItem) GetEmail() string {
if m != nil {
return m.Email
}
return ""
}
func (m *UserListItem) GetNote() string {
if m != nil {
return m.Note
}
return ""
}
func (m *UserListItem) GetCreatedAt() *timestamp.Timestamp {
if m != nil {
return m.CreatedAt
}
return nil
}
func (m *UserListItem) GetUpdatedAt() *timestamp.Timestamp {
if m != nil {
return m.UpdatedAt
}
return nil
}
type UserOrganization struct {
// Organization ID.
OrganizationId int64 `protobuf:"varint,1,opt,name=organization_id,json=organizationID,proto3" json:"organization_id,omitempty"`
// User has admin rights within the organization.
IsAdmin bool `protobuf:"varint,2,opt,name=is_admin,json=isAdmin,proto3" json:"is_admin,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *UserOrganization) Reset() { *m = UserOrganization{} }
func (m *UserOrganization) String() string { return proto.CompactTextString(m) }
func (*UserOrganization) ProtoMessage() {}
func (*UserOrganization) Descriptor() ([]byte, []int) {
return fileDescriptor_116e343673f7ffaf, []int{2}
}
func (m *UserOrganization) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_UserOrganization.Unmarshal(m, b)
}
func (m *UserOrganization) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_UserOrganization.Marshal(b, m, deterministic)
}
func (dst *UserOrganization) XXX_Merge(src proto.Message) {
xxx_messageInfo_UserOrganization.Merge(dst, src)
}
func (m *UserOrganization) XXX_Size() int {
return xxx_messageInfo_UserOrganization.Size(m)
}
func (m *UserOrganization) XXX_DiscardUnknown() {
xxx_messageInfo_UserOrganization.DiscardUnknown(m)
}
var xxx_messageInfo_UserOrganization proto.InternalMessageInfo
func (m *UserOrganization) GetOrganizationId() int64 {
if m != nil {
return m.OrganizationId
}
return 0
}
func (m *UserOrganization) GetIsAdmin() bool {
if m != nil {
return m.IsAdmin
}
return false
}
type CreateUserRequest struct {
// User object to create.
User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
// Password of the user.
Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
// Add the user to the following organizations.
Organizations []*UserOrganization `protobuf:"bytes,3,rep,name=organizations,proto3" json:"organizations,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *CreateUserRequest) Reset() { *m = CreateUserRequest{} }
func (m *CreateUserRequest) String() string { return proto.CompactTextString(m) }
func (*CreateUserRequest) ProtoMessage() {}
func (*CreateUserRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_116e343673f7ffaf, []int{3}
}
func (m *CreateUserRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CreateUserRequest.Unmarshal(m, b)
}
func (m *CreateUserRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CreateUserRequest.Marshal(b, m, deterministic)
}
func (dst *CreateUserRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_CreateUserRequest.Merge(dst, src)
}
func (m *CreateUserRequest) XXX_Size() int {
return xxx_messageInfo_CreateUserRequest.Size(m)
}
func (m *CreateUserRequest) XXX_DiscardUnknown() {
xxx_messageInfo_CreateUserRequest.DiscardUnknown(m)
}
var xxx_messageInfo_CreateUserRequest proto.InternalMessageInfo
func (m *CreateUserRequest) GetUser() *User {
if m != nil {
return m.User
}
return nil
}
func (m *CreateUserRequest) GetPassword() string {
if m != nil {
return m.Password
}
return ""
}
func (m *CreateUserRequest) GetOrganizations() []*UserOrganization {
if m != nil {
return m.Organizations
}
return nil
}
type CreateUserResponse struct {
// User ID.
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *CreateUserResponse) Reset() { *m = CreateUserResponse{} }
func (m *CreateUserResponse) String() string { return proto.CompactTextString(m) }
func (*CreateUserResponse) ProtoMessage() {}
func (*CreateUserResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_116e343673f7ffaf, []int{4}
}
func (m *CreateUserResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CreateUserResponse.Unmarshal(m, b)
}
func (m *CreateUserResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CreateUserResponse.Marshal(b, m, deterministic)
}
func (dst *CreateUserResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_CreateUserResponse.Merge(dst, src)
}
func (m *CreateUserResponse) XXX_Size() int {
return xxx_messageInfo_CreateUserResponse.Size(m)
}
func (m *CreateUserResponse) XXX_DiscardUnknown() {
xxx_messageInfo_CreateUserResponse.DiscardUnknown(m)
}
var xxx_messageInfo_CreateUserResponse proto.InternalMessageInfo
func (m *CreateUserResponse) GetId() int64 {
if m != nil {
return m.Id
}
return 0
}
type GetUserRequest struct {
// User ID.
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetUserRequest) Reset() { *m = GetUserRequest{} }
func (m *GetUserRequest) String() string { return proto.CompactTextString(m) }
func (*GetUserRequest) ProtoMessage() {}
func (*GetUserRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_116e343673f7ffaf, []int{5}
}
func (m *GetUserRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetUserRequest.Unmarshal(m, b)
}
func (m *GetUserRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GetUserRequest.Marshal(b, m, deterministic)
}
func (dst *GetUserRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_GetUserRequest.Merge(dst, src)
}
func (m *GetUserRequest) XXX_Size() int {
return xxx_messageInfo_GetUserRequest.Size(m)
}
func (m *GetUserRequest) XXX_DiscardUnknown() {
xxx_messageInfo_GetUserRequest.DiscardUnknown(m)
}
var xxx_messageInfo_GetUserRequest proto.InternalMessageInfo
func (m *GetUserRequest) GetId() int64 {
if m != nil {
return m.Id
}
return 0
}
type GetUserResponse struct {
// User object.
User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
// Created at timestamp.
CreatedAt *timestamp.Timestamp `protobuf:"bytes,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
// Last update timestamp.
UpdatedAt *timestamp.Timestamp `protobuf:"bytes,3,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetUserResponse) Reset() { *m = GetUserResponse{} }
func (m *GetUserResponse) String() string { return proto.CompactTextString(m) }
func (*GetUserResponse) ProtoMessage() {}
func (*GetUserResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_116e343673f7ffaf, []int{6}
}
func (m *GetUserResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetUserResponse.Unmarshal(m, b)
}
func (m *GetUserResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GetUserResponse.Marshal(b, m, deterministic)
}
func (dst *GetUserResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_GetUserResponse.Merge(dst, src)
}
func (m *GetUserResponse) XXX_Size() int {
return xxx_messageInfo_GetUserResponse.Size(m)
}
func (m *GetUserResponse) XXX_DiscardUnknown() {
xxx_messageInfo_GetUserResponse.DiscardUnknown(m)
}
var xxx_messageInfo_GetUserResponse proto.InternalMessageInfo
func (m *GetUserResponse) GetUser() *User {
if m != nil {
return m.User
}
return nil
}
func (m *GetUserResponse) GetCreatedAt() *timestamp.Timestamp {
if m != nil {
return m.CreatedAt
}
return nil
}
func (m *GetUserResponse) GetUpdatedAt() *timestamp.Timestamp {
if m != nil {
return m.UpdatedAt
}
return nil
}
type UpdateUserRequest struct {
// User object to update.
User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *UpdateUserRequest) Reset() { *m = UpdateUserRequest{} }
func (m *UpdateUserRequest) String() string { return proto.CompactTextString(m) }
func (*UpdateUserRequest) ProtoMessage() {}
func (*UpdateUserRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_116e343673f7ffaf, []int{7}
}
func (m *UpdateUserRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_UpdateUserRequest.Unmarshal(m, b)
}
func (m *UpdateUserRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_UpdateUserRequest.Marshal(b, m, deterministic)
}
func (dst *UpdateUserRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_UpdateUserRequest.Merge(dst, src)
}
func (m *UpdateUserRequest) XXX_Size() int {
return xxx_messageInfo_UpdateUserRequest.Size(m)
}
func (m *UpdateUserRequest) XXX_DiscardUnknown() {
xxx_messageInfo_UpdateUserRequest.DiscardUnknown(m)
}
var xxx_messageInfo_UpdateUserRequest proto.InternalMessageInfo
func (m *UpdateUserRequest) GetUser() *User {
if m != nil {
return m.User
}
return nil
}
type DeleteUserRequest struct {
// User ID.
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *DeleteUserRequest) Reset() { *m = DeleteUserRequest{} }
func (m *DeleteUserRequest) String() string { return proto.CompactTextString(m) }
func (*DeleteUserRequest) ProtoMessage() {}
func (*DeleteUserRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_116e343673f7ffaf, []int{8}
}
func (m *DeleteUserRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_DeleteUserRequest.Unmarshal(m, b)
}
func (m *DeleteUserRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_DeleteUserRequest.Marshal(b, m, deterministic)
}
func (dst *DeleteUserRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_DeleteUserRequest.Merge(dst, src)
}
func (m *DeleteUserRequest) XXX_Size() int {
return xxx_messageInfo_DeleteUserRequest.Size(m)
}
func (m *DeleteUserRequest) XXX_DiscardUnknown() {
xxx_messageInfo_DeleteUserRequest.DiscardUnknown(m)
}
var xxx_messageInfo_DeleteUserRequest proto.InternalMessageInfo
func (m *DeleteUserRequest) GetId() int64 {
if m != nil {
return m.Id
}
return 0
}
type ListUserRequest struct {
// Max number of user to return in the result-set.
Limit int64 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"`
// Offset in the result-set (for pagination).
Offset int64 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"`
// When provided, the given string will be used to search on username.
Search string `protobuf:"bytes,3,opt,name=search,proto3" json:"search,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ListUserRequest) Reset() { *m = ListUserRequest{} }
func (m *ListUserRequest) String() string { return proto.CompactTextString(m) }
func (*ListUserRequest) ProtoMessage() {}
func (*ListUserRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_116e343673f7ffaf, []int{9}
}
func (m *ListUserRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ListUserRequest.Unmarshal(m, b)
}
func (m *ListUserRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ListUserRequest.Marshal(b, m, deterministic)
}
func (dst *ListUserRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_ListUserRequest.Merge(dst, src)
}
func (m *ListUserRequest) XXX_Size() int {
return xxx_messageInfo_ListUserRequest.Size(m)
}
func (m *ListUserRequest) XXX_DiscardUnknown() {
xxx_messageInfo_ListUserRequest.DiscardUnknown(m)
}
var xxx_messageInfo_ListUserRequest proto.InternalMessageInfo
func (m *ListUserRequest) GetLimit() int64 {
if m != nil {
return m.Limit
}
return 0
}
func (m *ListUserRequest) GetOffset() int64 {
if m != nil {
return m.Offset
}
return 0
}
func (m *ListUserRequest) GetSearch() string {
if m != nil {
return m.Search
}
return ""
}
type ListUserResponse struct {
// Total number of users.
TotalCount int64 `protobuf:"varint,1,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"`
// Result-set.
Result []*UserListItem `protobuf:"bytes,2,rep,name=result,proto3" json:"result,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ListUserResponse) Reset() { *m = ListUserResponse{} }
func (m *ListUserResponse) String() string { return proto.CompactTextString(m) }
func (*ListUserResponse) ProtoMessage() {}
func (*ListUserResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_116e343673f7ffaf, []int{10}
}
func (m *ListUserResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ListUserResponse.Unmarshal(m, b)
}
func (m *ListUserResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ListUserResponse.Marshal(b, m, deterministic)
}
func (dst *ListUserResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_ListUserResponse.Merge(dst, src)
}
func (m *ListUserResponse) XXX_Size() int {
return xxx_messageInfo_ListUserResponse.Size(m)
}
func (m *ListUserResponse) XXX_DiscardUnknown() {
xxx_messageInfo_ListUserResponse.DiscardUnknown(m)
}
var xxx_messageInfo_ListUserResponse proto.InternalMessageInfo
func (m *ListUserResponse) GetTotalCount() int64 {
if m != nil {
return m.TotalCount
}
return 0
}
func (m *ListUserResponse) GetResult() []*UserListItem {
if m != nil {
return m.Result
}
return nil
}
type UpdateUserPasswordRequest struct {
// User ID.
UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
// New pasword.
Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *UpdateUserPasswordRequest) Reset() { *m = UpdateUserPasswordRequest{} }
func (m *UpdateUserPasswordRequest) String() string { return proto.CompactTextString(m) }
func (*UpdateUserPasswordRequest) ProtoMessage() {}
func (*UpdateUserPasswordRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_116e343673f7ffaf, []int{11}
}
func (m *UpdateUserPasswordRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_UpdateUserPasswordRequest.Unmarshal(m, b)
}
func (m *UpdateUserPasswordRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_UpdateUserPasswordRequest.Marshal(b, m, deterministic)
}
func (dst *UpdateUserPasswordRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_UpdateUserPasswordRequest.Merge(dst, src)
}
func (m *UpdateUserPasswordRequest) XXX_Size() int {
return xxx_messageInfo_UpdateUserPasswordRequest.Size(m)
}
func (m *UpdateUserPasswordRequest) XXX_DiscardUnknown() {
xxx_messageInfo_UpdateUserPasswordRequest.DiscardUnknown(m)
}
var xxx_messageInfo_UpdateUserPasswordRequest proto.InternalMessageInfo
func (m *UpdateUserPasswordRequest) GetUserId() int64 {
if m != nil {
return m.UserId
}
return 0
}
func (m *UpdateUserPasswordRequest) GetPassword() string {
if m != nil {
return m.Password
}
return ""
}
func init() {
proto.RegisterType((*User)(nil), "api.User")
proto.RegisterType((*UserListItem)(nil), "api.UserListItem")
proto.RegisterType((*UserOrganization)(nil), "api.UserOrganization")
proto.RegisterType((*CreateUserRequest)(nil), "api.CreateUserRequest")
proto.RegisterType((*CreateUserResponse)(nil), "api.CreateUserResponse")
proto.RegisterType((*GetUserRequest)(nil), "api.GetUserRequest")
proto.RegisterType((*GetUserResponse)(nil), "api.GetUserResponse")
proto.RegisterType((*UpdateUserRequest)(nil), "api.UpdateUserRequest")
proto.RegisterType((*DeleteUserRequest)(nil), "api.DeleteUserRequest")
proto.RegisterType((*ListUserRequest)(nil), "api.ListUserRequest")
proto.RegisterType((*ListUserResponse)(nil), "api.ListUserResponse")
proto.RegisterType((*UpdateUserPasswordRequest)(nil), "api.UpdateUserPasswordRequest")
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// UserServiceClient is the client API for UserService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type UserServiceClient interface {
// Get user list.
List(ctx context.Context, in *ListUserRequest, opts ...grpc.CallOption) (*ListUserResponse, error)
// Get data for a particular user.
Get(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*GetUserResponse, error)
// Create a new user.
Create(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*CreateUserResponse, error)
// Update an existing user.
Update(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*empty.Empty, error)
// Delete a user.
Delete(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*empty.Empty, error)
// UpdatePassword updates a password.
UpdatePassword(ctx context.Context, in *UpdateUserPasswordRequest, opts ...grpc.CallOption) (*empty.Empty, error)
}
type userServiceClient struct {
cc *grpc.ClientConn
}
func NewUserServiceClient(cc *grpc.ClientConn) UserServiceClient {
return &userServiceClient{cc}
}
func (c *userServiceClient) List(ctx context.Context, in *ListUserRequest, opts ...grpc.CallOption) (*ListUserResponse, error) {
out := new(ListUserResponse)
err := c.cc.Invoke(ctx, "/api.UserService/List", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userServiceClient) Get(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*GetUserResponse, error) {
out := new(GetUserResponse)
err := c.cc.Invoke(ctx, "/api.UserService/Get", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userServiceClient) Create(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*CreateUserResponse, error) {
out := new(CreateUserResponse)
err := c.cc.Invoke(ctx, "/api.UserService/Create", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userServiceClient) Update(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
out := new(empty.Empty)
err := c.cc.Invoke(ctx, "/api.UserService/Update", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userServiceClient) Delete(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
out := new(empty.Empty)
err := c.cc.Invoke(ctx, "/api.UserService/Delete", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userServiceClient) UpdatePassword(ctx context.Context, in *UpdateUserPasswordRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
out := new(empty.Empty)
err := c.cc.Invoke(ctx, "/api.UserService/UpdatePassword", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// UserServiceServer is the server API for UserService service.
type UserServiceServer interface {
// Get user list.
List(context.Context, *ListUserRequest) (*ListUserResponse, error)
// Get data for a particular user.
Get(context.Context, *GetUserRequest) (*GetUserResponse, error)
// Create a new user.
Create(context.Context, *CreateUserRequest) (*CreateUserResponse, error)
// Update an existing user.
Update(context.Context, *UpdateUserRequest) (*empty.Empty, error)
// Delete a user.
Delete(context.Context, *DeleteUserRequest) (*empty.Empty, error)
// UpdatePassword updates a password.
UpdatePassword(context.Context, *UpdateUserPasswordRequest) (*empty.Empty, error)
}
func RegisterUserServiceServer(s *grpc.Server, srv UserServiceServer) {
s.RegisterService(&_UserService_serviceDesc, srv)
}
func _UserService_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListUserRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserServiceServer).List(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.UserService/List",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserServiceServer).List(ctx, req.(*ListUserRequest))
}
return interceptor(ctx, in, info, handler)
}
func _UserService_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetUserRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserServiceServer).Get(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.UserService/Get",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserServiceServer).Get(ctx, req.(*GetUserRequest))
}
return interceptor(ctx, in, info, handler)
}
func _UserService_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateUserRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserServiceServer).Create(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.UserService/Create",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserServiceServer).Create(ctx, req.(*CreateUserRequest))
}
return interceptor(ctx, in, info, handler)
}
func _UserService_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateUserRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserServiceServer).Update(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.UserService/Update",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserServiceServer).Update(ctx, req.(*UpdateUserRequest))
}
return interceptor(ctx, in, info, handler)
}
func _UserService_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteUserRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserServiceServer).Delete(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.UserService/Delete",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserServiceServer).Delete(ctx, req.(*DeleteUserRequest))
}
return interceptor(ctx, in, info, handler)
}
func _UserService_UpdatePassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateUserPasswordRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserServiceServer).UpdatePassword(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.UserService/UpdatePassword",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserServiceServer).UpdatePassword(ctx, req.(*UpdateUserPasswordRequest))
}
return interceptor(ctx, in, info, handler)
}
var _UserService_serviceDesc = grpc.ServiceDesc{
ServiceName: "api.UserService",
HandlerType: (*UserServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "List",
Handler: _UserService_List_Handler,
},
{
MethodName: "Get",
Handler: _UserService_Get_Handler,
},
{
MethodName: "Create",
Handler: _UserService_Create_Handler,
},
{
MethodName: "Update",
Handler: _UserService_Update_Handler,
},
{
MethodName: "Delete",
Handler: _UserService_Delete_Handler,
},
{
MethodName: "UpdatePassword",
Handler: _UserService_UpdatePassword_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "user.proto",
}
func init() { proto.RegisterFile("user.proto", fileDescriptor_116e343673f7ffaf) }
var fileDescriptor_116e343673f7ffaf = []byte{
// 760 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x55, 0xc1, 0x6e, 0xd3, 0x4c,
0x10, 0x96, 0xe3, 0xc4, 0x4d, 0x26, 0xfd, 0x93, 0x66, 0xff, 0xb4, 0x75, 0xdd, 0xbf, 0x7f, 0x22,
0x83, 0x44, 0xe8, 0x21, 0x91, 0xc2, 0x89, 0x72, 0x8a, 0x5a, 0x54, 0x45, 0xaa, 0x44, 0x31, 0x2d,
0x88, 0x0b, 0xd1, 0x36, 0xde, 0x96, 0x95, 0x62, 0xaf, 0xf1, 0x6e,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