Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)
- type Comment
- func (*Comment) Descriptor() ([]byte, []int)deprecated
- func (x *Comment) GetCreateAt() int64
- func (x *Comment) GetId() string
- func (x *Comment) GetSpec() *CreateCommnetRequest
- func (*Comment) ProtoMessage()
- func (x *Comment) ProtoReflect() protoreflect.Message
- func (x *Comment) Reset()
- func (x *Comment) String() string
- type CreateCommnetRequest
- func (*CreateCommnetRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateCommnetRequest) GetBlogId() string
- func (x *CreateCommnetRequest) GetContent() string
- func (x *CreateCommnetRequest) GetUserId() string
- func (*CreateCommnetRequest) ProtoMessage()
- func (x *CreateCommnetRequest) ProtoReflect() protoreflect.Message
- func (x *CreateCommnetRequest) Reset()
- func (x *CreateCommnetRequest) String() string
- type ServiceClient
- type ServiceServer
- type UnimplementedServiceServer
- type UnsafeServiceServer
Constants ¶
const (
AppName = "comment"
)
const (
Service_CreateComment_FullMethodName = "/go13.vblog.comment.Service/CreateComment"
)
Variables ¶
var File_apps_comment_pb_interface_proto protoreflect.FileDescriptor
var File_apps_comment_pb_model_proto protoreflect.FileDescriptor
var Service_ServiceDesc = grpc.ServiceDesc{ ServiceName: "go13.vblog.comment.Service", HandlerType: (*ServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateComment", Handler: _Service_CreateComment_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "apps/comment/pb/interface.proto", }
Service_ServiceDesc is the grpc.ServiceDesc for Service service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterServiceServer ¶
func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)
Types ¶
type Comment ¶
type Comment struct { // 评论Id // @gotags: json:"id" Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id"` // 10位时间戳 // @gotags: json:"create_at" CreateAt int64 `protobuf:"varint,2,opt,name=create_at,json=createAt,proto3" json:"create_at"` // 评论具体定义 // @gotags: json:"spec" gorm:"embedded" Spec *CreateCommnetRequest `protobuf:"bytes,3,opt,name=spec,proto3" json:"spec" gorm:"embedded"` // contains filtered or unexported fields }
func (*Comment) Descriptor
deprecated
func (*Comment) GetCreateAt ¶
func (*Comment) GetSpec ¶
func (x *Comment) GetSpec() *CreateCommnetRequest
func (*Comment) ProtoMessage ¶
func (*Comment) ProtoMessage()
func (*Comment) ProtoReflect ¶
func (x *Comment) ProtoReflect() protoreflect.Message
type CreateCommnetRequest ¶
type CreateCommnetRequest struct { // 被评论文章Id // @gotags: json:"blog_id" BlogId string `protobuf:"bytes,3,opt,name=blog_id,json=blogId,proto3" json:"blog_id"` // 评论的用户 // @gotags: json:"user_id" UserId string `protobuf:"bytes,4,opt,name=user_id,json=userId,proto3" json:"user_id"` // 评论内容 // @gotags: json:"content" Content string `protobuf:"bytes,5,opt,name=content,proto3" json:"content"` // contains filtered or unexported fields }
func (*CreateCommnetRequest) Descriptor
deprecated
func (*CreateCommnetRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateCommnetRequest.ProtoReflect.Descriptor instead.
func (*CreateCommnetRequest) GetBlogId ¶
func (x *CreateCommnetRequest) GetBlogId() string
func (*CreateCommnetRequest) GetContent ¶
func (x *CreateCommnetRequest) GetContent() string
func (*CreateCommnetRequest) GetUserId ¶
func (x *CreateCommnetRequest) GetUserId() string
func (*CreateCommnetRequest) ProtoMessage ¶
func (*CreateCommnetRequest) ProtoMessage()
func (*CreateCommnetRequest) ProtoReflect ¶
func (x *CreateCommnetRequest) ProtoReflect() protoreflect.Message
func (*CreateCommnetRequest) Reset ¶
func (x *CreateCommnetRequest) Reset()
func (*CreateCommnetRequest) String ¶
func (x *CreateCommnetRequest) String() string
type ServiceClient ¶
type ServiceClient interface {
CreateComment(ctx context.Context, in *CreateCommnetRequest, opts ...grpc.CallOption) (*Comment, error)
}
ServiceClient is the client API for Service 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 NewServiceClient ¶
func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient
type ServiceServer ¶
type ServiceServer interface { CreateComment(context.Context, *CreateCommnetRequest) (*Comment, error) // contains filtered or unexported methods }
ServiceServer is the server API for Service service. All implementations must embed UnimplementedServiceServer for forward compatibility
type UnimplementedServiceServer ¶
type UnimplementedServiceServer struct { }
UnimplementedServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedServiceServer) CreateComment ¶
func (UnimplementedServiceServer) CreateComment(context.Context, *CreateCommnetRequest) (*Comment, error)
type UnsafeServiceServer ¶
type UnsafeServiceServer interface {
// contains filtered or unexported methods
}
UnsafeServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ServiceServer will result in compilation errors.