Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterArticleServer(s grpc.ServiceRegistrar, srv ArticleServer)
- type ArticleClient
- type ArticleDeleteRequest
- func (*ArticleDeleteRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ArticleDeleteRequest) GetArticleId() int64
- func (x *ArticleDeleteRequest) GetUserId() int64
- func (*ArticleDeleteRequest) ProtoMessage()
- func (x *ArticleDeleteRequest) ProtoReflect() protoreflect.Message
- func (x *ArticleDeleteRequest) Reset()
- func (x *ArticleDeleteRequest) String() string
- type ArticleDeleteResponse
- type ArticleDetailRequest
- func (*ArticleDetailRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ArticleDetailRequest) GetArticleId() int64
- func (*ArticleDetailRequest) ProtoMessage()
- func (x *ArticleDetailRequest) ProtoReflect() protoreflect.Message
- func (x *ArticleDetailRequest) Reset()
- func (x *ArticleDetailRequest) String() string
- type ArticleDetailResponse
- func (*ArticleDetailResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ArticleDetailResponse) GetArticle() *ArticleItem
- func (*ArticleDetailResponse) ProtoMessage()
- func (x *ArticleDetailResponse) ProtoReflect() protoreflect.Message
- func (x *ArticleDetailResponse) Reset()
- func (x *ArticleDetailResponse) String() string
- type ArticleItem
- func (*ArticleItem) Descriptor() ([]byte, []int)deprecated
- func (x *ArticleItem) GetAuthorId() int64
- func (x *ArticleItem) GetCommentCount() int64
- func (x *ArticleItem) GetContent() string
- func (x *ArticleItem) GetCover() string
- func (x *ArticleItem) GetDescription() string
- func (x *ArticleItem) GetId() int64
- func (x *ArticleItem) GetLikeCount() int64
- func (x *ArticleItem) GetPublishTime() int64
- func (x *ArticleItem) GetTitle() string
- func (*ArticleItem) ProtoMessage()
- func (x *ArticleItem) ProtoReflect() protoreflect.Message
- func (x *ArticleItem) Reset()
- func (x *ArticleItem) String() string
- type ArticleServer
- type ArticlesRequest
- func (*ArticlesRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ArticlesRequest) GetArticleId() int64
- func (x *ArticlesRequest) GetCursor() int64
- func (x *ArticlesRequest) GetPageSize() int64
- func (x *ArticlesRequest) GetSortType() int32
- func (x *ArticlesRequest) GetUserId() int64
- func (*ArticlesRequest) ProtoMessage()
- func (x *ArticlesRequest) ProtoReflect() protoreflect.Message
- func (x *ArticlesRequest) Reset()
- func (x *ArticlesRequest) String() string
- type ArticlesResponse
- func (*ArticlesResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ArticlesResponse) GetArticleId() int64
- func (x *ArticlesResponse) GetArticles() []*ArticleItem
- func (x *ArticlesResponse) GetCursor() int64
- func (x *ArticlesResponse) GetIsEnd() bool
- func (*ArticlesResponse) ProtoMessage()
- func (x *ArticlesResponse) ProtoReflect() protoreflect.Message
- func (x *ArticlesResponse) Reset()
- func (x *ArticlesResponse) String() string
- type PublishRequest
- func (*PublishRequest) Descriptor() ([]byte, []int)deprecated
- func (x *PublishRequest) GetContent() string
- func (x *PublishRequest) GetCover() string
- func (x *PublishRequest) GetDescription() string
- func (x *PublishRequest) GetTitle() string
- func (x *PublishRequest) GetUserId() int64
- func (*PublishRequest) ProtoMessage()
- func (x *PublishRequest) ProtoReflect() protoreflect.Message
- func (x *PublishRequest) Reset()
- func (x *PublishRequest) String() string
- type PublishResponse
- type UnimplementedArticleServer
- func (UnimplementedArticleServer) ArticleDelete(context.Context, *ArticleDeleteRequest) (*ArticleDeleteResponse, error)
- func (UnimplementedArticleServer) ArticleDetail(context.Context, *ArticleDetailRequest) (*ArticleDetailResponse, error)
- func (UnimplementedArticleServer) Articles(context.Context, *ArticlesRequest) (*ArticlesResponse, error)
- func (UnimplementedArticleServer) Publish(context.Context, *PublishRequest) (*PublishResponse, error)
- type UnsafeArticleServer
Constants ¶
const ( Article_Publish_FullMethodName = "/pb.Article/Publish" Article_Articles_FullMethodName = "/pb.Article/Articles" Article_ArticleDelete_FullMethodName = "/pb.Article/ArticleDelete" Article_ArticleDetail_FullMethodName = "/pb.Article/ArticleDetail" )
Variables ¶
var Article_ServiceDesc = grpc.ServiceDesc{ ServiceName: "pb.Article", HandlerType: (*ArticleServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Publish", Handler: _Article_Publish_Handler, }, { MethodName: "Articles", Handler: _Article_Articles_Handler, }, { MethodName: "ArticleDelete", Handler: _Article_ArticleDelete_Handler, }, { MethodName: "ArticleDetail", Handler: _Article_ArticleDetail_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "article.proto", }
Article_ServiceDesc is the grpc.ServiceDesc for Article service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_article_proto protoreflect.FileDescriptor
Functions ¶
func RegisterArticleServer ¶
func RegisterArticleServer(s grpc.ServiceRegistrar, srv ArticleServer)
Types ¶
type ArticleClient ¶
type ArticleClient interface { Publish(ctx context.Context, in *PublishRequest, opts ...grpc.CallOption) (*PublishResponse, error) Articles(ctx context.Context, in *ArticlesRequest, opts ...grpc.CallOption) (*ArticlesResponse, error) ArticleDelete(ctx context.Context, in *ArticleDeleteRequest, opts ...grpc.CallOption) (*ArticleDeleteResponse, error) ArticleDetail(ctx context.Context, in *ArticleDetailRequest, opts ...grpc.CallOption) (*ArticleDetailResponse, error) }
ArticleClient is the client API for Article 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 NewArticleClient ¶
func NewArticleClient(cc grpc.ClientConnInterface) ArticleClient
type ArticleDeleteRequest ¶
type ArticleDeleteRequest struct { UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` ArticleId int64 `protobuf:"varint,2,opt,name=articleId,proto3" json:"articleId,omitempty"` // contains filtered or unexported fields }
func (*ArticleDeleteRequest) Descriptor
deprecated
func (*ArticleDeleteRequest) Descriptor() ([]byte, []int)
Deprecated: Use ArticleDeleteRequest.ProtoReflect.Descriptor instead.
func (*ArticleDeleteRequest) GetArticleId ¶
func (x *ArticleDeleteRequest) GetArticleId() int64
func (*ArticleDeleteRequest) GetUserId ¶
func (x *ArticleDeleteRequest) GetUserId() int64
func (*ArticleDeleteRequest) ProtoMessage ¶
func (*ArticleDeleteRequest) ProtoMessage()
func (*ArticleDeleteRequest) ProtoReflect ¶
func (x *ArticleDeleteRequest) ProtoReflect() protoreflect.Message
func (*ArticleDeleteRequest) Reset ¶
func (x *ArticleDeleteRequest) Reset()
func (*ArticleDeleteRequest) String ¶
func (x *ArticleDeleteRequest) String() string
type ArticleDeleteResponse ¶
type ArticleDeleteResponse struct {
// contains filtered or unexported fields
}
func (*ArticleDeleteResponse) Descriptor
deprecated
func (*ArticleDeleteResponse) Descriptor() ([]byte, []int)
Deprecated: Use ArticleDeleteResponse.ProtoReflect.Descriptor instead.
func (*ArticleDeleteResponse) ProtoMessage ¶
func (*ArticleDeleteResponse) ProtoMessage()
func (*ArticleDeleteResponse) ProtoReflect ¶
func (x *ArticleDeleteResponse) ProtoReflect() protoreflect.Message
func (*ArticleDeleteResponse) Reset ¶
func (x *ArticleDeleteResponse) Reset()
func (*ArticleDeleteResponse) String ¶
func (x *ArticleDeleteResponse) String() string
type ArticleDetailRequest ¶
type ArticleDetailRequest struct { ArticleId int64 `protobuf:"varint,1,opt,name=articleId,proto3" json:"articleId,omitempty"` // contains filtered or unexported fields }
func (*ArticleDetailRequest) Descriptor
deprecated
func (*ArticleDetailRequest) Descriptor() ([]byte, []int)
Deprecated: Use ArticleDetailRequest.ProtoReflect.Descriptor instead.
func (*ArticleDetailRequest) GetArticleId ¶
func (x *ArticleDetailRequest) GetArticleId() int64
func (*ArticleDetailRequest) ProtoMessage ¶
func (*ArticleDetailRequest) ProtoMessage()
func (*ArticleDetailRequest) ProtoReflect ¶
func (x *ArticleDetailRequest) ProtoReflect() protoreflect.Message
func (*ArticleDetailRequest) Reset ¶
func (x *ArticleDetailRequest) Reset()
func (*ArticleDetailRequest) String ¶
func (x *ArticleDetailRequest) String() string
type ArticleDetailResponse ¶
type ArticleDetailResponse struct { Article *ArticleItem `protobuf:"bytes,1,opt,name=article,proto3" json:"article,omitempty"` // contains filtered or unexported fields }
func (*ArticleDetailResponse) Descriptor
deprecated
func (*ArticleDetailResponse) Descriptor() ([]byte, []int)
Deprecated: Use ArticleDetailResponse.ProtoReflect.Descriptor instead.
func (*ArticleDetailResponse) GetArticle ¶
func (x *ArticleDetailResponse) GetArticle() *ArticleItem
func (*ArticleDetailResponse) ProtoMessage ¶
func (*ArticleDetailResponse) ProtoMessage()
func (*ArticleDetailResponse) ProtoReflect ¶
func (x *ArticleDetailResponse) ProtoReflect() protoreflect.Message
func (*ArticleDetailResponse) Reset ¶
func (x *ArticleDetailResponse) Reset()
func (*ArticleDetailResponse) String ¶
func (x *ArticleDetailResponse) String() string
type ArticleItem ¶
type ArticleItem 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"` Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` Cover string `protobuf:"bytes,5,opt,name=cover,proto3" json:"cover,omitempty"` CommentCount int64 `protobuf:"varint,6,opt,name=commentCount,proto3" json:"commentCount,omitempty"` LikeCount int64 `protobuf:"varint,7,opt,name=likeCount,proto3" json:"likeCount,omitempty"` PublishTime int64 `protobuf:"varint,8,opt,name=publishTime,proto3" json:"publishTime,omitempty"` AuthorId int64 `protobuf:"varint,9,opt,name=authorId,proto3" json:"authorId,omitempty"` // contains filtered or unexported fields }
func (*ArticleItem) Descriptor
deprecated
func (*ArticleItem) Descriptor() ([]byte, []int)
Deprecated: Use ArticleItem.ProtoReflect.Descriptor instead.
func (*ArticleItem) GetAuthorId ¶
func (x *ArticleItem) GetAuthorId() int64
func (*ArticleItem) GetCommentCount ¶
func (x *ArticleItem) GetCommentCount() int64
func (*ArticleItem) GetContent ¶
func (x *ArticleItem) GetContent() string
func (*ArticleItem) GetCover ¶
func (x *ArticleItem) GetCover() string
func (*ArticleItem) GetDescription ¶
func (x *ArticleItem) GetDescription() string
func (*ArticleItem) GetId ¶
func (x *ArticleItem) GetId() int64
func (*ArticleItem) GetLikeCount ¶
func (x *ArticleItem) GetLikeCount() int64
func (*ArticleItem) GetPublishTime ¶
func (x *ArticleItem) GetPublishTime() int64
func (*ArticleItem) GetTitle ¶
func (x *ArticleItem) GetTitle() string
func (*ArticleItem) ProtoMessage ¶
func (*ArticleItem) ProtoMessage()
func (*ArticleItem) ProtoReflect ¶
func (x *ArticleItem) ProtoReflect() protoreflect.Message
func (*ArticleItem) Reset ¶
func (x *ArticleItem) Reset()
func (*ArticleItem) String ¶
func (x *ArticleItem) String() string
type ArticleServer ¶
type ArticleServer interface { Publish(context.Context, *PublishRequest) (*PublishResponse, error) Articles(context.Context, *ArticlesRequest) (*ArticlesResponse, error) ArticleDelete(context.Context, *ArticleDeleteRequest) (*ArticleDeleteResponse, error) ArticleDetail(context.Context, *ArticleDetailRequest) (*ArticleDetailResponse, error) // contains filtered or unexported methods }
ArticleServer is the server API for Article service. All implementations must embed UnimplementedArticleServer for forward compatibility
type ArticlesRequest ¶
type ArticlesRequest struct { UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` Cursor int64 `protobuf:"varint,2,opt,name=cursor,proto3" json:"cursor,omitempty"` PageSize int64 `protobuf:"varint,3,opt,name=pageSize,proto3" json:"pageSize,omitempty"` SortType int32 `protobuf:"varint,4,opt,name=sortType,proto3" json:"sortType,omitempty"` ArticleId int64 `protobuf:"varint,5,opt,name=articleId,proto3" json:"articleId,omitempty"` // contains filtered or unexported fields }
func (*ArticlesRequest) Descriptor
deprecated
func (*ArticlesRequest) Descriptor() ([]byte, []int)
Deprecated: Use ArticlesRequest.ProtoReflect.Descriptor instead.
func (*ArticlesRequest) GetArticleId ¶
func (x *ArticlesRequest) GetArticleId() int64
func (*ArticlesRequest) GetCursor ¶
func (x *ArticlesRequest) GetCursor() int64
func (*ArticlesRequest) GetPageSize ¶
func (x *ArticlesRequest) GetPageSize() int64
func (*ArticlesRequest) GetSortType ¶
func (x *ArticlesRequest) GetSortType() int32
func (*ArticlesRequest) GetUserId ¶
func (x *ArticlesRequest) GetUserId() int64
func (*ArticlesRequest) ProtoMessage ¶
func (*ArticlesRequest) ProtoMessage()
func (*ArticlesRequest) ProtoReflect ¶
func (x *ArticlesRequest) ProtoReflect() protoreflect.Message
func (*ArticlesRequest) Reset ¶
func (x *ArticlesRequest) Reset()
func (*ArticlesRequest) String ¶
func (x *ArticlesRequest) String() string
type ArticlesResponse ¶
type ArticlesResponse struct { Articles []*ArticleItem `protobuf:"bytes,1,rep,name=articles,proto3" json:"articles,omitempty"` IsEnd bool `protobuf:"varint,2,opt,name=isEnd,proto3" json:"isEnd,omitempty"` Cursor int64 `protobuf:"varint,3,opt,name=cursor,proto3" json:"cursor,omitempty"` //游标,当前页的最后一条 ArticleId int64 `protobuf:"varint,4,opt,name=articleId,proto3" json:"articleId,omitempty"` //去重,当 cursor 相同时进行去重,避免数据重复 // contains filtered or unexported fields }
func (*ArticlesResponse) Descriptor
deprecated
func (*ArticlesResponse) Descriptor() ([]byte, []int)
Deprecated: Use ArticlesResponse.ProtoReflect.Descriptor instead.
func (*ArticlesResponse) GetArticleId ¶
func (x *ArticlesResponse) GetArticleId() int64
func (*ArticlesResponse) GetArticles ¶
func (x *ArticlesResponse) GetArticles() []*ArticleItem
func (*ArticlesResponse) GetCursor ¶
func (x *ArticlesResponse) GetCursor() int64
func (*ArticlesResponse) GetIsEnd ¶
func (x *ArticlesResponse) GetIsEnd() bool
func (*ArticlesResponse) ProtoMessage ¶
func (*ArticlesResponse) ProtoMessage()
func (*ArticlesResponse) ProtoReflect ¶
func (x *ArticlesResponse) ProtoReflect() protoreflect.Message
func (*ArticlesResponse) Reset ¶
func (x *ArticlesResponse) Reset()
func (*ArticlesResponse) String ¶
func (x *ArticlesResponse) String() string
type PublishRequest ¶
type PublishRequest struct { UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,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"` Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` Cover string `protobuf:"bytes,5,opt,name=cover,proto3" json:"cover,omitempty"` // contains filtered or unexported fields }
func (*PublishRequest) Descriptor
deprecated
func (*PublishRequest) Descriptor() ([]byte, []int)
Deprecated: Use PublishRequest.ProtoReflect.Descriptor instead.
func (*PublishRequest) GetContent ¶
func (x *PublishRequest) GetContent() string
func (*PublishRequest) GetCover ¶
func (x *PublishRequest) GetCover() string
func (*PublishRequest) GetDescription ¶
func (x *PublishRequest) GetDescription() string
func (*PublishRequest) GetTitle ¶
func (x *PublishRequest) GetTitle() string
func (*PublishRequest) GetUserId ¶
func (x *PublishRequest) GetUserId() int64
func (*PublishRequest) ProtoMessage ¶
func (*PublishRequest) ProtoMessage()
func (*PublishRequest) ProtoReflect ¶
func (x *PublishRequest) ProtoReflect() protoreflect.Message
func (*PublishRequest) Reset ¶
func (x *PublishRequest) Reset()
func (*PublishRequest) String ¶
func (x *PublishRequest) String() string
type PublishResponse ¶
type PublishResponse struct { ArticleId int64 `protobuf:"varint,1,opt,name=articleId,proto3" json:"articleId,omitempty"` // contains filtered or unexported fields }
func (*PublishResponse) Descriptor
deprecated
func (*PublishResponse) Descriptor() ([]byte, []int)
Deprecated: Use PublishResponse.ProtoReflect.Descriptor instead.
func (*PublishResponse) GetArticleId ¶
func (x *PublishResponse) GetArticleId() int64
func (*PublishResponse) ProtoMessage ¶
func (*PublishResponse) ProtoMessage()
func (*PublishResponse) ProtoReflect ¶
func (x *PublishResponse) ProtoReflect() protoreflect.Message
func (*PublishResponse) Reset ¶
func (x *PublishResponse) Reset()
func (*PublishResponse) String ¶
func (x *PublishResponse) String() string
type UnimplementedArticleServer ¶
type UnimplementedArticleServer struct { }
UnimplementedArticleServer must be embedded to have forward compatible implementations.
func (UnimplementedArticleServer) ArticleDelete ¶
func (UnimplementedArticleServer) ArticleDelete(context.Context, *ArticleDeleteRequest) (*ArticleDeleteResponse, error)
func (UnimplementedArticleServer) ArticleDetail ¶
func (UnimplementedArticleServer) ArticleDetail(context.Context, *ArticleDetailRequest) (*ArticleDetailResponse, error)
func (UnimplementedArticleServer) Articles ¶
func (UnimplementedArticleServer) Articles(context.Context, *ArticlesRequest) (*ArticlesResponse, error)
func (UnimplementedArticleServer) Publish ¶
func (UnimplementedArticleServer) Publish(context.Context, *PublishRequest) (*PublishResponse, error)
type UnsafeArticleServer ¶
type UnsafeArticleServer interface {
// contains filtered or unexported methods
}
UnsafeArticleServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ArticleServer will result in compilation errors.