Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterBlogServer(s grpc.ServiceRegistrar, srv BlogServer)
- func Start(port *int, srv BlogServer) error
- type ArticleDetailReply
- func (*ArticleDetailReply) Descriptor() ([]byte, []int)deprecated
- func (x *ArticleDetailReply) GetCategoryLink() string
- func (x *ArticleDetailReply) GetCategoryName() string
- func (x *ArticleDetailReply) GetContent() string
- func (x *ArticleDetailReply) GetDisplayTime() string
- func (x *ArticleDetailReply) GetExcerpt() string
- func (x *ArticleDetailReply) GetNext() string
- func (x *ArticleDetailReply) GetPrevious() string
- func (x *ArticleDetailReply) GetSlug() string
- func (x *ArticleDetailReply) GetThumb() string
- func (x *ArticleDetailReply) GetTitle() string
- func (*ArticleDetailReply) ProtoMessage()
- func (x *ArticleDetailReply) ProtoReflect() protoreflect.Message
- func (x *ArticleDetailReply) Reset()
- func (x *ArticleDetailReply) String() string
- type ArticleDetailReqeust
- func (*ArticleDetailReqeust) Descriptor() ([]byte, []int)deprecated
- func (x *ArticleDetailReqeust) GetSlug() string
- func (*ArticleDetailReqeust) ProtoMessage()
- func (x *ArticleDetailReqeust) ProtoReflect() protoreflect.Message
- func (x *ArticleDetailReqeust) Reset()
- func (x *ArticleDetailReqeust) String() string
- type BlogClient
- type BlogServer
- type UnimplementedBlogServer
- type UnsafeBlogServer
Constants ¶
const (
Blog_ArticleDetail_FullMethodName = "/blog_grpc.blog/ArticleDetail"
)
const ServiceName = "blog"
Variables ¶
var Blog_ServiceDesc = grpc.ServiceDesc{ ServiceName: "blog_grpc.blog", HandlerType: (*BlogServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "ArticleDetail", Handler: _Blog_ArticleDetail_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "blog.proto", }
Blog_ServiceDesc is the grpc.ServiceDesc for Blog service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_blog_proto protoreflect.FileDescriptor
Functions ¶
func RegisterBlogServer ¶
func RegisterBlogServer(s grpc.ServiceRegistrar, srv BlogServer)
func Start ¶
func Start(port *int, srv BlogServer) error
Types ¶
type ArticleDetailReply ¶
type ArticleDetailReply struct { Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` Thumb string `protobuf:"bytes,2,opt,name=Thumb,proto3" json:"Thumb,omitempty"` Slug string `protobuf:"bytes,3,opt,name=Slug,proto3" json:"Slug,omitempty"` Excerpt string `protobuf:"bytes,4,opt,name=Excerpt,proto3" json:"Excerpt,omitempty"` Content string `protobuf:"bytes,5,opt,name=Content,proto3" json:"Content,omitempty"` DisplayTime string `protobuf:"bytes,6,opt,name=DisplayTime,proto3" json:"DisplayTime,omitempty"` Next string `protobuf:"bytes,7,opt,name=Next,proto3" json:"Next,omitempty"` Previous string `protobuf:"bytes,8,opt,name=Previous,proto3" json:"Previous,omitempty"` CategoryName string `protobuf:"bytes,9,opt,name=CategoryName,proto3" json:"CategoryName,omitempty"` CategoryLink string `protobuf:"bytes,10,opt,name=CategoryLink,proto3" json:"CategoryLink,omitempty"` // contains filtered or unexported fields }
func (*ArticleDetailReply) Descriptor
deprecated
func (*ArticleDetailReply) Descriptor() ([]byte, []int)
Deprecated: Use ArticleDetailReply.ProtoReflect.Descriptor instead.
func (*ArticleDetailReply) GetCategoryLink ¶
func (x *ArticleDetailReply) GetCategoryLink() string
func (*ArticleDetailReply) GetCategoryName ¶
func (x *ArticleDetailReply) GetCategoryName() string
func (*ArticleDetailReply) GetContent ¶
func (x *ArticleDetailReply) GetContent() string
func (*ArticleDetailReply) GetDisplayTime ¶
func (x *ArticleDetailReply) GetDisplayTime() string
func (*ArticleDetailReply) GetExcerpt ¶
func (x *ArticleDetailReply) GetExcerpt() string
func (*ArticleDetailReply) GetNext ¶
func (x *ArticleDetailReply) GetNext() string
func (*ArticleDetailReply) GetPrevious ¶
func (x *ArticleDetailReply) GetPrevious() string
func (*ArticleDetailReply) GetSlug ¶
func (x *ArticleDetailReply) GetSlug() string
func (*ArticleDetailReply) GetThumb ¶
func (x *ArticleDetailReply) GetThumb() string
func (*ArticleDetailReply) GetTitle ¶
func (x *ArticleDetailReply) GetTitle() string
func (*ArticleDetailReply) ProtoMessage ¶
func (*ArticleDetailReply) ProtoMessage()
func (*ArticleDetailReply) ProtoReflect ¶
func (x *ArticleDetailReply) ProtoReflect() protoreflect.Message
func (*ArticleDetailReply) Reset ¶
func (x *ArticleDetailReply) Reset()
func (*ArticleDetailReply) String ¶
func (x *ArticleDetailReply) String() string
type ArticleDetailReqeust ¶
type ArticleDetailReqeust struct { Slug string `protobuf:"bytes,1,opt,name=slug,proto3" json:"slug,omitempty"` // contains filtered or unexported fields }
func (*ArticleDetailReqeust) Descriptor
deprecated
func (*ArticleDetailReqeust) Descriptor() ([]byte, []int)
Deprecated: Use ArticleDetailReqeust.ProtoReflect.Descriptor instead.
func (*ArticleDetailReqeust) GetSlug ¶
func (x *ArticleDetailReqeust) GetSlug() string
func (*ArticleDetailReqeust) ProtoMessage ¶
func (*ArticleDetailReqeust) ProtoMessage()
func (*ArticleDetailReqeust) ProtoReflect ¶
func (x *ArticleDetailReqeust) ProtoReflect() protoreflect.Message
func (*ArticleDetailReqeust) Reset ¶
func (x *ArticleDetailReqeust) Reset()
func (*ArticleDetailReqeust) String ¶
func (x *ArticleDetailReqeust) String() string
type BlogClient ¶
type BlogClient interface {
ArticleDetail(ctx context.Context, in *ArticleDetailReqeust, opts ...grpc.CallOption) (*ArticleDetailReply, error)
}
BlogClient is the client API for Blog 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 Client ¶ added in v1.1.2
func Client() (BlogClient, error)
func NewBlogClient ¶
func NewBlogClient(cc grpc.ClientConnInterface) BlogClient
type BlogServer ¶
type BlogServer interface {
ArticleDetail(context.Context, *ArticleDetailReqeust) (*ArticleDetailReply, error)
}
BlogServer is the server API for Blog service. All implementations should embed UnimplementedBlogServer for forward compatibility
type UnimplementedBlogServer ¶
type UnimplementedBlogServer struct { }
UnimplementedBlogServer should be embedded to have forward compatible implementations.
func (UnimplementedBlogServer) ArticleDetail ¶
func (UnimplementedBlogServer) ArticleDetail(context.Context, *ArticleDetailReqeust) (*ArticleDetailReply, error)
type UnsafeBlogServer ¶
type UnsafeBlogServer interface {
// contains filtered or unexported methods
}
UnsafeBlogServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to BlogServer will result in compilation errors.