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.

257 lines
9.1 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. // 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_ChangePassword_FullMethodName = "/users.Users/ChangePassword"
  22. Users_ResetPassword_FullMethodName = "/users.Users/ResetPassword"
  23. )
  24. // UsersClient is the client API for Users service.
  25. //
  26. // 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.
  27. type UsersClient interface {
  28. Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error)
  29. Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error)
  30. Authorize(ctx context.Context, in *AuthorizeRequest, opts ...grpc.CallOption) (*AuthorizeResponse, error)
  31. ChangePassword(ctx context.Context, in *ChangePasswordRequest, opts ...grpc.CallOption) (*ChangePasswordResponse, error)
  32. ResetPassword(ctx context.Context, in *ResetPasswordReqeust, opts ...grpc.CallOption) (*ResetPasswordResponse, error)
  33. }
  34. type usersClient struct {
  35. cc grpc.ClientConnInterface
  36. }
  37. func NewUsersClient(cc grpc.ClientConnInterface) UsersClient {
  38. return &usersClient{cc}
  39. }
  40. func (c *usersClient) Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error) {
  41. out := new(RegisterResponse)
  42. err := c.cc.Invoke(ctx, Users_Register_FullMethodName, in, out, opts...)
  43. if err != nil {
  44. return nil, err
  45. }
  46. return out, nil
  47. }
  48. func (c *usersClient) Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) {
  49. out := new(LoginResponse)
  50. err := c.cc.Invoke(ctx, Users_Login_FullMethodName, in, out, opts...)
  51. if err != nil {
  52. return nil, err
  53. }
  54. return out, nil
  55. }
  56. func (c *usersClient) Authorize(ctx context.Context, in *AuthorizeRequest, opts ...grpc.CallOption) (*AuthorizeResponse, error) {
  57. out := new(AuthorizeResponse)
  58. err := c.cc.Invoke(ctx, Users_Authorize_FullMethodName, in, out, opts...)
  59. if err != nil {
  60. return nil, err
  61. }
  62. return out, nil
  63. }
  64. func (c *usersClient) ChangePassword(ctx context.Context, in *ChangePasswordRequest, opts ...grpc.CallOption) (*ChangePasswordResponse, error) {
  65. out := new(ChangePasswordResponse)
  66. err := c.cc.Invoke(ctx, Users_ChangePassword_FullMethodName, in, out, opts...)
  67. if err != nil {
  68. return nil, err
  69. }
  70. return out, nil
  71. }
  72. func (c *usersClient) ResetPassword(ctx context.Context, in *ResetPasswordReqeust, opts ...grpc.CallOption) (*ResetPasswordResponse, error) {
  73. out := new(ResetPasswordResponse)
  74. err := c.cc.Invoke(ctx, Users_ResetPassword_FullMethodName, in, out, opts...)
  75. if err != nil {
  76. return nil, err
  77. }
  78. return out, nil
  79. }
  80. // UsersServer is the server API for Users service.
  81. // All implementations must embed UnimplementedUsersServer
  82. // for forward compatibility
  83. type UsersServer interface {
  84. Register(context.Context, *RegisterRequest) (*RegisterResponse, error)
  85. Login(context.Context, *LoginRequest) (*LoginResponse, error)
  86. Authorize(context.Context, *AuthorizeRequest) (*AuthorizeResponse, error)
  87. ChangePassword(context.Context, *ChangePasswordRequest) (*ChangePasswordResponse, error)
  88. ResetPassword(context.Context, *ResetPasswordReqeust) (*ResetPasswordResponse, error)
  89. mustEmbedUnimplementedUsersServer()
  90. }
  91. // UnimplementedUsersServer must be embedded to have forward compatible implementations.
  92. type UnimplementedUsersServer struct {
  93. }
  94. func (UnimplementedUsersServer) Register(context.Context, *RegisterRequest) (*RegisterResponse, error) {
  95. return nil, status.Errorf(codes.Unimplemented, "method Register not implemented")
  96. }
  97. func (UnimplementedUsersServer) Login(context.Context, *LoginRequest) (*LoginResponse, error) {
  98. return nil, status.Errorf(codes.Unimplemented, "method Login not implemented")
  99. }
  100. func (UnimplementedUsersServer) Authorize(context.Context, *AuthorizeRequest) (*AuthorizeResponse, error) {
  101. return nil, status.Errorf(codes.Unimplemented, "method Authorize not implemented")
  102. }
  103. func (UnimplementedUsersServer) ChangePassword(context.Context, *ChangePasswordRequest) (*ChangePasswordResponse, error) {
  104. return nil, status.Errorf(codes.Unimplemented, "method ChangePassword not implemented")
  105. }
  106. func (UnimplementedUsersServer) ResetPassword(context.Context, *ResetPasswordReqeust) (*ResetPasswordResponse, error) {
  107. return nil, status.Errorf(codes.Unimplemented, "method ResetPassword not implemented")
  108. }
  109. func (UnimplementedUsersServer) mustEmbedUnimplementedUsersServer() {}
  110. // UnsafeUsersServer may be embedded to opt out of forward compatibility for this service.
  111. // Use of this interface is not recommended, as added methods to UsersServer will
  112. // result in compilation errors.
  113. type UnsafeUsersServer interface {
  114. mustEmbedUnimplementedUsersServer()
  115. }
  116. func RegisterUsersServer(s grpc.ServiceRegistrar, srv UsersServer) {
  117. s.RegisterService(&Users_ServiceDesc, srv)
  118. }
  119. func _Users_Register_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  120. in := new(RegisterRequest)
  121. if err := dec(in); err != nil {
  122. return nil, err
  123. }
  124. if interceptor == nil {
  125. return srv.(UsersServer).Register(ctx, in)
  126. }
  127. info := &grpc.UnaryServerInfo{
  128. Server: srv,
  129. FullMethod: Users_Register_FullMethodName,
  130. }
  131. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  132. return srv.(UsersServer).Register(ctx, req.(*RegisterRequest))
  133. }
  134. return interceptor(ctx, in, info, handler)
  135. }
  136. func _Users_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  137. in := new(LoginRequest)
  138. if err := dec(in); err != nil {
  139. return nil, err
  140. }
  141. if interceptor == nil {
  142. return srv.(UsersServer).Login(ctx, in)
  143. }
  144. info := &grpc.UnaryServerInfo{
  145. Server: srv,
  146. FullMethod: Users_Login_FullMethodName,
  147. }
  148. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  149. return srv.(UsersServer).Login(ctx, req.(*LoginRequest))
  150. }
  151. return interceptor(ctx, in, info, handler)
  152. }
  153. func _Users_Authorize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  154. in := new(AuthorizeRequest)
  155. if err := dec(in); err != nil {
  156. return nil, err
  157. }
  158. if interceptor == nil {
  159. return srv.(UsersServer).Authorize(ctx, in)
  160. }
  161. info := &grpc.UnaryServerInfo{
  162. Server: srv,
  163. FullMethod: Users_Authorize_FullMethodName,
  164. }
  165. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  166. return srv.(UsersServer).Authorize(ctx, req.(*AuthorizeRequest))
  167. }
  168. return interceptor(ctx, in, info, handler)
  169. }
  170. func _Users_ChangePassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  171. in := new(ChangePasswordRequest)
  172. if err := dec(in); err != nil {
  173. return nil, err
  174. }
  175. if interceptor == nil {
  176. return srv.(UsersServer).ChangePassword(ctx, in)
  177. }
  178. info := &grpc.UnaryServerInfo{
  179. Server: srv,
  180. FullMethod: Users_ChangePassword_FullMethodName,
  181. }
  182. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  183. return srv.(UsersServer).ChangePassword(ctx, req.(*ChangePasswordRequest))
  184. }
  185. return interceptor(ctx, in, info, handler)
  186. }
  187. func _Users_ResetPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  188. in := new(ResetPasswordReqeust)
  189. if err := dec(in); err != nil {
  190. return nil, err
  191. }
  192. if interceptor == nil {
  193. return srv.(UsersServer).ResetPassword(ctx, in)
  194. }
  195. info := &grpc.UnaryServerInfo{
  196. Server: srv,
  197. FullMethod: Users_ResetPassword_FullMethodName,
  198. }
  199. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  200. return srv.(UsersServer).ResetPassword(ctx, req.(*ResetPasswordReqeust))
  201. }
  202. return interceptor(ctx, in, info, handler)
  203. }
  204. // Users_ServiceDesc is the grpc.ServiceDesc for Users service.
  205. // It's only intended for direct use with grpc.RegisterService,
  206. // and not to be introspected or modified (even as a copy)
  207. var Users_ServiceDesc = grpc.ServiceDesc{
  208. ServiceName: "users.Users",
  209. HandlerType: (*UsersServer)(nil),
  210. Methods: []grpc.MethodDesc{
  211. {
  212. MethodName: "Register",
  213. Handler: _Users_Register_Handler,
  214. },
  215. {
  216. MethodName: "Login",
  217. Handler: _Users_Login_Handler,
  218. },
  219. {
  220. MethodName: "Authorize",
  221. Handler: _Users_Authorize_Handler,
  222. },
  223. {
  224. MethodName: "ChangePassword",
  225. Handler: _Users_ChangePassword_Handler,
  226. },
  227. {
  228. MethodName: "ResetPassword",
  229. Handler: _Users_ResetPassword_Handler,
  230. },
  231. },
  232. Streams: []grpc.StreamDesc{},
  233. Metadata: "proto/users.proto",
  234. }