account_grpc.pb.go 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
  2. // versions:
  3. // - protoc-gen-go-grpc v1.5.1
  4. // - protoc v3.21.11
  5. // source: account/v1/account.proto
  6. package v1
  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.64.0 or later.
  16. const _ = grpc.SupportPackageIsVersion9
  17. const (
  18. Account_UserRegister_FullMethodName = "/account.v1.Account/UserRegister"
  19. Account_UserLogin_FullMethodName = "/account.v1.Account/UserLogin"
  20. Account_UserInfo_FullMethodName = "/account.v1.Account/UserInfo"
  21. )
  22. // AccountClient is the client API for Account service.
  23. //
  24. // 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.
  25. type AccountClient interface {
  26. UserRegister(ctx context.Context, in *UserRegisterReq, opts ...grpc.CallOption) (*UserRegisterRes, error)
  27. UserLogin(ctx context.Context, in *UserLoginReq, opts ...grpc.CallOption) (*UserLoginRes, error)
  28. UserInfo(ctx context.Context, in *UserInfoReq, opts ...grpc.CallOption) (*UserInfoRes, error)
  29. }
  30. type accountClient struct {
  31. cc grpc.ClientConnInterface
  32. }
  33. func NewAccountClient(cc grpc.ClientConnInterface) AccountClient {
  34. return &accountClient{cc}
  35. }
  36. func (c *accountClient) UserRegister(ctx context.Context, in *UserRegisterReq, opts ...grpc.CallOption) (*UserRegisterRes, error) {
  37. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  38. out := new(UserRegisterRes)
  39. err := c.cc.Invoke(ctx, Account_UserRegister_FullMethodName, in, out, cOpts...)
  40. if err != nil {
  41. return nil, err
  42. }
  43. return out, nil
  44. }
  45. func (c *accountClient) UserLogin(ctx context.Context, in *UserLoginReq, opts ...grpc.CallOption) (*UserLoginRes, error) {
  46. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  47. out := new(UserLoginRes)
  48. err := c.cc.Invoke(ctx, Account_UserLogin_FullMethodName, in, out, cOpts...)
  49. if err != nil {
  50. return nil, err
  51. }
  52. return out, nil
  53. }
  54. func (c *accountClient) UserInfo(ctx context.Context, in *UserInfoReq, opts ...grpc.CallOption) (*UserInfoRes, error) {
  55. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  56. out := new(UserInfoRes)
  57. err := c.cc.Invoke(ctx, Account_UserInfo_FullMethodName, in, out, cOpts...)
  58. if err != nil {
  59. return nil, err
  60. }
  61. return out, nil
  62. }
  63. // AccountServer is the server API for Account service.
  64. // All implementations must embed UnimplementedAccountServer
  65. // for forward compatibility.
  66. type AccountServer interface {
  67. UserRegister(context.Context, *UserRegisterReq) (*UserRegisterRes, error)
  68. UserLogin(context.Context, *UserLoginReq) (*UserLoginRes, error)
  69. UserInfo(context.Context, *UserInfoReq) (*UserInfoRes, error)
  70. mustEmbedUnimplementedAccountServer()
  71. }
  72. // UnimplementedAccountServer must be embedded to have
  73. // forward compatible implementations.
  74. //
  75. // NOTE: this should be embedded by value instead of pointer to avoid a nil
  76. // pointer dereference when methods are called.
  77. type UnimplementedAccountServer struct{}
  78. func (UnimplementedAccountServer) UserRegister(context.Context, *UserRegisterReq) (*UserRegisterRes, error) {
  79. return nil, status.Errorf(codes.Unimplemented, "method UserRegister not implemented")
  80. }
  81. func (UnimplementedAccountServer) UserLogin(context.Context, *UserLoginReq) (*UserLoginRes, error) {
  82. return nil, status.Errorf(codes.Unimplemented, "method UserLogin not implemented")
  83. }
  84. func (UnimplementedAccountServer) UserInfo(context.Context, *UserInfoReq) (*UserInfoRes, error) {
  85. return nil, status.Errorf(codes.Unimplemented, "method UserInfo not implemented")
  86. }
  87. func (UnimplementedAccountServer) mustEmbedUnimplementedAccountServer() {}
  88. func (UnimplementedAccountServer) testEmbeddedByValue() {}
  89. // UnsafeAccountServer may be embedded to opt out of forward compatibility for this service.
  90. // Use of this interface is not recommended, as added methods to AccountServer will
  91. // result in compilation errors.
  92. type UnsafeAccountServer interface {
  93. mustEmbedUnimplementedAccountServer()
  94. }
  95. func RegisterAccountServer(s grpc.ServiceRegistrar, srv AccountServer) {
  96. // If the following call pancis, it indicates UnimplementedAccountServer was
  97. // embedded by pointer and is nil. This will cause panics if an
  98. // unimplemented method is ever invoked, so we test this at initialization
  99. // time to prevent it from happening at runtime later due to I/O.
  100. if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
  101. t.testEmbeddedByValue()
  102. }
  103. s.RegisterService(&Account_ServiceDesc, srv)
  104. }
  105. func _Account_UserRegister_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  106. in := new(UserRegisterReq)
  107. if err := dec(in); err != nil {
  108. return nil, err
  109. }
  110. if interceptor == nil {
  111. return srv.(AccountServer).UserRegister(ctx, in)
  112. }
  113. info := &grpc.UnaryServerInfo{
  114. Server: srv,
  115. FullMethod: Account_UserRegister_FullMethodName,
  116. }
  117. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  118. return srv.(AccountServer).UserRegister(ctx, req.(*UserRegisterReq))
  119. }
  120. return interceptor(ctx, in, info, handler)
  121. }
  122. func _Account_UserLogin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  123. in := new(UserLoginReq)
  124. if err := dec(in); err != nil {
  125. return nil, err
  126. }
  127. if interceptor == nil {
  128. return srv.(AccountServer).UserLogin(ctx, in)
  129. }
  130. info := &grpc.UnaryServerInfo{
  131. Server: srv,
  132. FullMethod: Account_UserLogin_FullMethodName,
  133. }
  134. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  135. return srv.(AccountServer).UserLogin(ctx, req.(*UserLoginReq))
  136. }
  137. return interceptor(ctx, in, info, handler)
  138. }
  139. func _Account_UserInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  140. in := new(UserInfoReq)
  141. if err := dec(in); err != nil {
  142. return nil, err
  143. }
  144. if interceptor == nil {
  145. return srv.(AccountServer).UserInfo(ctx, in)
  146. }
  147. info := &grpc.UnaryServerInfo{
  148. Server: srv,
  149. FullMethod: Account_UserInfo_FullMethodName,
  150. }
  151. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  152. return srv.(AccountServer).UserInfo(ctx, req.(*UserInfoReq))
  153. }
  154. return interceptor(ctx, in, info, handler)
  155. }
  156. // Account_ServiceDesc is the grpc.ServiceDesc for Account service.
  157. // It's only intended for direct use with grpc.RegisterService,
  158. // and not to be introspected or modified (even as a copy)
  159. var Account_ServiceDesc = grpc.ServiceDesc{
  160. ServiceName: "account.v1.Account",
  161. HandlerType: (*AccountServer)(nil),
  162. Methods: []grpc.MethodDesc{
  163. {
  164. MethodName: "UserRegister",
  165. Handler: _Account_UserRegister_Handler,
  166. },
  167. {
  168. MethodName: "UserLogin",
  169. Handler: _Account_UserLogin_Handler,
  170. },
  171. {
  172. MethodName: "UserInfo",
  173. Handler: _Account_UserInfo_Handler,
  174. },
  175. },
  176. Streams: []grpc.StreamDesc{},
  177. Metadata: "account/v1/account.proto",
  178. }