Documentation ¶
Index ¶
Constants ¶
const (
UserService_GetById_FullMethodName = "/UserService/GetById"
)
Variables ¶
var File_user_proto protoreflect.FileDescriptor
var UserService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "UserService", HandlerType: (*UserServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetById", Handler: _UserService_GetById_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "user.proto", }
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)
Functions ¶
func RegisterUserServiceServer ¶
func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer)
Types ¶
type GetByIdRequest ¶
type GetByIdRequest struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*GetByIdRequest) Descriptor
deprecated
func (*GetByIdRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetByIdRequest.ProtoReflect.Descriptor instead.
func (*GetByIdRequest) GetId ¶
func (x *GetByIdRequest) GetId() int64
func (*GetByIdRequest) ProtoMessage ¶
func (*GetByIdRequest) ProtoMessage()
func (*GetByIdRequest) ProtoReflect ¶
func (x *GetByIdRequest) ProtoReflect() protoreflect.Message
func (*GetByIdRequest) Reset ¶
func (x *GetByIdRequest) Reset()
func (*GetByIdRequest) String ¶
func (x *GetByIdRequest) String() string
type GetByIdResponse ¶
type GetByIdResponse struct { User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` // contains filtered or unexported fields }
func (*GetByIdResponse) Descriptor
deprecated
func (*GetByIdResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetByIdResponse.ProtoReflect.Descriptor instead.
func (*GetByIdResponse) GetUser ¶
func (x *GetByIdResponse) GetUser() *User
func (*GetByIdResponse) ProtoMessage ¶
func (*GetByIdResponse) ProtoMessage()
func (*GetByIdResponse) ProtoReflect ¶
func (x *GetByIdResponse) ProtoReflect() protoreflect.Message
func (*GetByIdResponse) Reset ¶
func (x *GetByIdResponse) Reset()
func (*GetByIdResponse) String ¶
func (x *GetByIdResponse) String() string
type Server ¶
type Server struct { UnimplementedUserServiceServer Name string }
func (*Server) GetById ¶
func (s *Server) GetById(ctx context.Context, request *GetByIdRequest) (*GetByIdResponse, error)
type UnimplementedUserServiceServer ¶
type UnimplementedUserServiceServer struct { }
UnimplementedUserServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedUserServiceServer) GetById ¶
func (UnimplementedUserServiceServer) GetById(context.Context, *GetByIdRequest) (*GetByIdResponse, error)
type UnsafeUserServiceServer ¶
type UnsafeUserServiceServer interface {
// contains filtered or unexported methods
}
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 User ¶
type User struct { // Protobuf 对前几个字段有性能优化, Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*User) Descriptor
deprecated
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message
type UserServiceClient ¶
type UserServiceClient interface {
GetById(ctx context.Context, in *GetByIdRequest, opts ...grpc.CallOption) (*GetByIdResponse, error)
}
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.
func NewUserServiceClient ¶
func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient
type UserServiceServer ¶
type UserServiceServer interface { GetById(context.Context, *GetByIdRequest) (*GetByIdResponse, error) // contains filtered or unexported methods }
UserServiceServer is the server API for UserService service. All implementations must embed UnimplementedUserServiceServer for forward compatibility