Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterNewsHTTPServer(s *http.Server, srv NewsHTTPServer)
- func RegisterNewsServer(s grpc.ServiceRegistrar, srv NewsServer)
- type AddCommentReply
- type AddCommentRequest
- func (*AddCommentRequest) Descriptor() ([]byte, []int)deprecated
- func (x *AddCommentRequest) GetArticleId() int64
- func (x *AddCommentRequest) GetContent() string
- func (x *AddCommentRequest) GetUserId() int64
- func (*AddCommentRequest) ProtoMessage()
- func (x *AddCommentRequest) ProtoReflect() protoreflect.Message
- func (x *AddCommentRequest) Reset()
- func (x *AddCommentRequest) String() string
- type Article
- func (*Article) Descriptor() ([]byte, []int)deprecated
- func (x *Article) GetContent() string
- func (x *Article) GetCreatedAt() *timestamppb.Timestamp
- func (x *Article) GetId() int64
- func (x *Article) GetTitle() string
- func (x *Article) GetUpdatedAt() *timestamppb.Timestamp
- func (*Article) ProtoMessage()
- func (x *Article) ProtoReflect() protoreflect.Message
- func (x *Article) Reset()
- func (x *Article) String() string
- type Comment
- func (*Comment) Descriptor() ([]byte, []int)deprecated
- func (x *Comment) GetArticleId() int64
- func (x *Comment) GetContent() string
- func (x *Comment) GetCreatedAt() *timestamppb.Timestamp
- func (x *Comment) GetId() int64
- func (x *Comment) GetUserId() int64
- func (*Comment) ProtoMessage()
- func (x *Comment) ProtoReflect() protoreflect.Message
- func (x *Comment) Reset()
- func (x *Comment) String() string
- type CreateArticleReply
- func (*CreateArticleReply) Descriptor() ([]byte, []int)deprecated
- func (x *CreateArticleReply) GetArticle() *Article
- func (*CreateArticleReply) ProtoMessage()
- func (x *CreateArticleReply) ProtoReflect() protoreflect.Message
- func (x *CreateArticleReply) Reset()
- func (x *CreateArticleReply) String() string
- type CreateArticleRequest
- func (*CreateArticleRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateArticleRequest) GetContent() string
- func (x *CreateArticleRequest) GetTitle() string
- func (*CreateArticleRequest) ProtoMessage()
- func (x *CreateArticleRequest) ProtoReflect() protoreflect.Message
- func (x *CreateArticleRequest) Reset()
- func (x *CreateArticleRequest) String() string
- type DeleteArticleReply
- type DeleteArticleRequest
- func (*DeleteArticleRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteArticleRequest) GetId() int64
- func (*DeleteArticleRequest) ProtoMessage()
- func (x *DeleteArticleRequest) ProtoReflect() protoreflect.Message
- func (x *DeleteArticleRequest) Reset()
- func (x *DeleteArticleRequest) String() string
- type DeleteCommentReply
- type DeleteCommentRequest
- func (*DeleteCommentRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteCommentRequest) GetArticleId() int64
- func (x *DeleteCommentRequest) GetId() int64
- func (x *DeleteCommentRequest) GetUserId() int64
- func (*DeleteCommentRequest) ProtoMessage()
- func (x *DeleteCommentRequest) ProtoReflect() protoreflect.Message
- func (x *DeleteCommentRequest) Reset()
- func (x *DeleteCommentRequest) String() string
- type GetArticleReply
- type GetArticleRequest
- type GetCommentReply
- type GetCommentRequest
- type ListArticleReply
- type ListArticleRequest
- type NewsClient
- type NewsErrorReason
- func (NewsErrorReason) Descriptor() protoreflect.EnumDescriptor
- func (x NewsErrorReason) Enum() *NewsErrorReason
- func (NewsErrorReason) EnumDescriptor() ([]byte, []int)deprecated
- func (x NewsErrorReason) Number() protoreflect.EnumNumber
- func (x NewsErrorReason) String() string
- func (NewsErrorReason) Type() protoreflect.EnumType
- type NewsHTTPClient
- type NewsHTTPClientImpl
- func (c *NewsHTTPClientImpl) AddComment(ctx context.Context, in *AddCommentRequest, opts ...http.CallOption) (*AddCommentReply, error)
- func (c *NewsHTTPClientImpl) CreateArticle(ctx context.Context, in *CreateArticleRequest, opts ...http.CallOption) (*CreateArticleReply, error)
- func (c *NewsHTTPClientImpl) DeleteArticle(ctx context.Context, in *DeleteArticleRequest, opts ...http.CallOption) (*DeleteArticleReply, error)
- func (c *NewsHTTPClientImpl) DeleteComment(ctx context.Context, in *DeleteCommentRequest, opts ...http.CallOption) (*DeleteCommentReply, error)
- func (c *NewsHTTPClientImpl) GetArticle(ctx context.Context, in *GetArticleRequest, opts ...http.CallOption) (*GetArticleReply, error)
- func (c *NewsHTTPClientImpl) GetComments(ctx context.Context, in *GetCommentRequest, opts ...http.CallOption) (*GetCommentReply, error)
- func (c *NewsHTTPClientImpl) ListArticle(ctx context.Context, in *ListArticleRequest, opts ...http.CallOption) (*ListArticleReply, error)
- func (c *NewsHTTPClientImpl) UpdateArticle(ctx context.Context, in *UpdateArticleRequest, opts ...http.CallOption) (*UpdateArticleReply, error)
- type NewsHTTPServer
- type NewsServer
- type UnimplementedNewsServer
- func (UnimplementedNewsServer) AddComment(context.Context, *AddCommentRequest) (*AddCommentReply, error)
- func (UnimplementedNewsServer) CreateArticle(context.Context, *CreateArticleRequest) (*CreateArticleReply, error)
- func (UnimplementedNewsServer) DeleteArticle(context.Context, *DeleteArticleRequest) (*DeleteArticleReply, error)
- func (UnimplementedNewsServer) DeleteComment(context.Context, *DeleteCommentRequest) (*DeleteCommentReply, error)
- func (UnimplementedNewsServer) GetArticle(context.Context, *GetArticleRequest) (*GetArticleReply, error)
- func (UnimplementedNewsServer) GetComments(context.Context, *GetCommentRequest) (*GetCommentReply, error)
- func (UnimplementedNewsServer) ListArticle(context.Context, *ListArticleRequest) (*ListArticleReply, error)
- func (UnimplementedNewsServer) UpdateArticle(context.Context, *UpdateArticleRequest) (*UpdateArticleReply, error)
- type UnsafeNewsServer
- type UpdateArticleReply
- func (*UpdateArticleReply) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateArticleReply) GetArticle() *Article
- func (*UpdateArticleReply) ProtoMessage()
- func (x *UpdateArticleReply) ProtoReflect() protoreflect.Message
- func (x *UpdateArticleReply) Reset()
- func (x *UpdateArticleReply) String() string
- type UpdateArticleRequest
- func (*UpdateArticleRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateArticleRequest) GetContent() string
- func (x *UpdateArticleRequest) GetId() int64
- func (x *UpdateArticleRequest) GetTitle() string
- func (*UpdateArticleRequest) ProtoMessage()
- func (x *UpdateArticleRequest) ProtoReflect() protoreflect.Message
- func (x *UpdateArticleRequest) Reset()
- func (x *UpdateArticleRequest) String() string
Constants ¶
const OperationNewsAddComment = "/news.v1.News/AddComment"
const OperationNewsCreateArticle = "/news.v1.News/CreateArticle"
const OperationNewsDeleteArticle = "/news.v1.News/DeleteArticle"
const OperationNewsDeleteComment = "/news.v1.News/DeleteComment"
const OperationNewsGetArticle = "/news.v1.News/GetArticle"
const OperationNewsGetComments = "/news.v1.News/GetComments"
const OperationNewsListArticle = "/news.v1.News/ListArticle"
const OperationNewsUpdateArticle = "/news.v1.News/UpdateArticle"
Variables ¶
var ( NewsErrorReason_name = map[int32]string{ 0: "GREETER_UNSPECIFIED", 1: "NEWS_NOT_FOUND", } NewsErrorReason_value = map[string]int32{ "GREETER_UNSPECIFIED": 0, "NEWS_NOT_FOUND": 1, } )
Enum value maps for NewsErrorReason.
var File_news_v1_news_error_reason_proto protoreflect.FileDescriptor
var File_news_v1_news_proto protoreflect.FileDescriptor
var News_ServiceDesc = grpc.ServiceDesc{ ServiceName: "news.v1.News", HandlerType: (*NewsServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateArticle", Handler: _News_CreateArticle_Handler, }, { MethodName: "UpdateArticle", Handler: _News_UpdateArticle_Handler, }, { MethodName: "DeleteArticle", Handler: _News_DeleteArticle_Handler, }, { MethodName: "GetArticle", Handler: _News_GetArticle_Handler, }, { MethodName: "ListArticle", Handler: _News_ListArticle_Handler, }, { MethodName: "AddComment", Handler: _News_AddComment_Handler, }, { MethodName: "GetComments", Handler: _News_GetComments_Handler, }, { MethodName: "DeleteComment", Handler: _News_DeleteComment_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "news/v1/news.proto", }
News_ServiceDesc is the grpc.ServiceDesc for News service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterNewsHTTPServer ¶
func RegisterNewsHTTPServer(s *http.Server, srv NewsHTTPServer)
func RegisterNewsServer ¶
func RegisterNewsServer(s grpc.ServiceRegistrar, srv NewsServer)
Types ¶
type AddCommentReply ¶
type AddCommentReply struct { Comment *Comment `protobuf:"bytes,1,opt,name=comment,proto3" json:"comment,omitempty"` // contains filtered or unexported fields }
func (*AddCommentReply) Descriptor
deprecated
func (*AddCommentReply) Descriptor() ([]byte, []int)
Deprecated: Use AddCommentReply.ProtoReflect.Descriptor instead.
func (*AddCommentReply) GetComment ¶
func (x *AddCommentReply) GetComment() *Comment
func (*AddCommentReply) ProtoMessage ¶
func (*AddCommentReply) ProtoMessage()
func (*AddCommentReply) ProtoReflect ¶
func (x *AddCommentReply) ProtoReflect() protoreflect.Message
func (*AddCommentReply) Reset ¶
func (x *AddCommentReply) Reset()
func (*AddCommentReply) String ¶
func (x *AddCommentReply) String() string
type AddCommentRequest ¶
type AddCommentRequest struct { UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` ArticleId int64 `protobuf:"varint,2,opt,name=article_id,json=articleId,proto3" json:"article_id,omitempty"` Content string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"` // contains filtered or unexported fields }
func (*AddCommentRequest) Descriptor
deprecated
func (*AddCommentRequest) Descriptor() ([]byte, []int)
Deprecated: Use AddCommentRequest.ProtoReflect.Descriptor instead.
func (*AddCommentRequest) GetArticleId ¶
func (x *AddCommentRequest) GetArticleId() int64
func (*AddCommentRequest) GetContent ¶
func (x *AddCommentRequest) GetContent() string
func (*AddCommentRequest) GetUserId ¶
func (x *AddCommentRequest) GetUserId() int64
func (*AddCommentRequest) ProtoMessage ¶
func (*AddCommentRequest) ProtoMessage()
func (*AddCommentRequest) ProtoReflect ¶
func (x *AddCommentRequest) ProtoReflect() protoreflect.Message
func (*AddCommentRequest) Reset ¶
func (x *AddCommentRequest) Reset()
func (*AddCommentRequest) String ¶
func (x *AddCommentRequest) String() string
type Article ¶
type Article 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"` CreatedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=createdAt,proto3" json:"createdAt,omitempty"` UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=updatedAt,proto3" json:"updatedAt,omitempty"` // contains filtered or unexported fields }
func (*Article) Descriptor
deprecated
func (*Article) GetContent ¶
func (*Article) GetCreatedAt ¶
func (x *Article) GetCreatedAt() *timestamppb.Timestamp
func (*Article) GetUpdatedAt ¶
func (x *Article) GetUpdatedAt() *timestamppb.Timestamp
func (*Article) ProtoMessage ¶
func (*Article) ProtoMessage()
func (*Article) ProtoReflect ¶
func (x *Article) ProtoReflect() protoreflect.Message
type Comment ¶
type Comment struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` UserId int64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` ArticleId int64 `protobuf:"varint,3,opt,name=article_id,json=articleId,proto3" json:"article_id,omitempty"` Content string `protobuf:"bytes,4,opt,name=content,proto3" json:"content,omitempty"` CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=createdAt,proto3" json:"createdAt,omitempty"` // contains filtered or unexported fields }
func (*Comment) Descriptor
deprecated
func (*Comment) GetArticleId ¶
func (*Comment) GetContent ¶
func (*Comment) GetCreatedAt ¶
func (x *Comment) GetCreatedAt() *timestamppb.Timestamp
func (*Comment) ProtoMessage ¶
func (*Comment) ProtoMessage()
func (*Comment) ProtoReflect ¶
func (x *Comment) ProtoReflect() protoreflect.Message
type CreateArticleReply ¶
type CreateArticleReply struct { Article *Article `protobuf:"bytes,1,opt,name=Article,proto3" json:"Article,omitempty"` // contains filtered or unexported fields }
func (*CreateArticleReply) Descriptor
deprecated
func (*CreateArticleReply) Descriptor() ([]byte, []int)
Deprecated: Use CreateArticleReply.ProtoReflect.Descriptor instead.
func (*CreateArticleReply) GetArticle ¶
func (x *CreateArticleReply) GetArticle() *Article
func (*CreateArticleReply) ProtoMessage ¶
func (*CreateArticleReply) ProtoMessage()
func (*CreateArticleReply) ProtoReflect ¶
func (x *CreateArticleReply) ProtoReflect() protoreflect.Message
func (*CreateArticleReply) Reset ¶
func (x *CreateArticleReply) Reset()
func (*CreateArticleReply) String ¶
func (x *CreateArticleReply) String() string
type CreateArticleRequest ¶
type CreateArticleRequest struct { Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` // the title of string must be between 5 and 50 character Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` // contains filtered or unexported fields }
func (*CreateArticleRequest) Descriptor
deprecated
func (*CreateArticleRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateArticleRequest.ProtoReflect.Descriptor instead.
func (*CreateArticleRequest) GetContent ¶
func (x *CreateArticleRequest) GetContent() string
func (*CreateArticleRequest) GetTitle ¶
func (x *CreateArticleRequest) GetTitle() string
func (*CreateArticleRequest) ProtoMessage ¶
func (*CreateArticleRequest) ProtoMessage()
func (*CreateArticleRequest) ProtoReflect ¶
func (x *CreateArticleRequest) ProtoReflect() protoreflect.Message
func (*CreateArticleRequest) Reset ¶
func (x *CreateArticleRequest) Reset()
func (*CreateArticleRequest) String ¶
func (x *CreateArticleRequest) String() string
type DeleteArticleReply ¶
type DeleteArticleReply struct {
// contains filtered or unexported fields
}
func (*DeleteArticleReply) Descriptor
deprecated
func (*DeleteArticleReply) Descriptor() ([]byte, []int)
Deprecated: Use DeleteArticleReply.ProtoReflect.Descriptor instead.
func (*DeleteArticleReply) ProtoMessage ¶
func (*DeleteArticleReply) ProtoMessage()
func (*DeleteArticleReply) ProtoReflect ¶
func (x *DeleteArticleReply) ProtoReflect() protoreflect.Message
func (*DeleteArticleReply) Reset ¶
func (x *DeleteArticleReply) Reset()
func (*DeleteArticleReply) String ¶
func (x *DeleteArticleReply) String() string
type DeleteArticleRequest ¶
type DeleteArticleRequest struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*DeleteArticleRequest) Descriptor
deprecated
func (*DeleteArticleRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteArticleRequest.ProtoReflect.Descriptor instead.
func (*DeleteArticleRequest) GetId ¶
func (x *DeleteArticleRequest) GetId() int64
func (*DeleteArticleRequest) ProtoMessage ¶
func (*DeleteArticleRequest) ProtoMessage()
func (*DeleteArticleRequest) ProtoReflect ¶
func (x *DeleteArticleRequest) ProtoReflect() protoreflect.Message
func (*DeleteArticleRequest) Reset ¶
func (x *DeleteArticleRequest) Reset()
func (*DeleteArticleRequest) String ¶
func (x *DeleteArticleRequest) String() string
type DeleteCommentReply ¶
type DeleteCommentReply struct {
// contains filtered or unexported fields
}
func (*DeleteCommentReply) Descriptor
deprecated
func (*DeleteCommentReply) Descriptor() ([]byte, []int)
Deprecated: Use DeleteCommentReply.ProtoReflect.Descriptor instead.
func (*DeleteCommentReply) ProtoMessage ¶
func (*DeleteCommentReply) ProtoMessage()
func (*DeleteCommentReply) ProtoReflect ¶
func (x *DeleteCommentReply) ProtoReflect() protoreflect.Message
func (*DeleteCommentReply) Reset ¶
func (x *DeleteCommentReply) Reset()
func (*DeleteCommentReply) String ¶
func (x *DeleteCommentReply) String() string
type DeleteCommentRequest ¶
type DeleteCommentRequest struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` UserId int64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` ArticleId int64 `protobuf:"varint,3,opt,name=article_id,json=articleId,proto3" json:"article_id,omitempty"` // contains filtered or unexported fields }
func (*DeleteCommentRequest) Descriptor
deprecated
func (*DeleteCommentRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteCommentRequest.ProtoReflect.Descriptor instead.
func (*DeleteCommentRequest) GetArticleId ¶
func (x *DeleteCommentRequest) GetArticleId() int64
func (*DeleteCommentRequest) GetId ¶
func (x *DeleteCommentRequest) GetId() int64
func (*DeleteCommentRequest) GetUserId ¶
func (x *DeleteCommentRequest) GetUserId() int64
func (*DeleteCommentRequest) ProtoMessage ¶
func (*DeleteCommentRequest) ProtoMessage()
func (*DeleteCommentRequest) ProtoReflect ¶
func (x *DeleteCommentRequest) ProtoReflect() protoreflect.Message
func (*DeleteCommentRequest) Reset ¶
func (x *DeleteCommentRequest) Reset()
func (*DeleteCommentRequest) String ¶
func (x *DeleteCommentRequest) String() string
type GetArticleReply ¶
type GetArticleReply struct { Article *Article `protobuf:"bytes,1,opt,name=Article,proto3" json:"Article,omitempty"` // contains filtered or unexported fields }
func (*GetArticleReply) Descriptor
deprecated
func (*GetArticleReply) Descriptor() ([]byte, []int)
Deprecated: Use GetArticleReply.ProtoReflect.Descriptor instead.
func (*GetArticleReply) GetArticle ¶
func (x *GetArticleReply) GetArticle() *Article
func (*GetArticleReply) ProtoMessage ¶
func (*GetArticleReply) ProtoMessage()
func (*GetArticleReply) ProtoReflect ¶
func (x *GetArticleReply) ProtoReflect() protoreflect.Message
func (*GetArticleReply) Reset ¶
func (x *GetArticleReply) Reset()
func (*GetArticleReply) String ¶
func (x *GetArticleReply) String() string
type GetArticleRequest ¶
type GetArticleRequest struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*GetArticleRequest) Descriptor
deprecated
func (*GetArticleRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetArticleRequest.ProtoReflect.Descriptor instead.
func (*GetArticleRequest) GetId ¶
func (x *GetArticleRequest) GetId() int64
func (*GetArticleRequest) ProtoMessage ¶
func (*GetArticleRequest) ProtoMessage()
func (*GetArticleRequest) ProtoReflect ¶
func (x *GetArticleRequest) ProtoReflect() protoreflect.Message
func (*GetArticleRequest) Reset ¶
func (x *GetArticleRequest) Reset()
func (*GetArticleRequest) String ¶
func (x *GetArticleRequest) String() string
type GetCommentReply ¶
type GetCommentReply struct { Comment []*Comment `protobuf:"bytes,1,rep,name=comment,proto3" json:"comment,omitempty"` // contains filtered or unexported fields }
func (*GetCommentReply) Descriptor
deprecated
func (*GetCommentReply) Descriptor() ([]byte, []int)
Deprecated: Use GetCommentReply.ProtoReflect.Descriptor instead.
func (*GetCommentReply) GetComment ¶
func (x *GetCommentReply) GetComment() []*Comment
func (*GetCommentReply) ProtoMessage ¶
func (*GetCommentReply) ProtoMessage()
func (*GetCommentReply) ProtoReflect ¶
func (x *GetCommentReply) ProtoReflect() protoreflect.Message
func (*GetCommentReply) Reset ¶
func (x *GetCommentReply) Reset()
func (*GetCommentReply) String ¶
func (x *GetCommentReply) String() string
type GetCommentRequest ¶
type GetCommentRequest struct { ArticleId int64 `protobuf:"varint,1,opt,name=article_id,json=articleId,proto3" json:"article_id,omitempty"` // contains filtered or unexported fields }
func (*GetCommentRequest) Descriptor
deprecated
func (*GetCommentRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetCommentRequest.ProtoReflect.Descriptor instead.
func (*GetCommentRequest) GetArticleId ¶
func (x *GetCommentRequest) GetArticleId() int64
func (*GetCommentRequest) ProtoMessage ¶
func (*GetCommentRequest) ProtoMessage()
func (*GetCommentRequest) ProtoReflect ¶
func (x *GetCommentRequest) ProtoReflect() protoreflect.Message
func (*GetCommentRequest) Reset ¶
func (x *GetCommentRequest) Reset()
func (*GetCommentRequest) String ¶
func (x *GetCommentRequest) String() string
type ListArticleReply ¶
type ListArticleReply struct { Results []*Article `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` // contains filtered or unexported fields }
func (*ListArticleReply) Descriptor
deprecated
func (*ListArticleReply) Descriptor() ([]byte, []int)
Deprecated: Use ListArticleReply.ProtoReflect.Descriptor instead.
func (*ListArticleReply) GetResults ¶
func (x *ListArticleReply) GetResults() []*Article
func (*ListArticleReply) ProtoMessage ¶
func (*ListArticleReply) ProtoMessage()
func (*ListArticleReply) ProtoReflect ¶
func (x *ListArticleReply) ProtoReflect() protoreflect.Message
func (*ListArticleReply) Reset ¶
func (x *ListArticleReply) Reset()
func (*ListArticleReply) String ¶
func (x *ListArticleReply) String() string
type ListArticleRequest ¶
type ListArticleRequest struct {
// contains filtered or unexported fields
}
func (*ListArticleRequest) Descriptor
deprecated
func (*ListArticleRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListArticleRequest.ProtoReflect.Descriptor instead.
func (*ListArticleRequest) ProtoMessage ¶
func (*ListArticleRequest) ProtoMessage()
func (*ListArticleRequest) ProtoReflect ¶
func (x *ListArticleRequest) ProtoReflect() protoreflect.Message
func (*ListArticleRequest) Reset ¶
func (x *ListArticleRequest) Reset()
func (*ListArticleRequest) String ¶
func (x *ListArticleRequest) String() string
type NewsClient ¶
type NewsClient interface { CreateArticle(ctx context.Context, in *CreateArticleRequest, opts ...grpc.CallOption) (*CreateArticleReply, error) UpdateArticle(ctx context.Context, in *UpdateArticleRequest, opts ...grpc.CallOption) (*UpdateArticleReply, error) DeleteArticle(ctx context.Context, in *DeleteArticleRequest, opts ...grpc.CallOption) (*DeleteArticleReply, error) GetArticle(ctx context.Context, in *GetArticleRequest, opts ...grpc.CallOption) (*GetArticleReply, error) ListArticle(ctx context.Context, in *ListArticleRequest, opts ...grpc.CallOption) (*ListArticleReply, error) AddComment(ctx context.Context, in *AddCommentRequest, opts ...grpc.CallOption) (*AddCommentReply, error) GetComments(ctx context.Context, in *GetCommentRequest, opts ...grpc.CallOption) (*GetCommentReply, error) DeleteComment(ctx context.Context, in *DeleteCommentRequest, opts ...grpc.CallOption) (*DeleteCommentReply, error) }
NewsClient is the client API for News 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 NewNewsClient ¶
func NewNewsClient(cc grpc.ClientConnInterface) NewsClient
type NewsErrorReason ¶
type NewsErrorReason int32
const ( NewsErrorReason_GREETER_UNSPECIFIED NewsErrorReason = 0 NewsErrorReason_NEWS_NOT_FOUND NewsErrorReason = 1 )
func (NewsErrorReason) Descriptor ¶
func (NewsErrorReason) Descriptor() protoreflect.EnumDescriptor
func (NewsErrorReason) Enum ¶
func (x NewsErrorReason) Enum() *NewsErrorReason
func (NewsErrorReason) EnumDescriptor
deprecated
func (NewsErrorReason) EnumDescriptor() ([]byte, []int)
Deprecated: Use NewsErrorReason.Descriptor instead.
func (NewsErrorReason) Number ¶
func (x NewsErrorReason) Number() protoreflect.EnumNumber
func (NewsErrorReason) String ¶
func (x NewsErrorReason) String() string
func (NewsErrorReason) Type ¶
func (NewsErrorReason) Type() protoreflect.EnumType
type NewsHTTPClient ¶
type NewsHTTPClient interface { AddComment(ctx context.Context, req *AddCommentRequest, opts ...http.CallOption) (rsp *AddCommentReply, err error) CreateArticle(ctx context.Context, req *CreateArticleRequest, opts ...http.CallOption) (rsp *CreateArticleReply, err error) DeleteArticle(ctx context.Context, req *DeleteArticleRequest, opts ...http.CallOption) (rsp *DeleteArticleReply, err error) DeleteComment(ctx context.Context, req *DeleteCommentRequest, opts ...http.CallOption) (rsp *DeleteCommentReply, err error) GetArticle(ctx context.Context, req *GetArticleRequest, opts ...http.CallOption) (rsp *GetArticleReply, err error) GetComments(ctx context.Context, req *GetCommentRequest, opts ...http.CallOption) (rsp *GetCommentReply, err error) ListArticle(ctx context.Context, req *ListArticleRequest, opts ...http.CallOption) (rsp *ListArticleReply, err error) UpdateArticle(ctx context.Context, req *UpdateArticleRequest, opts ...http.CallOption) (rsp *UpdateArticleReply, err error) }
func NewNewsHTTPClient ¶
func NewNewsHTTPClient(client *http.Client) NewsHTTPClient
type NewsHTTPClientImpl ¶
type NewsHTTPClientImpl struct {
// contains filtered or unexported fields
}
func (*NewsHTTPClientImpl) AddComment ¶
func (c *NewsHTTPClientImpl) AddComment(ctx context.Context, in *AddCommentRequest, opts ...http.CallOption) (*AddCommentReply, error)
func (*NewsHTTPClientImpl) CreateArticle ¶
func (c *NewsHTTPClientImpl) CreateArticle(ctx context.Context, in *CreateArticleRequest, opts ...http.CallOption) (*CreateArticleReply, error)
func (*NewsHTTPClientImpl) DeleteArticle ¶
func (c *NewsHTTPClientImpl) DeleteArticle(ctx context.Context, in *DeleteArticleRequest, opts ...http.CallOption) (*DeleteArticleReply, error)
func (*NewsHTTPClientImpl) DeleteComment ¶
func (c *NewsHTTPClientImpl) DeleteComment(ctx context.Context, in *DeleteCommentRequest, opts ...http.CallOption) (*DeleteCommentReply, error)
func (*NewsHTTPClientImpl) GetArticle ¶
func (c *NewsHTTPClientImpl) GetArticle(ctx context.Context, in *GetArticleRequest, opts ...http.CallOption) (*GetArticleReply, error)
func (*NewsHTTPClientImpl) GetComments ¶
func (c *NewsHTTPClientImpl) GetComments(ctx context.Context, in *GetCommentRequest, opts ...http.CallOption) (*GetCommentReply, error)
func (*NewsHTTPClientImpl) ListArticle ¶
func (c *NewsHTTPClientImpl) ListArticle(ctx context.Context, in *ListArticleRequest, opts ...http.CallOption) (*ListArticleReply, error)
func (*NewsHTTPClientImpl) UpdateArticle ¶
func (c *NewsHTTPClientImpl) UpdateArticle(ctx context.Context, in *UpdateArticleRequest, opts ...http.CallOption) (*UpdateArticleReply, error)
type NewsHTTPServer ¶
type NewsHTTPServer interface { AddComment(context.Context, *AddCommentRequest) (*AddCommentReply, error) CreateArticle(context.Context, *CreateArticleRequest) (*CreateArticleReply, error) DeleteArticle(context.Context, *DeleteArticleRequest) (*DeleteArticleReply, error) DeleteComment(context.Context, *DeleteCommentRequest) (*DeleteCommentReply, error) GetArticle(context.Context, *GetArticleRequest) (*GetArticleReply, error) GetComments(context.Context, *GetCommentRequest) (*GetCommentReply, error) ListArticle(context.Context, *ListArticleRequest) (*ListArticleReply, error) UpdateArticle(context.Context, *UpdateArticleRequest) (*UpdateArticleReply, error) }
type NewsServer ¶
type NewsServer interface { CreateArticle(context.Context, *CreateArticleRequest) (*CreateArticleReply, error) UpdateArticle(context.Context, *UpdateArticleRequest) (*UpdateArticleReply, error) DeleteArticle(context.Context, *DeleteArticleRequest) (*DeleteArticleReply, error) GetArticle(context.Context, *GetArticleRequest) (*GetArticleReply, error) ListArticle(context.Context, *ListArticleRequest) (*ListArticleReply, error) AddComment(context.Context, *AddCommentRequest) (*AddCommentReply, error) GetComments(context.Context, *GetCommentRequest) (*GetCommentReply, error) DeleteComment(context.Context, *DeleteCommentRequest) (*DeleteCommentReply, error) // contains filtered or unexported methods }
NewsServer is the server API for News service. All implementations must embed UnimplementedNewsServer for forward compatibility
type UnimplementedNewsServer ¶
type UnimplementedNewsServer struct { }
UnimplementedNewsServer must be embedded to have forward compatible implementations.
func (UnimplementedNewsServer) AddComment ¶
func (UnimplementedNewsServer) AddComment(context.Context, *AddCommentRequest) (*AddCommentReply, error)
func (UnimplementedNewsServer) CreateArticle ¶
func (UnimplementedNewsServer) CreateArticle(context.Context, *CreateArticleRequest) (*CreateArticleReply, error)
func (UnimplementedNewsServer) DeleteArticle ¶
func (UnimplementedNewsServer) DeleteArticle(context.Context, *DeleteArticleRequest) (*DeleteArticleReply, error)
func (UnimplementedNewsServer) DeleteComment ¶
func (UnimplementedNewsServer) DeleteComment(context.Context, *DeleteCommentRequest) (*DeleteCommentReply, error)
func (UnimplementedNewsServer) GetArticle ¶
func (UnimplementedNewsServer) GetArticle(context.Context, *GetArticleRequest) (*GetArticleReply, error)
func (UnimplementedNewsServer) GetComments ¶
func (UnimplementedNewsServer) GetComments(context.Context, *GetCommentRequest) (*GetCommentReply, error)
func (UnimplementedNewsServer) ListArticle ¶
func (UnimplementedNewsServer) ListArticle(context.Context, *ListArticleRequest) (*ListArticleReply, error)
func (UnimplementedNewsServer) UpdateArticle ¶
func (UnimplementedNewsServer) UpdateArticle(context.Context, *UpdateArticleRequest) (*UpdateArticleReply, error)
type UnsafeNewsServer ¶
type UnsafeNewsServer interface {
// contains filtered or unexported methods
}
UnsafeNewsServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to NewsServer will result in compilation errors.
type UpdateArticleReply ¶
type UpdateArticleReply struct { Article *Article `protobuf:"bytes,1,opt,name=Article,proto3" json:"Article,omitempty"` // contains filtered or unexported fields }
func (*UpdateArticleReply) Descriptor
deprecated
func (*UpdateArticleReply) Descriptor() ([]byte, []int)
Deprecated: Use UpdateArticleReply.ProtoReflect.Descriptor instead.
func (*UpdateArticleReply) GetArticle ¶
func (x *UpdateArticleReply) GetArticle() *Article
func (*UpdateArticleReply) ProtoMessage ¶
func (*UpdateArticleReply) ProtoMessage()
func (*UpdateArticleReply) ProtoReflect ¶
func (x *UpdateArticleReply) ProtoReflect() protoreflect.Message
func (*UpdateArticleReply) Reset ¶
func (x *UpdateArticleReply) Reset()
func (*UpdateArticleReply) String ¶
func (x *UpdateArticleReply) String() string
type UpdateArticleRequest ¶
type UpdateArticleRequest 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"` // the title of string must be between 5 and 50 character; Content string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"` // contains filtered or unexported fields }
func (*UpdateArticleRequest) Descriptor
deprecated
func (*UpdateArticleRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdateArticleRequest.ProtoReflect.Descriptor instead.
func (*UpdateArticleRequest) GetContent ¶
func (x *UpdateArticleRequest) GetContent() string
func (*UpdateArticleRequest) GetId ¶
func (x *UpdateArticleRequest) GetId() int64
func (*UpdateArticleRequest) GetTitle ¶
func (x *UpdateArticleRequest) GetTitle() string
func (*UpdateArticleRequest) ProtoMessage ¶
func (*UpdateArticleRequest) ProtoMessage()
func (*UpdateArticleRequest) ProtoReflect ¶
func (x *UpdateArticleRequest) ProtoReflect() protoreflect.Message
func (*UpdateArticleRequest) Reset ¶
func (x *UpdateArticleRequest) Reset()
func (*UpdateArticleRequest) String ¶
func (x *UpdateArticleRequest) String() string