// Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.5.1 // - protoc v3.19.4 // source: user_service.proto package user import ( context "context" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" ) // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. // Requires gRPC-Go v1.64.0 or later. const _ = grpc.SupportPackageIsVersion9 const ( UserService_Ping_FullMethodName = "/user_service.user_service/Ping" UserService_SetUser_FullMethodName = "/user_service.user_service/SetUser" UserService_CreateUser_FullMethodName = "/user_service.user_service/CreateUser" UserService_CreateEmptyUser_FullMethodName = "/user_service.user_service/CreateEmptyUser" UserService_FindById_FullMethodName = "/user_service.user_service/FindById" UserService_GetUserById_FullMethodName = "/user_service.user_service/GetUserById" UserService_GetUserIds_FullMethodName = "/user_service.user_service/GetUserIds" ) // UserServiceClient is the client API for UserService service. // // 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. type UserServiceClient interface { Ping(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) // SetUser 设置用户信息 SetUser(ctx context.Context, in *SetUserRequest, opts ...grpc.CallOption) (*SetUserResponse, error) // CreateUser 获取用户或者创建用户 CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*UserId, error) // CreateEmptyUser 创建空用户,用于关联游戏账号的空数据 CreateEmptyUser(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*UserId, error) // FirstOrCreateUser 创建用户或者获取用户 FindById(ctx context.Context, in *UserId, opts ...grpc.CallOption) (*User, error) // GetUserById 通过 ID 获取用户 GetUserById(ctx context.Context, in *UserId, opts ...grpc.CallOption) (*User, error) // GetUserIds 通过 ID 获取用户 GetUserIds(ctx context.Context, in *UserIds, opts ...grpc.CallOption) (*UserList, error) } type userServiceClient struct { cc grpc.ClientConnInterface } func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient { return &userServiceClient{cc} } func (c *userServiceClient) Ping(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Response) err := c.cc.Invoke(ctx, UserService_Ping_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } func (c *userServiceClient) SetUser(ctx context.Context, in *SetUserRequest, opts ...grpc.CallOption) (*SetUserResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(SetUserResponse) err := c.cc.Invoke(ctx, UserService_SetUser_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } func (c *userServiceClient) CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*UserId, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(UserId) err := c.cc.Invoke(ctx, UserService_CreateUser_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } func (c *userServiceClient) CreateEmptyUser(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*UserId, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(UserId) err := c.cc.Invoke(ctx, UserService_CreateEmptyUser_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } func (c *userServiceClient) FindById(ctx context.Context, in *UserId, opts ...grpc.CallOption) (*User, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(User) err := c.cc.Invoke(ctx, UserService_FindById_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } func (c *userServiceClient) GetUserById(ctx context.Context, in *UserId, opts ...grpc.CallOption) (*User, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(User) err := c.cc.Invoke(ctx, UserService_GetUserById_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } func (c *userServiceClient) GetUserIds(ctx context.Context, in *UserIds, opts ...grpc.CallOption) (*UserList, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(UserList) err := c.cc.Invoke(ctx, UserService_GetUserIds_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } // UserServiceServer is the server API for UserService service. // All implementations must embed UnimplementedUserServiceServer // for forward compatibility. type UserServiceServer interface { Ping(context.Context, *Request) (*Response, error) // SetUser 设置用户信息 SetUser(context.Context, *SetUserRequest) (*SetUserResponse, error) // CreateUser 获取用户或者创建用户 CreateUser(context.Context, *CreateUserRequest) (*UserId, error) // CreateEmptyUser 创建空用户,用于关联游戏账号的空数据 CreateEmptyUser(context.Context, *Empty) (*UserId, error) // FirstOrCreateUser 创建用户或者获取用户 FindById(context.Context, *UserId) (*User, error) // GetUserById 通过 ID 获取用户 GetUserById(context.Context, *UserId) (*User, error) // GetUserIds 通过 ID 获取用户 GetUserIds(context.Context, *UserIds) (*UserList, error) mustEmbedUnimplementedUserServiceServer() } // UnimplementedUserServiceServer must be embedded to have // forward compatible implementations. // // NOTE: this should be embedded by value instead of pointer to avoid a nil // pointer dereference when methods are called. type UnimplementedUserServiceServer struct{} func (UnimplementedUserServiceServer) Ping(context.Context, *Request) (*Response, error) { return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented") } func (UnimplementedUserServiceServer) SetUser(context.Context, *SetUserRequest) (*SetUserResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SetUser not implemented") } func (UnimplementedUserServiceServer) CreateUser(context.Context, *CreateUserRequest) (*UserId, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateUser not implemented") } func (UnimplementedUserServiceServer) CreateEmptyUser(context.Context, *Empty) (*UserId, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateEmptyUser not implemented") } func (UnimplementedUserServiceServer) FindById(context.Context, *UserId) (*User, error) { return nil, status.Errorf(codes.Unimplemented, "method FindById not implemented") } func (UnimplementedUserServiceServer) GetUserById(context.Context, *UserId) (*User, error) { return nil, status.Errorf(codes.Unimplemented, "method GetUserById not implemented") } func (UnimplementedUserServiceServer) GetUserIds(context.Context, *UserIds) (*UserList, error) { return nil, status.Errorf(codes.Unimplemented, "method GetUserIds not implemented") } func (UnimplementedUserServiceServer) mustEmbedUnimplementedUserServiceServer() {} func (UnimplementedUserServiceServer) testEmbeddedByValue() {} // UnsafeUserServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to UserServiceServer will // result in compilation errors. type UnsafeUserServiceServer interface { mustEmbedUnimplementedUserServiceServer() } func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer) { // If the following call pancis, it indicates UnimplementedUserServiceServer was // embedded by pointer and is nil. This will cause panics if an // unimplemented method is ever invoked, so we test this at initialization // time to prevent it from happening at runtime later due to I/O. if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { t.testEmbeddedByValue() } s.RegisterService(&UserService_ServiceDesc, srv) } func _UserService_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(Request) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServiceServer).Ping(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: UserService_Ping_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServiceServer).Ping(ctx, req.(*Request)) } return interceptor(ctx, in, info, handler) } func _UserService_SetUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(SetUserRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServiceServer).SetUser(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: UserService_SetUser_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServiceServer).SetUser(ctx, req.(*SetUserRequest)) } return interceptor(ctx, in, info, handler) } func _UserService_CreateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CreateUserRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServiceServer).CreateUser(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: UserService_CreateUser_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServiceServer).CreateUser(ctx, req.(*CreateUserRequest)) } return interceptor(ctx, in, info, handler) } func _UserService_CreateEmptyUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(Empty) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServiceServer).CreateEmptyUser(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: UserService_CreateEmptyUser_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServiceServer).CreateEmptyUser(ctx, req.(*Empty)) } return interceptor(ctx, in, info, handler) } func _UserService_FindById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(UserId) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServiceServer).FindById(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: UserService_FindById_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServiceServer).FindById(ctx, req.(*UserId)) } return interceptor(ctx, in, info, handler) } func _UserService_GetUserById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(UserId) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServiceServer).GetUserById(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: UserService_GetUserById_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServiceServer).GetUserById(ctx, req.(*UserId)) } return interceptor(ctx, in, info, handler) } func _UserService_GetUserIds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(UserIds) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(UserServiceServer).GetUserIds(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: UserService_GetUserIds_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServiceServer).GetUserIds(ctx, req.(*UserIds)) } return interceptor(ctx, in, info, handler) } // UserService_ServiceDesc is the grpc.ServiceDesc for UserService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var UserService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "user_service.user_service", HandlerType: (*UserServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Ping", Handler: _UserService_Ping_Handler, }, { MethodName: "SetUser", Handler: _UserService_SetUser_Handler, }, { MethodName: "CreateUser", Handler: _UserService_CreateUser_Handler, }, { MethodName: "CreateEmptyUser", Handler: _UserService_CreateEmptyUser_Handler, }, { MethodName: "FindById", Handler: _UserService_FindById_Handler, }, { MethodName: "GetUserById", Handler: _UserService_GetUserById_Handler, }, { MethodName: "GetUserIds", Handler: _UserService_GetUserIds_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "user_service.proto", }