github.com/Go-To-Byte/DouSheng/user_center@v0.0.0-20230524130918-ad531c1a3f6a/apps/user/user_grpc.pb.go (about)

     1  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
     2  // versions:
     3  // - protoc-gen-go-grpc v1.2.0
     4  // - protoc             v3.21.12
     5  // source: apps/user/pb/user.proto
     6  
     7  package user
     8  
     9  import (
    10  	context "context"
    11  	grpc "google.golang.org/grpc"
    12  	codes "google.golang.org/grpc/codes"
    13  	status "google.golang.org/grpc/status"
    14  )
    15  
    16  // This is a compile-time assertion to ensure that this generated file
    17  // is compatible with the grpc package it is being compiled against.
    18  // Requires gRPC-Go v1.32.0 or later.
    19  const _ = grpc.SupportPackageIsVersion7
    20  
    21  // ServiceClient is the client API for Service service.
    22  //
    23  // 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.
    24  type ServiceClient interface {
    25  	// 用户注册
    26  	Register(ctx context.Context, in *LoginAndRegisterRequest, opts ...grpc.CallOption) (*TokenResponse, error)
    27  	// 用户登录
    28  	Login(ctx context.Context, in *LoginAndRegisterRequest, opts ...grpc.CallOption) (*TokenResponse, error)
    29  	// 获取用户信息
    30  	UserInfo(ctx context.Context, in *UserInfoRequest, opts ...grpc.CallOption) (*UserInfoResponse, error)
    31  	// 获取用户信息 map[userId] = User
    32  	UserMap(ctx context.Context, in *UserMapRequest, opts ...grpc.CallOption) (*UserMapResponse, error)
    33  }
    34  
    35  type serviceClient struct {
    36  	cc grpc.ClientConnInterface
    37  }
    38  
    39  func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient {
    40  	return &serviceClient{cc}
    41  }
    42  
    43  func (c *serviceClient) Register(ctx context.Context, in *LoginAndRegisterRequest, opts ...grpc.CallOption) (*TokenResponse, error) {
    44  	out := new(TokenResponse)
    45  	err := c.cc.Invoke(ctx, "/dousheng.user.Service/Register", in, out, opts...)
    46  	if err != nil {
    47  		return nil, err
    48  	}
    49  	return out, nil
    50  }
    51  
    52  func (c *serviceClient) Login(ctx context.Context, in *LoginAndRegisterRequest, opts ...grpc.CallOption) (*TokenResponse, error) {
    53  	out := new(TokenResponse)
    54  	err := c.cc.Invoke(ctx, "/dousheng.user.Service/Login", in, out, opts...)
    55  	if err != nil {
    56  		return nil, err
    57  	}
    58  	return out, nil
    59  }
    60  
    61  func (c *serviceClient) UserInfo(ctx context.Context, in *UserInfoRequest, opts ...grpc.CallOption) (*UserInfoResponse, error) {
    62  	out := new(UserInfoResponse)
    63  	err := c.cc.Invoke(ctx, "/dousheng.user.Service/UserInfo", in, out, opts...)
    64  	if err != nil {
    65  		return nil, err
    66  	}
    67  	return out, nil
    68  }
    69  
    70  func (c *serviceClient) UserMap(ctx context.Context, in *UserMapRequest, opts ...grpc.CallOption) (*UserMapResponse, error) {
    71  	out := new(UserMapResponse)
    72  	err := c.cc.Invoke(ctx, "/dousheng.user.Service/UserMap", in, out, opts...)
    73  	if err != nil {
    74  		return nil, err
    75  	}
    76  	return out, nil
    77  }
    78  
    79  // ServiceServer is the server API for Service service.
    80  // All implementations must embed UnimplementedServiceServer
    81  // for forward compatibility
    82  type ServiceServer interface {
    83  	// 用户注册
    84  	Register(context.Context, *LoginAndRegisterRequest) (*TokenResponse, error)
    85  	// 用户登录
    86  	Login(context.Context, *LoginAndRegisterRequest) (*TokenResponse, error)
    87  	// 获取用户信息
    88  	UserInfo(context.Context, *UserInfoRequest) (*UserInfoResponse, error)
    89  	// 获取用户信息 map[userId] = User
    90  	UserMap(context.Context, *UserMapRequest) (*UserMapResponse, error)
    91  	mustEmbedUnimplementedServiceServer()
    92  }
    93  
    94  // UnimplementedServiceServer must be embedded to have forward compatible implementations.
    95  type UnimplementedServiceServer struct {
    96  }
    97  
    98  func (UnimplementedServiceServer) Register(context.Context, *LoginAndRegisterRequest) (*TokenResponse, error) {
    99  	return nil, status.Errorf(codes.Unimplemented, "method Register not implemented")
   100  }
   101  func (UnimplementedServiceServer) Login(context.Context, *LoginAndRegisterRequest) (*TokenResponse, error) {
   102  	return nil, status.Errorf(codes.Unimplemented, "method Login not implemented")
   103  }
   104  func (UnimplementedServiceServer) UserInfo(context.Context, *UserInfoRequest) (*UserInfoResponse, error) {
   105  	return nil, status.Errorf(codes.Unimplemented, "method UserInfo not implemented")
   106  }
   107  func (UnimplementedServiceServer) UserMap(context.Context, *UserMapRequest) (*UserMapResponse, error) {
   108  	return nil, status.Errorf(codes.Unimplemented, "method UserMap not implemented")
   109  }
   110  func (UnimplementedServiceServer) mustEmbedUnimplementedServiceServer() {}
   111  
   112  // UnsafeServiceServer may be embedded to opt out of forward compatibility for this service.
   113  // Use of this interface is not recommended, as added methods to ServiceServer will
   114  // result in compilation errors.
   115  type UnsafeServiceServer interface {
   116  	mustEmbedUnimplementedServiceServer()
   117  }
   118  
   119  func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer) {
   120  	s.RegisterService(&Service_ServiceDesc, srv)
   121  }
   122  
   123  func _Service_Register_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   124  	in := new(LoginAndRegisterRequest)
   125  	if err := dec(in); err != nil {
   126  		return nil, err
   127  	}
   128  	if interceptor == nil {
   129  		return srv.(ServiceServer).Register(ctx, in)
   130  	}
   131  	info := &grpc.UnaryServerInfo{
   132  		Server:     srv,
   133  		FullMethod: "/dousheng.user.Service/Register",
   134  	}
   135  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   136  		return srv.(ServiceServer).Register(ctx, req.(*LoginAndRegisterRequest))
   137  	}
   138  	return interceptor(ctx, in, info, handler)
   139  }
   140  
   141  func _Service_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   142  	in := new(LoginAndRegisterRequest)
   143  	if err := dec(in); err != nil {
   144  		return nil, err
   145  	}
   146  	if interceptor == nil {
   147  		return srv.(ServiceServer).Login(ctx, in)
   148  	}
   149  	info := &grpc.UnaryServerInfo{
   150  		Server:     srv,
   151  		FullMethod: "/dousheng.user.Service/Login",
   152  	}
   153  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   154  		return srv.(ServiceServer).Login(ctx, req.(*LoginAndRegisterRequest))
   155  	}
   156  	return interceptor(ctx, in, info, handler)
   157  }
   158  
   159  func _Service_UserInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   160  	in := new(UserInfoRequest)
   161  	if err := dec(in); err != nil {
   162  		return nil, err
   163  	}
   164  	if interceptor == nil {
   165  		return srv.(ServiceServer).UserInfo(ctx, in)
   166  	}
   167  	info := &grpc.UnaryServerInfo{
   168  		Server:     srv,
   169  		FullMethod: "/dousheng.user.Service/UserInfo",
   170  	}
   171  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   172  		return srv.(ServiceServer).UserInfo(ctx, req.(*UserInfoRequest))
   173  	}
   174  	return interceptor(ctx, in, info, handler)
   175  }
   176  
   177  func _Service_UserMap_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   178  	in := new(UserMapRequest)
   179  	if err := dec(in); err != nil {
   180  		return nil, err
   181  	}
   182  	if interceptor == nil {
   183  		return srv.(ServiceServer).UserMap(ctx, in)
   184  	}
   185  	info := &grpc.UnaryServerInfo{
   186  		Server:     srv,
   187  		FullMethod: "/dousheng.user.Service/UserMap",
   188  	}
   189  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   190  		return srv.(ServiceServer).UserMap(ctx, req.(*UserMapRequest))
   191  	}
   192  	return interceptor(ctx, in, info, handler)
   193  }
   194  
   195  // Service_ServiceDesc is the grpc.ServiceDesc for Service service.
   196  // It's only intended for direct use with grpc.RegisterService,
   197  // and not to be introspected or modified (even as a copy)
   198  var Service_ServiceDesc = grpc.ServiceDesc{
   199  	ServiceName: "dousheng.user.Service",
   200  	HandlerType: (*ServiceServer)(nil),
   201  	Methods: []grpc.MethodDesc{
   202  		{
   203  			MethodName: "Register",
   204  			Handler:    _Service_Register_Handler,
   205  		},
   206  		{
   207  			MethodName: "Login",
   208  			Handler:    _Service_Login_Handler,
   209  		},
   210  		{
   211  			MethodName: "UserInfo",
   212  			Handler:    _Service_UserInfo_Handler,
   213  		},
   214  		{
   215  			MethodName: "UserMap",
   216  			Handler:    _Service_UserMap_Handler,
   217  		},
   218  	},
   219  	Streams:  []grpc.StreamDesc{},
   220  	Metadata: "apps/user/pb/user.proto",
   221  }