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.

368 lines
13 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 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 (unknown)
  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_Logout_FullMethodName = "/users.Users/Logout"
  21. Users_Authorize_FullMethodName = "/users.Users/Authorize"
  22. Users_ResetPassword_FullMethodName = "/users.Users/ResetPassword"
  23. Users_ChangePassword_FullMethodName = "/users.Users/ChangePassword"
  24. Users_ListRoles_FullMethodName = "/users.Users/ListRoles"
  25. Users_SetRoles_FullMethodName = "/users.Users/SetRoles"
  26. )
  27. // UsersClient is the client API for Users service.
  28. //
  29. // 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.
  30. type UsersClient interface {
  31. Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error)
  32. Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error)
  33. Logout(ctx context.Context, in *LogoutRequest, opts ...grpc.CallOption) (*LogoutResponse, error)
  34. Authorize(ctx context.Context, in *AuthorizeRequest, opts ...grpc.CallOption) (*AuthorizeResponse, error)
  35. ResetPassword(ctx context.Context, in *ResetPasswordRequest, opts ...grpc.CallOption) (*ResetPasswordResponse, error)
  36. ChangePassword(ctx context.Context, in *ChangePasswordRequest, opts ...grpc.CallOption) (*ChangePasswordResponse, error)
  37. ListRoles(ctx context.Context, in *ListRolesRequest, opts ...grpc.CallOption) (*ListRolesResponse, error)
  38. SetRoles(ctx context.Context, in *SetRolesRequest, opts ...grpc.CallOption) (*SetRolesResponse, error)
  39. }
  40. type usersClient struct {
  41. cc grpc.ClientConnInterface
  42. }
  43. func NewUsersClient(cc grpc.ClientConnInterface) UsersClient {
  44. return &usersClient{cc}
  45. }
  46. func (c *usersClient) Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error) {
  47. out := new(RegisterResponse)
  48. err := c.cc.Invoke(ctx, Users_Register_FullMethodName, in, out, opts...)
  49. if err != nil {
  50. return nil, err
  51. }
  52. return out, nil
  53. }
  54. func (c *usersClient) Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) {
  55. out := new(LoginResponse)
  56. err := c.cc.Invoke(ctx, Users_Login_FullMethodName, in, out, opts...)
  57. if err != nil {
  58. return nil, err
  59. }
  60. return out, nil
  61. }
  62. func (c *usersClient) Logout(ctx context.Context, in *LogoutRequest, opts ...grpc.CallOption) (*LogoutResponse, error) {
  63. out := new(LogoutResponse)
  64. err := c.cc.Invoke(ctx, Users_Logout_FullMethodName, in, out, opts...)
  65. if err != nil {
  66. return nil, err
  67. }
  68. return out, nil
  69. }
  70. func (c *usersClient) Authorize(ctx context.Context, in *AuthorizeRequest, opts ...grpc.CallOption) (*AuthorizeResponse, error) {
  71. out := new(AuthorizeResponse)
  72. err := c.cc.Invoke(ctx, Users_Authorize_FullMethodName, in, out, opts...)
  73. if err != nil {
  74. return nil, err
  75. }
  76. return out, nil
  77. }
  78. func (c *usersClient) ResetPassword(ctx context.Context, in *ResetPasswordRequest, opts ...grpc.CallOption) (*ResetPasswordResponse, error) {
  79. out := new(ResetPasswordResponse)
  80. err := c.cc.Invoke(ctx, Users_ResetPassword_FullMethodName, in, out, opts...)
  81. if err != nil {
  82. return nil, err
  83. }
  84. return out, nil
  85. }
  86. func (c *usersClient) ChangePassword(ctx context.Context, in *ChangePasswordRequest, opts ...grpc.CallOption) (*ChangePasswordResponse, error) {
  87. out := new(ChangePasswordResponse)
  88. err := c.cc.Invoke(ctx, Users_ChangePassword_FullMethodName, in, out, opts...)
  89. if err != nil {
  90. return nil, err
  91. }
  92. return out, nil
  93. }
  94. func (c *usersClient) ListRoles(ctx context.Context, in *ListRolesRequest, opts ...grpc.CallOption) (*ListRolesResponse, error) {
  95. out := new(ListRolesResponse)
  96. err := c.cc.Invoke(ctx, Users_ListRoles_FullMethodName, in, out, opts...)
  97. if err != nil {
  98. return nil, err
  99. }
  100. return out, nil
  101. }
  102. func (c *usersClient) SetRoles(ctx context.Context, in *SetRolesRequest, opts ...grpc.CallOption) (*SetRolesResponse, error) {
  103. out := new(SetRolesResponse)
  104. err := c.cc.Invoke(ctx, Users_SetRoles_FullMethodName, in, out, opts...)
  105. if err != nil {
  106. return nil, err
  107. }
  108. return out, nil
  109. }
  110. // UsersServer is the server API for Users service.
  111. // All implementations must embed UnimplementedUsersServer
  112. // for forward compatibility
  113. type UsersServer interface {
  114. Register(context.Context, *RegisterRequest) (*RegisterResponse, error)
  115. Login(context.Context, *LoginRequest) (*LoginResponse, error)
  116. Logout(context.Context, *LogoutRequest) (*LogoutResponse, error)
  117. Authorize(context.Context, *AuthorizeRequest) (*AuthorizeResponse, error)
  118. ResetPassword(context.Context, *ResetPasswordRequest) (*ResetPasswordResponse, error)
  119. ChangePassword(context.Context, *ChangePasswordRequest) (*ChangePasswordResponse, error)
  120. ListRoles(context.Context, *ListRolesRequest) (*ListRolesResponse, error)
  121. SetRoles(context.Context, *SetRolesRequest) (*SetRolesResponse, error)
  122. mustEmbedUnimplementedUsersServer()
  123. }
  124. // UnimplementedUsersServer must be embedded to have forward compatible implementations.
  125. type UnimplementedUsersServer struct {
  126. }
  127. func (UnimplementedUsersServer) Register(context.Context, *RegisterRequest) (*RegisterResponse, error) {
  128. return nil, status.Errorf(codes.Unimplemented, "method Register not implemented")
  129. }
  130. func (UnimplementedUsersServer) Login(context.Context, *LoginRequest) (*LoginResponse, error) {
  131. return nil, status.Errorf(codes.Unimplemented, "method Login not implemented")
  132. }
  133. func (UnimplementedUsersServer) Logout(context.Context, *LogoutRequest) (*LogoutResponse, error) {
  134. return nil, status.Errorf(codes.Unimplemented, "method Logout not implemented")
  135. }
  136. func (UnimplementedUsersServer) Authorize(context.Context, *AuthorizeRequest) (*AuthorizeResponse, error) {
  137. return nil, status.Errorf(codes.Unimplemented, "method Authorize not implemented")
  138. }
  139. func (UnimplementedUsersServer) ResetPassword(context.Context, *ResetPasswordRequest) (*ResetPasswordResponse, error) {
  140. return nil, status.Errorf(codes.Unimplemented, "method ResetPassword not implemented")
  141. }
  142. func (UnimplementedUsersServer) ChangePassword(context.Context, *ChangePasswordRequest) (*ChangePasswordResponse, error) {
  143. return nil, status.Errorf(codes.Unimplemented, "method ChangePassword not implemented")
  144. }
  145. func (UnimplementedUsersServer) ListRoles(context.Context, *ListRolesRequest) (*ListRolesResponse, error) {
  146. return nil, status.Errorf(codes.Unimplemented, "method ListRoles not implemented")
  147. }
  148. func (UnimplementedUsersServer) SetRoles(context.Context, *SetRolesRequest) (*SetRolesResponse, error) {
  149. return nil, status.Errorf(codes.Unimplemented, "method SetRoles not implemented")
  150. }
  151. func (UnimplementedUsersServer) mustEmbedUnimplementedUsersServer() {}
  152. // UnsafeUsersServer may be embedded to opt out of forward compatibility for this service.
  153. // Use of this interface is not recommended, as added methods to UsersServer will
  154. // result in compilation errors.
  155. type UnsafeUsersServer interface {
  156. mustEmbedUnimplementedUsersServer()
  157. }
  158. func RegisterUsersServer(s grpc.ServiceRegistrar, srv UsersServer) {
  159. s.RegisterService(&Users_ServiceDesc, srv)
  160. }
  161. func _Users_Register_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  162. in := new(RegisterRequest)
  163. if err := dec(in); err != nil {
  164. return nil, err
  165. }
  166. if interceptor == nil {
  167. return srv.(UsersServer).Register(ctx, in)
  168. }
  169. info := &grpc.UnaryServerInfo{
  170. Server: srv,
  171. FullMethod: Users_Register_FullMethodName,
  172. }
  173. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  174. return srv.(UsersServer).Register(ctx, req.(*RegisterRequest))
  175. }
  176. return interceptor(ctx, in, info, handler)
  177. }
  178. func _Users_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  179. in := new(LoginRequest)
  180. if err := dec(in); err != nil {
  181. return nil, err
  182. }
  183. if interceptor == nil {
  184. return srv.(UsersServer).Login(ctx, in)
  185. }
  186. info := &grpc.UnaryServerInfo{
  187. Server: srv,
  188. FullMethod: Users_Login_FullMethodName,
  189. }
  190. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  191. return srv.(UsersServer).Login(ctx, req.(*LoginRequest))
  192. }
  193. return interceptor(ctx, in, info, handler)
  194. }
  195. func _Users_Logout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  196. in := new(LogoutRequest)
  197. if err := dec(in); err != nil {
  198. return nil, err
  199. }
  200. if interceptor == nil {
  201. return srv.(UsersServer).Logout(ctx, in)
  202. }
  203. info := &grpc.UnaryServerInfo{
  204. Server: srv,
  205. FullMethod: Users_Logout_FullMethodName,
  206. }
  207. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  208. return srv.(UsersServer).Logout(ctx, req.(*LogoutRequest))
  209. }
  210. return interceptor(ctx, in, info, handler)
  211. }
  212. func _Users_Authorize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  213. in := new(AuthorizeRequest)
  214. if err := dec(in); err != nil {
  215. return nil, err
  216. }
  217. if interceptor == nil {
  218. return srv.(UsersServer).Authorize(ctx, in)
  219. }
  220. info := &grpc.UnaryServerInfo{
  221. Server: srv,
  222. FullMethod: Users_Authorize_FullMethodName,
  223. }
  224. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  225. return srv.(UsersServer).Authorize(ctx, req.(*AuthorizeRequest))
  226. }
  227. return interceptor(ctx, in, info, handler)
  228. }
  229. func _Users_ResetPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  230. in := new(ResetPasswordRequest)
  231. if err := dec(in); err != nil {
  232. return nil, err
  233. }
  234. if interceptor == nil {
  235. return srv.(UsersServer).ResetPassword(ctx, in)
  236. }
  237. info := &grpc.UnaryServerInfo{
  238. Server: srv,
  239. FullMethod: Users_ResetPassword_FullMethodName,
  240. }
  241. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  242. return srv.(UsersServer).ResetPassword(ctx, req.(*ResetPasswordRequest))
  243. }
  244. return interceptor(ctx, in, info, handler)
  245. }
  246. func _Users_ChangePassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  247. in := new(ChangePasswordRequest)
  248. if err := dec(in); err != nil {
  249. return nil, err
  250. }
  251. if interceptor == nil {
  252. return srv.(UsersServer).ChangePassword(ctx, in)
  253. }
  254. info := &grpc.UnaryServerInfo{
  255. Server: srv,
  256. FullMethod: Users_ChangePassword_FullMethodName,
  257. }
  258. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  259. return srv.(UsersServer).ChangePassword(ctx, req.(*ChangePasswordRequest))
  260. }
  261. return interceptor(ctx, in, info, handler)
  262. }
  263. func _Users_ListRoles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  264. in := new(ListRolesRequest)
  265. if err := dec(in); err != nil {
  266. return nil, err
  267. }
  268. if interceptor == nil {
  269. return srv.(UsersServer).ListRoles(ctx, in)
  270. }
  271. info := &grpc.UnaryServerInfo{
  272. Server: srv,
  273. FullMethod: Users_ListRoles_FullMethodName,
  274. }
  275. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  276. return srv.(UsersServer).ListRoles(ctx, req.(*ListRolesRequest))
  277. }
  278. return interceptor(ctx, in, info, handler)
  279. }
  280. func _Users_SetRoles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  281. in := new(SetRolesRequest)
  282. if err := dec(in); err != nil {
  283. return nil, err
  284. }
  285. if interceptor == nil {
  286. return srv.(UsersServer).SetRoles(ctx, in)
  287. }
  288. info := &grpc.UnaryServerInfo{
  289. Server: srv,
  290. FullMethod: Users_SetRoles_FullMethodName,
  291. }
  292. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  293. return srv.(UsersServer).SetRoles(ctx, req.(*SetRolesRequest))
  294. }
  295. return interceptor(ctx, in, info, handler)
  296. }
  297. // Users_ServiceDesc is the grpc.ServiceDesc for Users service.
  298. // It's only intended for direct use with grpc.RegisterService,
  299. // and not to be introspected or modified (even as a copy)
  300. var Users_ServiceDesc = grpc.ServiceDesc{
  301. ServiceName: "users.Users",
  302. HandlerType: (*UsersServer)(nil),
  303. Methods: []grpc.MethodDesc{
  304. {
  305. MethodName: "Register",
  306. Handler: _Users_Register_Handler,
  307. },
  308. {
  309. MethodName: "Login",
  310. Handler: _Users_Login_Handler,
  311. },
  312. {
  313. MethodName: "Logout",
  314. Handler: _Users_Logout_Handler,
  315. },
  316. {
  317. MethodName: "Authorize",
  318. Handler: _Users_Authorize_Handler,
  319. },
  320. {
  321. MethodName: "ResetPassword",
  322. Handler: _Users_ResetPassword_Handler,
  323. },
  324. {
  325. MethodName: "ChangePassword",
  326. Handler: _Users_ChangePassword_Handler,
  327. },
  328. {
  329. MethodName: "ListRoles",
  330. Handler: _Users_ListRoles_Handler,
  331. },
  332. {
  333. MethodName: "SetRoles",
  334. Handler: _Users_SetRoles_Handler,
  335. },
  336. },
  337. Streams: []grpc.StreamDesc{},
  338. Metadata: "proto/users.proto",
  339. }