Documentation ¶
Index ¶
Constants ¶
const ( User_Insert_FullMethodName = "/user.User/Insert" User_Query_FullMethodName = "/user.User/Query" User_Delete_FullMethodName = "/user.User/Delete" )
Variables ¶
var File_user_proto protoreflect.FileDescriptor
var User_ServiceDesc = grpc.ServiceDesc{ ServiceName: "user.User", HandlerType: (*UserServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Insert", Handler: _User_Insert_Handler, }, { MethodName: "Query", Handler: _User_Query_Handler, }, { MethodName: "Delete", Handler: _User_Delete_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "user.proto", }
User_ServiceDesc is the grpc.ServiceDesc for User service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterUserServer ¶
func RegisterUserServer(s grpc.ServiceRegistrar, srv UserServer)
Types ¶
type DeleteReq ¶
type DeleteReq struct { Id int32 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty" v:"min:1#User id is required for deleting."` // v:min:1#User id is required for deleting. // contains filtered or unexported fields }
func (*DeleteReq) Descriptor
deprecated
func (*DeleteReq) ProtoMessage ¶
func (*DeleteReq) ProtoMessage()
func (*DeleteReq) ProtoReflect ¶
func (x *DeleteReq) ProtoReflect() protoreflect.Message
type DeleteRes ¶
type DeleteRes struct {
// contains filtered or unexported fields
}
func (*DeleteRes) Descriptor
deprecated
func (*DeleteRes) ProtoMessage ¶
func (*DeleteRes) ProtoMessage()
func (*DeleteRes) ProtoReflect ¶
func (x *DeleteRes) ProtoReflect() protoreflect.Message
type InsertReq ¶
type InsertReq struct { Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty" v:"required#Please input user name."` // v: required#Please input user name. // contains filtered or unexported fields }
func (*InsertReq) Descriptor
deprecated
func (*InsertReq) ProtoMessage ¶
func (*InsertReq) ProtoMessage()
func (*InsertReq) ProtoReflect ¶
func (x *InsertReq) ProtoReflect() protoreflect.Message
type InsertRes ¶
type InsertRes struct { Id int32 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"` // contains filtered or unexported fields }
func (*InsertRes) Descriptor
deprecated
func (*InsertRes) ProtoMessage ¶
func (*InsertRes) ProtoMessage()
func (*InsertRes) ProtoReflect ¶
func (x *InsertRes) ProtoReflect() protoreflect.Message
type QueryReq ¶
type QueryReq struct { Id int32 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty" v:"min:1#User id is required for querying."` // v: min:1#User id is required for querying. // contains filtered or unexported fields }
func (*QueryReq) Descriptor
deprecated
func (*QueryReq) ProtoMessage ¶
func (*QueryReq) ProtoMessage()
func (*QueryReq) ProtoReflect ¶
func (x *QueryReq) ProtoReflect() protoreflect.Message
type QueryRes ¶
type QueryRes struct { Id int32 `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 (*QueryRes) Descriptor
deprecated
func (*QueryRes) ProtoMessage ¶
func (*QueryRes) ProtoMessage()
func (*QueryRes) ProtoReflect ¶
func (x *QueryRes) ProtoReflect() protoreflect.Message
type UnimplementedUserServer ¶
type UnimplementedUserServer struct { }
UnimplementedUserServer must be embedded to have forward compatible implementations.
type UnsafeUserServer ¶
type UnsafeUserServer interface {
// contains filtered or unexported methods
}
UnsafeUserServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to UserServer will result in compilation errors.
type UserClient ¶
type UserClient interface { Insert(ctx context.Context, in *InsertReq, opts ...grpc.CallOption) (*InsertRes, error) Query(ctx context.Context, in *QueryReq, opts ...grpc.CallOption) (*QueryRes, error) Delete(ctx context.Context, in *DeleteReq, opts ...grpc.CallOption) (*DeleteRes, error) }
UserClient is the client API for User 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 NewUserClient ¶
func NewUserClient(cc grpc.ClientConnInterface) UserClient
type UserServer ¶
type UserServer interface { Insert(context.Context, *InsertReq) (*InsertRes, error) Query(context.Context, *QueryReq) (*QueryRes, error) Delete(context.Context, *DeleteReq) (*DeleteRes, error) // contains filtered or unexported methods }
UserServer is the server API for User service. All implementations must embed UnimplementedUserServer for forward compatibility