Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterRpcServer(s grpc.ServiceRegistrar, srv RpcServer)
- type Comment
- type CreateCommentRequest
- func (*CreateCommentRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateCommentRequest) GetContent() string
- func (x *CreateCommentRequest) GetUserId() int64
- func (*CreateCommentRequest) ProtoMessage()
- func (x *CreateCommentRequest) ProtoReflect() protoreflect.Message
- func (x *CreateCommentRequest) Reset()
- func (x *CreateCommentRequest) String() string
- type RpcClient
- type RpcServer
- type UnimplementedRpcServer
- type UnsafeRpcServer
Constants ¶
const (
AppName = "comment"
)
const (
Rpc_CreateComment_FullMethodName = "/go11.vblog.comment.Rpc/CreateComment"
)
Variables ¶
var File_vblog_apps_comment_pb_model_proto protoreflect.FileDescriptor
var File_vblog_apps_comment_pb_service_proto protoreflect.FileDescriptor
var Rpc_ServiceDesc = grpc.ServiceDesc{ ServiceName: "go11.vblog.comment.Rpc", HandlerType: (*RpcServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateComment", Handler: _Rpc_CreateComment_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "vblog/apps/comment/pb/service.proto", }
Rpc_ServiceDesc is the grpc.ServiceDesc for Rpc service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterRpcServer ¶
func RegisterRpcServer(s grpc.ServiceRegistrar, srv RpcServer)
Types ¶
type Comment ¶
type Comment struct { // 博客Id BlogId int64 `protobuf:"varint,1,opt,name=blog_id,json=blogId,proto3" json:"blog_id,omitempty"` // 文章具体的定义 // @gotags: gorm:"embedded" json:"spec" bson:",inline" Spec *CreateCommentRequest `protobuf:"bytes,2,opt,name=spec,proto3" json:"spec" gorm:"embedded" bson:",inline"` // contains filtered or unexported fields }
func (*Comment) Descriptor
deprecated
func (*Comment) GetSpec ¶
func (x *Comment) GetSpec() *CreateCommentRequest
func (*Comment) ProtoMessage ¶
func (*Comment) ProtoMessage()
func (*Comment) ProtoReflect ¶
func (x *Comment) ProtoReflect() protoreflect.Message
type CreateCommentRequest ¶
type CreateCommentRequest struct { // 用户Id UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` // 文章内容, 支持Markdown格式 Content string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"` // contains filtered or unexported fields }
func (*CreateCommentRequest) Descriptor
deprecated
func (*CreateCommentRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateCommentRequest.ProtoReflect.Descriptor instead.
func (*CreateCommentRequest) GetContent ¶
func (x *CreateCommentRequest) GetContent() string
func (*CreateCommentRequest) GetUserId ¶
func (x *CreateCommentRequest) GetUserId() int64
func (*CreateCommentRequest) ProtoMessage ¶
func (*CreateCommentRequest) ProtoMessage()
func (*CreateCommentRequest) ProtoReflect ¶
func (x *CreateCommentRequest) ProtoReflect() protoreflect.Message
func (*CreateCommentRequest) Reset ¶
func (x *CreateCommentRequest) Reset()
func (*CreateCommentRequest) String ¶
func (x *CreateCommentRequest) String() string
type RpcClient ¶
type RpcClient interface {
CreateComment(ctx context.Context, in *CreateCommentRequest, opts ...grpc.CallOption) (*Comment, error)
}
RpcClient is the client API for Rpc 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 NewRpcClient ¶
func NewRpcClient(cc grpc.ClientConnInterface) RpcClient
type RpcServer ¶
type RpcServer interface { CreateComment(context.Context, *CreateCommentRequest) (*Comment, error) // contains filtered or unexported methods }
RpcServer is the server API for Rpc service. All implementations must embed UnimplementedRpcServer for forward compatibility
type UnimplementedRpcServer ¶
type UnimplementedRpcServer struct { }
UnimplementedRpcServer must be embedded to have forward compatible implementations.
func (UnimplementedRpcServer) CreateComment ¶
func (UnimplementedRpcServer) CreateComment(context.Context, *CreateCommentRequest) (*Comment, error)
type UnsafeRpcServer ¶
type UnsafeRpcServer interface {
// contains filtered or unexported methods
}
UnsafeRpcServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to RpcServer will result in compilation errors.