Documentation ¶
Index ¶
- Variables
- func RegisterBlogAdminServer(s grpc.ServiceRegistrar, srv BlogAdminServer)
- type Blog
- func (*Blog) Descriptor() ([]byte, []int)deprecated
- func (x *Blog) GetAuthor() string
- func (x *Blog) GetContent() string
- func (x *Blog) GetContentHtml() string
- func (x *Blog) GetCreateTime() *timestamppb.Timestamp
- func (x *Blog) GetId() int64
- func (x *Blog) GetSlug() string
- func (x *Blog) GetTags() []string
- func (x *Blog) GetTitle() string
- func (x *Blog) GetUpdateTime() *timestamppb.Timestamp
- func (*Blog) ProtoMessage()
- func (x *Blog) ProtoReflect() protoreflect.Message
- func (x *Blog) Reset()
- func (x *Blog) String() string
- type BlogAdminClient
- type BlogAdminServer
- type BlogNature
- type BlogRequest
- func (*BlogRequest) Descriptor() ([]byte, []int)deprecated
- func (x *BlogRequest) GetAuthor() string
- func (x *BlogRequest) GetContent() string
- func (x *BlogRequest) GetSlug() string
- func (x *BlogRequest) GetTags() []string
- func (x *BlogRequest) GetTitle() string
- func (*BlogRequest) ProtoMessage()
- func (x *BlogRequest) ProtoReflect() protoreflect.Message
- func (x *BlogRequest) Reset()
- func (x *BlogRequest) String() string
- type BlogResponse
- func (*BlogResponse) Descriptor() ([]byte, []int)deprecated
- func (x *BlogResponse) GetBlog() *Blog
- func (x *BlogResponse) GetResponse() *Response
- func (*BlogResponse) ProtoMessage()
- func (x *BlogResponse) ProtoReflect() protoreflect.Message
- func (x *BlogResponse) Reset()
- func (x *BlogResponse) String() string
- type Id
- type Response
- func (*Response) Descriptor() ([]byte, []int)deprecated
- func (x *Response) GetCode() int32
- func (x *Response) GetError() string
- func (x *Response) GetMsg() string
- func (*Response) ProtoMessage()
- func (x *Response) ProtoReflect() protoreflect.Message
- func (x *Response) Reset()
- func (x *Response) String() string
- type UnimplementedBlogAdminServer
- func (UnimplementedBlogAdminServer) CreateArticle(context.Context, *BlogRequest) (*Blog, error)
- func (UnimplementedBlogAdminServer) DeleteArticle(context.Context, *Id) (*Response, error)
- func (UnimplementedBlogAdminServer) GetArticle(context.Context, *Id) (*Blog, error)
- func (UnimplementedBlogAdminServer) UpdateArticle(context.Context, *BlogRequest) (*Blog, error)
- type UnsafeBlogAdminServer
Constants ¶
This section is empty.
Variables ¶
var ( BlogNature_name = map[int32]string{ 0: "Original", 1: "Reprinting", } BlogNature_value = map[string]int32{ "Original": 0, "Reprinting": 1, } )
Enum value maps for BlogNature.
var BlogAdmin_ServiceDesc = grpc.ServiceDesc{ ServiceName: "blog.BlogAdmin", HandlerType: (*BlogAdminServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetArticle", Handler: _BlogAdmin_GetArticle_Handler, }, { MethodName: "CreateArticle", Handler: _BlogAdmin_CreateArticle_Handler, }, { MethodName: "UpdateArticle", Handler: _BlogAdmin_UpdateArticle_Handler, }, { MethodName: "DeleteArticle", Handler: _BlogAdmin_DeleteArticle_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "blog.proto", }
BlogAdmin_ServiceDesc is the grpc.ServiceDesc for BlogAdmin 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 RegisterBlogAdminServer ¶
func RegisterBlogAdminServer(s grpc.ServiceRegistrar, srv BlogAdminServer)
Types ¶
type Blog ¶
type Blog struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` Content string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"` ContentHtml *string `protobuf:"bytes,4,opt,name=content_html,json=contentHtml,proto3,oneof" json:"content_html,omitempty"` Author string `protobuf:"bytes,5,opt,name=author,proto3" json:"author,omitempty"` Slug *string `protobuf:"bytes,8,opt,name=slug,proto3,oneof" json:"slug,omitempty"` Tags []string `protobuf:"bytes,9,rep,name=tags,proto3" json:"tags,omitempty"` CreateTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=createTime,proto3" json:"createTime,omitempty"` UpdateTime *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=updateTime,proto3" json:"updateTime,omitempty"` // contains filtered or unexported fields }
func (*Blog) Descriptor
deprecated
func (*Blog) GetContent ¶
func (*Blog) GetContentHtml ¶
func (*Blog) GetCreateTime ¶
func (x *Blog) GetCreateTime() *timestamppb.Timestamp
func (*Blog) GetUpdateTime ¶
func (x *Blog) GetUpdateTime() *timestamppb.Timestamp
func (*Blog) ProtoMessage ¶
func (*Blog) ProtoMessage()
func (*Blog) ProtoReflect ¶
func (x *Blog) ProtoReflect() protoreflect.Message
type BlogAdminClient ¶
type BlogAdminClient interface { GetArticle(ctx context.Context, in *Id, opts ...grpc.CallOption) (*Blog, error) CreateArticle(ctx context.Context, in *BlogRequest, opts ...grpc.CallOption) (*Blog, error) UpdateArticle(ctx context.Context, in *BlogRequest, opts ...grpc.CallOption) (*Blog, error) DeleteArticle(ctx context.Context, in *Id, opts ...grpc.CallOption) (*Response, error) }
BlogAdminClient is the client API for BlogAdmin 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 NewBlogAdminClient ¶
func NewBlogAdminClient(cc grpc.ClientConnInterface) BlogAdminClient
type BlogAdminServer ¶
type BlogAdminServer interface { GetArticle(context.Context, *Id) (*Blog, error) CreateArticle(context.Context, *BlogRequest) (*Blog, error) UpdateArticle(context.Context, *BlogRequest) (*Blog, error) DeleteArticle(context.Context, *Id) (*Response, error) // contains filtered or unexported methods }
BlogAdminServer is the server API for BlogAdmin service. All implementations must embed UnimplementedBlogAdminServer for forward compatibility
type BlogNature ¶
type BlogNature int32
const ( BlogNature_Original BlogNature = 0 BlogNature_Reprinting BlogNature = 1 )
func (BlogNature) Descriptor ¶
func (BlogNature) Descriptor() protoreflect.EnumDescriptor
func (BlogNature) Enum ¶
func (x BlogNature) Enum() *BlogNature
func (BlogNature) EnumDescriptor
deprecated
func (BlogNature) EnumDescriptor() ([]byte, []int)
Deprecated: Use BlogNature.Descriptor instead.
func (BlogNature) Number ¶
func (x BlogNature) Number() protoreflect.EnumNumber
func (BlogNature) String ¶
func (x BlogNature) String() string
func (BlogNature) Type ¶
func (BlogNature) Type() protoreflect.EnumType
type BlogRequest ¶
type BlogRequest struct { Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` Author string `protobuf:"bytes,3,opt,name=author,proto3" json:"author,omitempty"` Slug *string `protobuf:"bytes,4,opt,name=slug,proto3,oneof" json:"slug,omitempty"` Tags []string `protobuf:"bytes,5,rep,name=tags,proto3" json:"tags,omitempty"` // contains filtered or unexported fields }
func (*BlogRequest) Descriptor
deprecated
func (*BlogRequest) Descriptor() ([]byte, []int)
Deprecated: Use BlogRequest.ProtoReflect.Descriptor instead.
func (*BlogRequest) GetAuthor ¶
func (x *BlogRequest) GetAuthor() string
func (*BlogRequest) GetContent ¶
func (x *BlogRequest) GetContent() string
func (*BlogRequest) GetSlug ¶
func (x *BlogRequest) GetSlug() string
func (*BlogRequest) GetTags ¶
func (x *BlogRequest) GetTags() []string
func (*BlogRequest) GetTitle ¶
func (x *BlogRequest) GetTitle() string
func (*BlogRequest) ProtoMessage ¶
func (*BlogRequest) ProtoMessage()
func (*BlogRequest) ProtoReflect ¶
func (x *BlogRequest) ProtoReflect() protoreflect.Message
func (*BlogRequest) Reset ¶
func (x *BlogRequest) Reset()
func (*BlogRequest) String ¶
func (x *BlogRequest) String() string
type BlogResponse ¶
type BlogResponse struct { Response *Response `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` Blog *Blog `protobuf:"bytes,2,opt,name=blog,proto3" json:"blog,omitempty"` // contains filtered or unexported fields }
func (*BlogResponse) Descriptor
deprecated
func (*BlogResponse) Descriptor() ([]byte, []int)
Deprecated: Use BlogResponse.ProtoReflect.Descriptor instead.
func (*BlogResponse) GetBlog ¶
func (x *BlogResponse) GetBlog() *Blog
func (*BlogResponse) GetResponse ¶
func (x *BlogResponse) GetResponse() *Response
func (*BlogResponse) ProtoMessage ¶
func (*BlogResponse) ProtoMessage()
func (*BlogResponse) ProtoReflect ¶
func (x *BlogResponse) ProtoReflect() protoreflect.Message
func (*BlogResponse) Reset ¶
func (x *BlogResponse) Reset()
func (*BlogResponse) String ¶
func (x *BlogResponse) String() string
type Id ¶
type Id struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*Id) Descriptor
deprecated
func (*Id) ProtoMessage ¶
func (*Id) ProtoMessage()
func (*Id) ProtoReflect ¶
func (x *Id) ProtoReflect() protoreflect.Message
type Response ¶
type Response struct { Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` Error string `protobuf:"bytes,3,opt,name=error,proto3" json:"error,omitempty"` // contains filtered or unexported fields }
func (*Response) Descriptor
deprecated
func (*Response) ProtoMessage ¶
func (*Response) ProtoMessage()
func (*Response) ProtoReflect ¶
func (x *Response) ProtoReflect() protoreflect.Message
type UnimplementedBlogAdminServer ¶
type UnimplementedBlogAdminServer struct { }
UnimplementedBlogAdminServer must be embedded to have forward compatible implementations.
func (UnimplementedBlogAdminServer) CreateArticle ¶
func (UnimplementedBlogAdminServer) CreateArticle(context.Context, *BlogRequest) (*Blog, error)
func (UnimplementedBlogAdminServer) DeleteArticle ¶
func (UnimplementedBlogAdminServer) GetArticle ¶
func (UnimplementedBlogAdminServer) UpdateArticle ¶
func (UnimplementedBlogAdminServer) UpdateArticle(context.Context, *BlogRequest) (*Blog, error)
type UnsafeBlogAdminServer ¶
type UnsafeBlogAdminServer interface {
// contains filtered or unexported methods
}
UnsafeBlogAdminServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to BlogAdminServer will result in compilation errors.