base_grpc.pb.go 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
  2. package base
  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. )
  9. // This is a compile-time assertion to ensure that this generated file
  10. // is compatible with the grpc package it is being compiled against.
  11. const _ = grpc.SupportPackageIsVersion7
  12. // ApiClient is the client API for Api service.
  13. //
  14. // 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.
  15. type ApiClient interface {
  16. SignUp(ctx context.Context, in *SignUpRequest, opts ...grpc.CallOption) (*DefaultReply, error)
  17. SignIn(ctx context.Context, in *SignInRequest, opts ...grpc.CallOption) (*SignInReply, error)
  18. SignOut(ctx context.Context, in *DefaultRequest, opts ...grpc.CallOption) (*DefaultReply, error)
  19. }
  20. type apiClient struct {
  21. cc grpc.ClientConnInterface
  22. }
  23. func NewApiClient(cc grpc.ClientConnInterface) ApiClient {
  24. return &apiClient{cc}
  25. }
  26. func (c *apiClient) SignUp(ctx context.Context, in *SignUpRequest, opts ...grpc.CallOption) (*DefaultReply, error) {
  27. out := new(DefaultReply)
  28. err := c.cc.Invoke(ctx, "/base.Api/SignUp", in, out, opts...)
  29. if err != nil {
  30. return nil, err
  31. }
  32. return out, nil
  33. }
  34. func (c *apiClient) SignIn(ctx context.Context, in *SignInRequest, opts ...grpc.CallOption) (*SignInReply, error) {
  35. out := new(SignInReply)
  36. err := c.cc.Invoke(ctx, "/base.Api/SignIn", in, out, opts...)
  37. if err != nil {
  38. return nil, err
  39. }
  40. return out, nil
  41. }
  42. func (c *apiClient) SignOut(ctx context.Context, in *DefaultRequest, opts ...grpc.CallOption) (*DefaultReply, error) {
  43. out := new(DefaultReply)
  44. err := c.cc.Invoke(ctx, "/base.Api/SignOut", in, out, opts...)
  45. if err != nil {
  46. return nil, err
  47. }
  48. return out, nil
  49. }
  50. // ApiServer is the server API for Api service.
  51. // All implementations must embed UnimplementedApiServer
  52. // for forward compatibility
  53. type ApiServer interface {
  54. SignUp(context.Context, *SignUpRequest) (*DefaultReply, error)
  55. SignIn(context.Context, *SignInRequest) (*SignInReply, error)
  56. SignOut(context.Context, *DefaultRequest) (*DefaultReply, error)
  57. mustEmbedUnimplementedApiServer()
  58. }
  59. // UnimplementedApiServer must be embedded to have forward compatible implementations.
  60. type UnimplementedApiServer struct {
  61. }
  62. func (UnimplementedApiServer) SignUp(context.Context, *SignUpRequest) (*DefaultReply, error) {
  63. return nil, status.Errorf(codes.Unimplemented, "method SignUp not implemented")
  64. }
  65. func (UnimplementedApiServer) SignIn(context.Context, *SignInRequest) (*SignInReply, error) {
  66. return nil, status.Errorf(codes.Unimplemented, "method SignIn not implemented")
  67. }
  68. func (UnimplementedApiServer) SignOut(context.Context, *DefaultRequest) (*DefaultReply, error) {
  69. return nil, status.Errorf(codes.Unimplemented, "method SignOut not implemented")
  70. }
  71. func (UnimplementedApiServer) mustEmbedUnimplementedApiServer() {}
  72. // UnsafeApiServer may be embedded to opt out of forward compatibility for this service.
  73. // Use of this interface is not recommended, as added methods to ApiServer will
  74. // result in compilation errors.
  75. type UnsafeApiServer interface {
  76. mustEmbedUnimplementedApiServer()
  77. }
  78. func RegisterApiServer(s grpc.ServiceRegistrar, srv ApiServer) {
  79. s.RegisterService(&_Api_serviceDesc, srv)
  80. }
  81. func _Api_SignUp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  82. in := new(SignUpRequest)
  83. if err := dec(in); err != nil {
  84. return nil, err
  85. }
  86. if interceptor == nil {
  87. return srv.(ApiServer).SignUp(ctx, in)
  88. }
  89. info := &grpc.UnaryServerInfo{
  90. Server: srv,
  91. FullMethod: "/base.Api/SignUp",
  92. }
  93. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  94. return srv.(ApiServer).SignUp(ctx, req.(*SignUpRequest))
  95. }
  96. return interceptor(ctx, in, info, handler)
  97. }
  98. func _Api_SignIn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  99. in := new(SignInRequest)
  100. if err := dec(in); err != nil {
  101. return nil, err
  102. }
  103. if interceptor == nil {
  104. return srv.(ApiServer).SignIn(ctx, in)
  105. }
  106. info := &grpc.UnaryServerInfo{
  107. Server: srv,
  108. FullMethod: "/base.Api/SignIn",
  109. }
  110. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  111. return srv.(ApiServer).SignIn(ctx, req.(*SignInRequest))
  112. }
  113. return interceptor(ctx, in, info, handler)
  114. }
  115. func _Api_SignOut_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  116. in := new(DefaultRequest)
  117. if err := dec(in); err != nil {
  118. return nil, err
  119. }
  120. if interceptor == nil {
  121. return srv.(ApiServer).SignOut(ctx, in)
  122. }
  123. info := &grpc.UnaryServerInfo{
  124. Server: srv,
  125. FullMethod: "/base.Api/SignOut",
  126. }
  127. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  128. return srv.(ApiServer).SignOut(ctx, req.(*DefaultRequest))
  129. }
  130. return interceptor(ctx, in, info, handler)
  131. }
  132. var _Api_serviceDesc = grpc.ServiceDesc{
  133. ServiceName: "base.Api",
  134. HandlerType: (*ApiServer)(nil),
  135. Methods: []grpc.MethodDesc{
  136. {
  137. MethodName: "SignUp",
  138. Handler: _Api_SignUp_Handler,
  139. },
  140. {
  141. MethodName: "SignIn",
  142. Handler: _Api_SignIn_Handler,
  143. },
  144. {
  145. MethodName: "SignOut",
  146. Handler: _Api_SignOut_Handler,
  147. },
  148. },
  149. Streams: []grpc.StreamDesc{},
  150. Metadata: "base.proto",
  151. }