account_grpc.pb.go 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
  2. package account
  3. import (
  4. context "context"
  5. grpc "google.golang.org/grpc"
  6. codes "google.golang.org/grpc/codes"
  7. status "google.golang.org/grpc/status"
  8. emptypb "google.golang.org/protobuf/types/known/emptypb"
  9. )
  10. // This is a compile-time assertion to ensure that this generated file
  11. // is compatible with the grpc package it is being compiled against.
  12. // Requires gRPC-Go v1.32.0 or later.
  13. const _ = grpc.SupportPackageIsVersion7
  14. // AccountClient is the client API for Account service.
  15. //
  16. // 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.
  17. type AccountClient interface {
  18. DebugLogin(ctx context.Context, in *DebugLoginRequest, opts ...grpc.CallOption) (*TokenReply, error)
  19. Authorization(ctx context.Context, in *AuthorizationRequest, opts ...grpc.CallOption) (*TokenReply, error)
  20. SendPhoneCode(ctx context.Context, in *SendPhoneCodeRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
  21. CheckPhoneCode(ctx context.Context, in *CheckPhoneCodeRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
  22. }
  23. type accountClient struct {
  24. cc grpc.ClientConnInterface
  25. }
  26. func NewAccountClient(cc grpc.ClientConnInterface) AccountClient {
  27. return &accountClient{cc}
  28. }
  29. func (c *accountClient) DebugLogin(ctx context.Context, in *DebugLoginRequest, opts ...grpc.CallOption) (*TokenReply, error) {
  30. out := new(TokenReply)
  31. err := c.cc.Invoke(ctx, "/api.account.Account/DebugLogin", in, out, opts...)
  32. if err != nil {
  33. return nil, err
  34. }
  35. return out, nil
  36. }
  37. func (c *accountClient) Authorization(ctx context.Context, in *AuthorizationRequest, opts ...grpc.CallOption) (*TokenReply, error) {
  38. out := new(TokenReply)
  39. err := c.cc.Invoke(ctx, "/api.account.Account/Authorization", in, out, opts...)
  40. if err != nil {
  41. return nil, err
  42. }
  43. return out, nil
  44. }
  45. func (c *accountClient) SendPhoneCode(ctx context.Context, in *SendPhoneCodeRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
  46. out := new(emptypb.Empty)
  47. err := c.cc.Invoke(ctx, "/api.account.Account/SendPhoneCode", in, out, opts...)
  48. if err != nil {
  49. return nil, err
  50. }
  51. return out, nil
  52. }
  53. func (c *accountClient) CheckPhoneCode(ctx context.Context, in *CheckPhoneCodeRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
  54. out := new(emptypb.Empty)
  55. err := c.cc.Invoke(ctx, "/api.account.Account/CheckPhoneCode", in, out, opts...)
  56. if err != nil {
  57. return nil, err
  58. }
  59. return out, nil
  60. }
  61. // AccountServer is the server API for Account service.
  62. // All implementations must embed UnimplementedAccountServer
  63. // for forward compatibility
  64. type AccountServer interface {
  65. DebugLogin(context.Context, *DebugLoginRequest) (*TokenReply, error)
  66. Authorization(context.Context, *AuthorizationRequest) (*TokenReply, error)
  67. SendPhoneCode(context.Context, *SendPhoneCodeRequest) (*emptypb.Empty, error)
  68. CheckPhoneCode(context.Context, *CheckPhoneCodeRequest) (*emptypb.Empty, error)
  69. mustEmbedUnimplementedAccountServer()
  70. }
  71. // UnimplementedAccountServer must be embedded to have forward compatible implementations.
  72. type UnimplementedAccountServer struct {
  73. }
  74. func (UnimplementedAccountServer) DebugLogin(context.Context, *DebugLoginRequest) (*TokenReply, error) {
  75. return nil, status.Errorf(codes.Unimplemented, "method DebugLogin not implemented")
  76. }
  77. func (UnimplementedAccountServer) Authorization(context.Context, *AuthorizationRequest) (*TokenReply, error) {
  78. return nil, status.Errorf(codes.Unimplemented, "method Authorization not implemented")
  79. }
  80. func (UnimplementedAccountServer) SendPhoneCode(context.Context, *SendPhoneCodeRequest) (*emptypb.Empty, error) {
  81. return nil, status.Errorf(codes.Unimplemented, "method SendPhoneCode not implemented")
  82. }
  83. func (UnimplementedAccountServer) CheckPhoneCode(context.Context, *CheckPhoneCodeRequest) (*emptypb.Empty, error) {
  84. return nil, status.Errorf(codes.Unimplemented, "method CheckPhoneCode not implemented")
  85. }
  86. func (UnimplementedAccountServer) mustEmbedUnimplementedAccountServer() {}
  87. // UnsafeAccountServer may be embedded to opt out of forward compatibility for this service.
  88. // Use of this interface is not recommended, as added methods to AccountServer will
  89. // result in compilation errors.
  90. type UnsafeAccountServer interface {
  91. mustEmbedUnimplementedAccountServer()
  92. }
  93. func RegisterAccountServer(s grpc.ServiceRegistrar, srv AccountServer) {
  94. s.RegisterService(&Account_ServiceDesc, srv)
  95. }
  96. func _Account_DebugLogin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  97. in := new(DebugLoginRequest)
  98. if err := dec(in); err != nil {
  99. return nil, err
  100. }
  101. if interceptor == nil {
  102. return srv.(AccountServer).DebugLogin(ctx, in)
  103. }
  104. info := &grpc.UnaryServerInfo{
  105. Server: srv,
  106. FullMethod: "/api.account.Account/DebugLogin",
  107. }
  108. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  109. return srv.(AccountServer).DebugLogin(ctx, req.(*DebugLoginRequest))
  110. }
  111. return interceptor(ctx, in, info, handler)
  112. }
  113. func _Account_Authorization_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  114. in := new(AuthorizationRequest)
  115. if err := dec(in); err != nil {
  116. return nil, err
  117. }
  118. if interceptor == nil {
  119. return srv.(AccountServer).Authorization(ctx, in)
  120. }
  121. info := &grpc.UnaryServerInfo{
  122. Server: srv,
  123. FullMethod: "/api.account.Account/Authorization",
  124. }
  125. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  126. return srv.(AccountServer).Authorization(ctx, req.(*AuthorizationRequest))
  127. }
  128. return interceptor(ctx, in, info, handler)
  129. }
  130. func _Account_SendPhoneCode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  131. in := new(SendPhoneCodeRequest)
  132. if err := dec(in); err != nil {
  133. return nil, err
  134. }
  135. if interceptor == nil {
  136. return srv.(AccountServer).SendPhoneCode(ctx, in)
  137. }
  138. info := &grpc.UnaryServerInfo{
  139. Server: srv,
  140. FullMethod: "/api.account.Account/SendPhoneCode",
  141. }
  142. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  143. return srv.(AccountServer).SendPhoneCode(ctx, req.(*SendPhoneCodeRequest))
  144. }
  145. return interceptor(ctx, in, info, handler)
  146. }
  147. func _Account_CheckPhoneCode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  148. in := new(CheckPhoneCodeRequest)
  149. if err := dec(in); err != nil {
  150. return nil, err
  151. }
  152. if interceptor == nil {
  153. return srv.(AccountServer).CheckPhoneCode(ctx, in)
  154. }
  155. info := &grpc.UnaryServerInfo{
  156. Server: srv,
  157. FullMethod: "/api.account.Account/CheckPhoneCode",
  158. }
  159. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  160. return srv.(AccountServer).CheckPhoneCode(ctx, req.(*CheckPhoneCodeRequest))
  161. }
  162. return interceptor(ctx, in, info, handler)
  163. }
  164. // Account_ServiceDesc is the grpc.ServiceDesc for Account service.
  165. // It's only intended for direct use with grpc.RegisterService,
  166. // and not to be introspected or modified (even as a copy)
  167. var Account_ServiceDesc = grpc.ServiceDesc{
  168. ServiceName: "api.account.Account",
  169. HandlerType: (*AccountServer)(nil),
  170. Methods: []grpc.MethodDesc{
  171. {
  172. MethodName: "DebugLogin",
  173. Handler: _Account_DebugLogin_Handler,
  174. },
  175. {
  176. MethodName: "Authorization",
  177. Handler: _Account_Authorization_Handler,
  178. },
  179. {
  180. MethodName: "SendPhoneCode",
  181. Handler: _Account_SendPhoneCode_Handler,
  182. },
  183. {
  184. MethodName: "CheckPhoneCode",
  185. Handler: _Account_CheckPhoneCode_Handler,
  186. },
  187. },
  188. Streams: []grpc.StreamDesc{},
  189. Metadata: "account.proto",
  190. }