You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

331 lines
12 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
  2. // versions:
  3. // - protoc-gen-go-grpc v1.3.0
  4. // - protoc v3.15.6
  5. // source: proto/users.proto
  6. package proto
  7. import (
  8. context "context"
  9. grpc "google.golang.org/grpc"
  10. codes "google.golang.org/grpc/codes"
  11. status "google.golang.org/grpc/status"
  12. )
  13. // This is a compile-time assertion to ensure that this generated file
  14. // is compatible with the grpc package it is being compiled against.
  15. // Requires gRPC-Go v1.32.0 or later.
  16. const _ = grpc.SupportPackageIsVersion7
  17. const (
  18. Users_Register_FullMethodName = "/users.Users/Register"
  19. Users_Login_FullMethodName = "/users.Users/Login"
  20. Users_Authorize_FullMethodName = "/users.Users/Authorize"
  21. Users_ResetPassword_FullMethodName = "/users.Users/ResetPassword"
  22. Users_ChangePassword_FullMethodName = "/users.Users/ChangePassword"
  23. Users_ListRoles_FullMethodName = "/users.Users/ListRoles"
  24. Users_SetRoles_FullMethodName = "/users.Users/SetRoles"
  25. )
  26. // UsersClient is the client API for Users service.
  27. //
  28. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
  29. type UsersClient interface {
  30. Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error)
  31. Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error)
  32. Authorize(ctx context.Context, in *AuthorizeRequest, opts ...grpc.CallOption) (*AuthorizeResponse, error)
  33. ResetPassword(ctx context.Context, in *ResetPasswordRequest, opts ...grpc.CallOption) (*ResetPasswordResponse, error)
  34. ChangePassword(ctx context.Context, in *ChangePasswordRequest, opts ...grpc.CallOption) (*ChangePasswordResponse, error)
  35. ListRoles(ctx context.Context, in *ListRolesRequest, opts ...grpc.CallOption) (*ListRolesResponse, error)
  36. SetRoles(ctx context.Context, in *SetRolesRequest, opts ...grpc.CallOption) (*SetRolesResponse, error)
  37. }
  38. type usersClient struct {
  39. cc grpc.ClientConnInterface
  40. }
  41. func NewUsersClient(cc grpc.ClientConnInterface) UsersClient {
  42. return &usersClient{cc}
  43. }
  44. func (c *usersClient) Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error) {
  45. out := new(RegisterResponse)
  46. err := c.cc.Invoke(ctx, Users_Register_FullMethodName, in, out, opts...)
  47. if err != nil {
  48. return nil, err
  49. }
  50. return out, nil
  51. }
  52. func (c *usersClient) Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) {
  53. out := new(LoginResponse)
  54. err := c.cc.Invoke(ctx, Users_Login_FullMethodName, in, out, opts...)
  55. if err != nil {
  56. return nil, err
  57. }
  58. return out, nil
  59. }
  60. func (c *usersClient) Authorize(ctx context.Context, in *AuthorizeRequest, opts ...grpc.CallOption) (*AuthorizeResponse, error) {
  61. out := new(AuthorizeResponse)
  62. err := c.cc.Invoke(ctx, Users_Authorize_FullMethodName, in, out, opts...)
  63. if err != nil {
  64. return nil, err
  65. }
  66. return out, nil
  67. }
  68. func (c *usersClient) ResetPassword(ctx context.Context, in *ResetPasswordRequest, opts ...grpc.CallOption) (*ResetPasswordResponse, error) {
  69. out := new(ResetPasswordResponse)
  70. err := c.cc.Invoke(ctx, Users_ResetPassword_FullMethodName, in, out, opts...)
  71. if err != nil {
  72. return nil, err
  73. }
  74. return out, nil
  75. }
  76. func (c *usersClient) ChangePassword(ctx context.Context, in *ChangePasswordRequest, opts ...grpc.CallOption) (*ChangePasswordResponse, error) {
  77. out := new(ChangePasswordResponse)
  78. err := c.cc.Invoke(ctx, Users_ChangePassword_FullMethodName, in, out, opts...)
  79. if err != nil {
  80. return nil, err
  81. }
  82. return out, nil
  83. }
  84. func (c *usersClient) ListRoles(ctx context.Context, in *ListRolesRequest, opts ...grpc.CallOption) (*ListRolesResponse, error) {
  85. out := new(ListRolesResponse)
  86. err := c.cc.Invoke(ctx, Users_ListRoles_FullMethodName, in, out, opts...)
  87. if err != nil {
  88. return nil, err
  89. }
  90. return out, nil
  91. }
  92. func (c *usersClient) SetRoles(ctx context.Context, in *SetRolesRequest, opts ...grpc.CallOption) (*SetRolesResponse, error) {
  93. out := new(SetRolesResponse)
  94. err := c.cc.Invoke(ctx, Users_SetRoles_FullMethodName, in, out, opts...)
  95. if err != nil {
  96. return nil, err
  97. }
  98. return out, nil
  99. }
  100. // UsersServer is the server API for Users service.
  101. // All implementations must embed UnimplementedUsersServer
  102. // for forward compatibility
  103. type UsersServer interface {
  104. Register(context.Context, *RegisterRequest) (*RegisterResponse, error)
  105. Login(context.Context, *LoginRequest) (*LoginResponse, error)
  106. Authorize(context.Context, *AuthorizeRequest) (*AuthorizeResponse, error)
  107. ResetPassword(context.Context, *ResetPasswordRequest) (*ResetPasswordResponse, error)
  108. ChangePassword(context.Context, *ChangePasswordRequest) (*ChangePasswordResponse, error)
  109. ListRoles(context.Context, *ListRolesRequest) (*ListRolesResponse, error)
  110. SetRoles(context.Context, *SetRolesRequest) (*SetRolesResponse, error)
  111. mustEmbedUnimplementedUsersServer()
  112. }
  113. // UnimplementedUsersServer must be embedded to have forward compatible implementations.
  114. type UnimplementedUsersServer struct {
  115. }
  116. func (UnimplementedUsersServer) Register(context.Context, *RegisterRequest) (*RegisterResponse, error) {
  117. return nil, status.Errorf(codes.Unimplemented, "method Register not implemented")
  118. }
  119. func (UnimplementedUsersServer) Login(context.Context, *LoginRequest) (*LoginResponse, error) {
  120. return nil, status.Errorf(codes.Unimplemented, "method Login not implemented")
  121. }
  122. func (UnimplementedUsersServer) Authorize(context.Context, *AuthorizeRequest) (*AuthorizeResponse, error) {
  123. return nil, status.Errorf(codes.Unimplemented, "method Authorize not implemented")
  124. }
  125. func (UnimplementedUsersServer) ResetPassword(context.Context, *ResetPasswordRequest) (*ResetPasswordResponse, error) {
  126. return nil, status.Errorf(codes.Unimplemented, "method ResetPassword not implemented")
  127. }
  128. func (UnimplementedUsersServer) ChangePassword(context.Context, *ChangePasswordRequest) (*ChangePasswordResponse, error) {
  129. return nil, status.Errorf(codes.Unimplemented, "method ChangePassword not implemented")
  130. }
  131. func (UnimplementedUsersServer) ListRoles(context.Context, *ListRolesRequest) (*ListRolesResponse, error) {
  132. return nil, status.Errorf(codes.Unimplemented, "method ListRoles not implemented")
  133. }
  134. func (UnimplementedUsersServer) SetRoles(context.Context, *SetRolesRequest) (*SetRolesResponse, error) {
  135. return nil, status.Errorf(codes.Unimplemented, "method SetRoles not implemented")
  136. }
  137. func (UnimplementedUsersServer) mustEmbedUnimplementedUsersServer() {}
  138. // UnsafeUsersServer may be embedded to opt out of forward compatibility for this service.
  139. // Use of this interface is not recommended, as added methods to UsersServer will
  140. // result in compilation errors.
  141. type UnsafeUsersServer interface {
  142. mustEmbedUnimplementedUsersServer()
  143. }
  144. func RegisterUsersServer(s grpc.ServiceRegistrar, srv UsersServer) {
  145. s.RegisterService(&Users_ServiceDesc, srv)
  146. }
  147. func _Users_Register_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  148. in := new(RegisterRequest)
  149. if err := dec(in); err != nil {
  150. return nil, err
  151. }
  152. if interceptor == nil {
  153. return srv.(UsersServer).Register(ctx, in)
  154. }
  155. info := &grpc.UnaryServerInfo{
  156. Server: srv,
  157. FullMethod: Users_Register_FullMethodName,
  158. }
  159. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  160. return srv.(UsersServer).Register(ctx, req.(*RegisterRequest))
  161. }
  162. return interceptor(ctx, in, info, handler)
  163. }
  164. func _Users_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  165. in := new(LoginRequest)
  166. if err := dec(in); err != nil {
  167. return nil, err
  168. }
  169. if interceptor == nil {
  170. return srv.(UsersServer).Login(ctx, in)
  171. }
  172. info := &grpc.UnaryServerInfo{
  173. Server: srv,
  174. FullMethod: Users_Login_FullMethodName,
  175. }
  176. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  177. return srv.(UsersServer).Login(ctx, req.(*LoginRequest))
  178. }
  179. return interceptor(ctx, in, info, handler)
  180. }
  181. func _Users_Authorize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  182. in := new(AuthorizeRequest)
  183. if err := dec(in); err != nil {
  184. return nil, err
  185. }
  186. if interceptor == nil {
  187. return srv.(UsersServer).Authorize(ctx, in)
  188. }
  189. info := &grpc.UnaryServerInfo{
  190. Server: srv,
  191. FullMethod: Users_Authorize_FullMethodName,
  192. }
  193. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  194. return srv.(UsersServer).Authorize(ctx, req.(*AuthorizeRequest))
  195. }
  196. return interceptor(ctx, in, info, handler)
  197. }
  198. func _Users_ResetPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  199. in := new(ResetPasswordRequest)
  200. if err := dec(in); err != nil {
  201. return nil, err
  202. }
  203. if interceptor == nil {
  204. return srv.(UsersServer).ResetPassword(ctx, in)
  205. }
  206. info := &grpc.UnaryServerInfo{
  207. Server: srv,
  208. FullMethod: Users_ResetPassword_FullMethodName,
  209. }
  210. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  211. return srv.(UsersServer).ResetPassword(ctx, req.(*ResetPasswordRequest))
  212. }
  213. return interceptor(ctx, in, info, handler)
  214. }
  215. func _Users_ChangePassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  216. in := new(ChangePasswordRequest)
  217. if err := dec(in); err != nil {
  218. return nil, err
  219. }
  220. if interceptor == nil {
  221. return srv.(UsersServer).ChangePassword(ctx, in)
  222. }
  223. info := &grpc.UnaryServerInfo{
  224. Server: srv,
  225. FullMethod: Users_ChangePassword_FullMethodName,
  226. }
  227. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  228. return srv.(UsersServer).ChangePassword(ctx, req.(*ChangePasswordRequest))
  229. }
  230. return interceptor(ctx, in, info, handler)
  231. }
  232. func _Users_ListRoles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  233. in := new(ListRolesRequest)
  234. if err := dec(in); err != nil {
  235. return nil, err
  236. }
  237. if interceptor == nil {
  238. return srv.(UsersServer).ListRoles(ctx, in)
  239. }
  240. info := &grpc.UnaryServerInfo{
  241. Server: srv,
  242. FullMethod: Users_ListRoles_FullMethodName,
  243. }
  244. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  245. return srv.(UsersServer).ListRoles(ctx, req.(*ListRolesRequest))
  246. }
  247. return interceptor(ctx, in, info, handler)
  248. }
  249. func _Users_SetRoles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  250. in := new(SetRolesRequest)
  251. if err := dec(in); err != nil {
  252. return nil, err
  253. }
  254. if interceptor == nil {
  255. return srv.(UsersServer).SetRoles(ctx, in)
  256. }
  257. info := &grpc.UnaryServerInfo{
  258. Server: srv,
  259. FullMethod: Users_SetRoles_FullMethodName,
  260. }
  261. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  262. return srv.(UsersServer).SetRoles(ctx, req.(*SetRolesRequest))
  263. }
  264. return interceptor(ctx, in, info, handler)
  265. }
  266. // Users_ServiceDesc is the grpc.ServiceDesc for Users service.
  267. // It's only intended for direct use with grpc.RegisterService,
  268. // and not to be introspected or modified (even as a copy)
  269. var Users_ServiceDesc = grpc.ServiceDesc{
  270. ServiceName: "users.Users",
  271. HandlerType: (*UsersServer)(nil),
  272. Methods: []grpc.MethodDesc{
  273. {
  274. MethodName: "Register",
  275. Handler: _Users_Register_Handler,
  276. },
  277. {
  278. MethodName: "Login",
  279. Handler: _Users_Login_Handler,
  280. },
  281. {
  282. MethodName: "Authorize",
  283. Handler: _Users_Authorize_Handler,
  284. },
  285. {
  286. MethodName: "ResetPassword",
  287. Handler: _Users_ResetPassword_Handler,
  288. },
  289. {
  290. MethodName: "ChangePassword",
  291. Handler: _Users_ChangePassword_Handler,
  292. },
  293. {
  294. MethodName: "ListRoles",
  295. Handler: _Users_ListRoles_Handler,
  296. },
  297. {
  298. MethodName: "SetRoles",
  299. Handler: _Users_SetRoles_Handler,
  300. },
  301. },
  302. Streams: []grpc.StreamDesc{},
  303. Metadata: "proto/users.proto",
  304. }