Documentation
¶
Index ¶
- Variables
- func RegisterCommentsHandler(s server.Server, hdlr CommentsHandler, opts ...server.HandlerOption) error
- type Comment
- func (*Comment) Descriptor() ([]byte, []int)deprecated
- func (x *Comment) GetAuthorId() string
- func (x *Comment) GetAuthorName() string
- func (x *Comment) GetContent() string
- func (x *Comment) GetContentHtml() string
- func (x *Comment) GetCreatedAt() int64
- func (x *Comment) GetId() string
- func (x *Comment) GetLinkPreview() *LinkPreview
- func (x *Comment) GetPostId() string
- func (*Comment) ProtoMessage()
- func (x *Comment) ProtoReflect() protoreflect.Message
- func (x *Comment) Reset()
- func (x *Comment) String() string
- type CommentsHandler
- type CommentsService
- type CreateRequest
- func (*CreateRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateRequest) GetAuthorId() string
- func (x *CreateRequest) GetAuthorName() string
- func (x *CreateRequest) GetContent() string
- func (x *CreateRequest) GetPostId() string
- func (*CreateRequest) ProtoMessage()
- func (x *CreateRequest) ProtoReflect() protoreflect.Message
- func (x *CreateRequest) Reset()
- func (x *CreateRequest) String() string
- type CreateResponse
- type DeleteRequest
- type DeleteResponse
- type LinkPreview
- func (*LinkPreview) Descriptor() ([]byte, []int)deprecated
- func (x *LinkPreview) GetDescription() string
- func (x *LinkPreview) GetImage() string
- func (x *LinkPreview) GetTitle() string
- func (x *LinkPreview) GetUrl() string
- func (*LinkPreview) ProtoMessage()
- func (x *LinkPreview) ProtoReflect() protoreflect.Message
- func (x *LinkPreview) Reset()
- func (x *LinkPreview) String() string
- type ListRequest
- func (*ListRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ListRequest) GetAuthorId() string
- func (x *ListRequest) GetLimit() int32
- func (x *ListRequest) GetPage() int32
- func (x *ListRequest) GetPostId() string
- func (*ListRequest) ProtoMessage()
- func (x *ListRequest) ProtoReflect() protoreflect.Message
- func (x *ListRequest) Reset()
- func (x *ListRequest) String() string
- type ListResponse
- func (*ListResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListResponse) GetComments() []*Comment
- func (x *ListResponse) GetTotal() int32
- func (*ListResponse) ProtoMessage()
- func (x *ListResponse) ProtoReflect() protoreflect.Message
- func (x *ListResponse) Reset()
- func (x *ListResponse) String() string
- type ReadRequest
- type ReadResponse
- type UpdateRequest
- func (*UpdateRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateRequest) GetContent() string
- func (x *UpdateRequest) GetId() string
- func (x *UpdateRequest) GetPostId() string
- func (x *UpdateRequest) GetUserId() string
- func (*UpdateRequest) ProtoMessage()
- func (x *UpdateRequest) ProtoReflect() protoreflect.Message
- func (x *UpdateRequest) Reset()
- func (x *UpdateRequest) String() string
- type UpdateResponse
Constants ¶
This section is empty.
Variables ¶
var File_comments_proto_comments_proto protoreflect.FileDescriptor
Functions ¶
func RegisterCommentsHandler ¶
func RegisterCommentsHandler(s server.Server, hdlr CommentsHandler, opts ...server.HandlerOption) error
Types ¶
type Comment ¶
type Comment struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
AuthorId string `protobuf:"bytes,3,opt,name=author_id,json=authorId,proto3" json:"author_id,omitempty"`
AuthorName string `protobuf:"bytes,4,opt,name=author_name,json=authorName,proto3" json:"author_name,omitempty"`
PostId string `protobuf:"bytes,5,opt,name=post_id,json=postId,proto3" json:"post_id,omitempty"`
CreatedAt int64 `protobuf:"varint,6,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
LinkPreview *LinkPreview `protobuf:"bytes,7,opt,name=link_preview,json=linkPreview,proto3" json:"link_preview,omitempty"`
ContentHtml string `protobuf:"bytes,8,opt,name=content_html,json=contentHtml,proto3" json:"content_html,omitempty"` // Pre-rendered HTML from markdown
// contains filtered or unexported fields
}
func (*Comment) Descriptor
deprecated
func (*Comment) GetAuthorId ¶
func (*Comment) GetAuthorName ¶
func (*Comment) GetContent ¶
func (*Comment) GetContentHtml ¶ added in v0.2.0
func (*Comment) GetCreatedAt ¶
func (*Comment) GetLinkPreview ¶
func (x *Comment) GetLinkPreview() *LinkPreview
func (*Comment) ProtoMessage ¶
func (*Comment) ProtoMessage()
func (*Comment) ProtoReflect ¶
func (x *Comment) ProtoReflect() protoreflect.Message
type CommentsHandler ¶
type CommentsHandler interface {
Create(context.Context, *CreateRequest, *CreateResponse) error
Read(context.Context, *ReadRequest, *ReadResponse) error
Delete(context.Context, *DeleteRequest, *DeleteResponse) error
List(context.Context, *ListRequest, *ListResponse) error
Update(context.Context, *UpdateRequest, *UpdateResponse) error
}
type CommentsService ¶
type CommentsService interface {
Create(ctx context.Context, in *CreateRequest, opts ...client.CallOption) (*CreateResponse, error)
Read(ctx context.Context, in *ReadRequest, opts ...client.CallOption) (*ReadResponse, error)
Delete(ctx context.Context, in *DeleteRequest, opts ...client.CallOption) (*DeleteResponse, error)
List(ctx context.Context, in *ListRequest, opts ...client.CallOption) (*ListResponse, error)
Update(ctx context.Context, in *UpdateRequest, opts ...client.CallOption) (*UpdateResponse, error)
}
func NewCommentsService ¶
func NewCommentsService(name string, c client.Client) CommentsService
type CreateRequest ¶
type CreateRequest struct {
Content string `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"`
AuthorId string `protobuf:"bytes,2,opt,name=author_id,json=authorId,proto3" json:"author_id,omitempty"`
AuthorName string `protobuf:"bytes,3,opt,name=author_name,json=authorName,proto3" json:"author_name,omitempty"`
PostId string `protobuf:"bytes,4,opt,name=post_id,json=postId,proto3" json:"post_id,omitempty"`
// contains filtered or unexported fields
}
func (*CreateRequest) Descriptor
deprecated
func (*CreateRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateRequest.ProtoReflect.Descriptor instead.
func (*CreateRequest) GetAuthorId ¶
func (x *CreateRequest) GetAuthorId() string
func (*CreateRequest) GetAuthorName ¶
func (x *CreateRequest) GetAuthorName() string
func (*CreateRequest) GetContent ¶
func (x *CreateRequest) GetContent() string
func (*CreateRequest) GetPostId ¶
func (x *CreateRequest) GetPostId() string
func (*CreateRequest) ProtoMessage ¶
func (*CreateRequest) ProtoMessage()
func (*CreateRequest) ProtoReflect ¶
func (x *CreateRequest) ProtoReflect() protoreflect.Message
func (*CreateRequest) Reset ¶
func (x *CreateRequest) Reset()
func (*CreateRequest) String ¶
func (x *CreateRequest) String() string
type CreateResponse ¶
type CreateResponse struct {
Comment *Comment `protobuf:"bytes,1,opt,name=comment,proto3" json:"comment,omitempty"`
// contains filtered or unexported fields
}
func (*CreateResponse) Descriptor
deprecated
func (*CreateResponse) Descriptor() ([]byte, []int)
Deprecated: Use CreateResponse.ProtoReflect.Descriptor instead.
func (*CreateResponse) GetComment ¶
func (x *CreateResponse) GetComment() *Comment
func (*CreateResponse) ProtoMessage ¶
func (*CreateResponse) ProtoMessage()
func (*CreateResponse) ProtoReflect ¶
func (x *CreateResponse) ProtoReflect() protoreflect.Message
func (*CreateResponse) Reset ¶
func (x *CreateResponse) Reset()
func (*CreateResponse) String ¶
func (x *CreateResponse) String() string
type DeleteRequest ¶
type DeleteRequest struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
// contains filtered or unexported fields
}
func (*DeleteRequest) Descriptor
deprecated
func (*DeleteRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead.
func (*DeleteRequest) GetId ¶
func (x *DeleteRequest) GetId() string
func (*DeleteRequest) ProtoMessage ¶
func (*DeleteRequest) ProtoMessage()
func (*DeleteRequest) ProtoReflect ¶
func (x *DeleteRequest) ProtoReflect() protoreflect.Message
func (*DeleteRequest) Reset ¶
func (x *DeleteRequest) Reset()
func (*DeleteRequest) String ¶
func (x *DeleteRequest) String() string
type DeleteResponse ¶
type DeleteResponse struct {
// contains filtered or unexported fields
}
func (*DeleteResponse) Descriptor
deprecated
func (*DeleteResponse) Descriptor() ([]byte, []int)
Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead.
func (*DeleteResponse) ProtoMessage ¶
func (*DeleteResponse) ProtoMessage()
func (*DeleteResponse) ProtoReflect ¶
func (x *DeleteResponse) ProtoReflect() protoreflect.Message
func (*DeleteResponse) Reset ¶
func (x *DeleteResponse) Reset()
func (*DeleteResponse) String ¶
func (x *DeleteResponse) String() string
type LinkPreview ¶
type LinkPreview struct {
Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"`
Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
Image string `protobuf:"bytes,4,opt,name=image,proto3" json:"image,omitempty"`
// contains filtered or unexported fields
}
func (*LinkPreview) Descriptor
deprecated
func (*LinkPreview) Descriptor() ([]byte, []int)
Deprecated: Use LinkPreview.ProtoReflect.Descriptor instead.
func (*LinkPreview) GetDescription ¶
func (x *LinkPreview) GetDescription() string
func (*LinkPreview) GetImage ¶
func (x *LinkPreview) GetImage() string
func (*LinkPreview) GetTitle ¶
func (x *LinkPreview) GetTitle() string
func (*LinkPreview) GetUrl ¶
func (x *LinkPreview) GetUrl() string
func (*LinkPreview) ProtoMessage ¶
func (*LinkPreview) ProtoMessage()
func (*LinkPreview) ProtoReflect ¶
func (x *LinkPreview) ProtoReflect() protoreflect.Message
func (*LinkPreview) Reset ¶
func (x *LinkPreview) Reset()
func (*LinkPreview) String ¶
func (x *LinkPreview) String() string
type ListRequest ¶
type ListRequest struct {
PostId string `protobuf:"bytes,1,opt,name=post_id,json=postId,proto3" json:"post_id,omitempty"`
Page int32 `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty"`
Limit int32 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"`
AuthorId string `protobuf:"bytes,4,opt,name=author_id,json=authorId,proto3" json:"author_id,omitempty"` // Optional: filter comments by author_id
// contains filtered or unexported fields
}
func (*ListRequest) Descriptor
deprecated
func (*ListRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.
func (*ListRequest) GetAuthorId ¶
func (x *ListRequest) GetAuthorId() string
func (*ListRequest) GetLimit ¶
func (x *ListRequest) GetLimit() int32
func (*ListRequest) GetPage ¶
func (x *ListRequest) GetPage() int32
func (*ListRequest) GetPostId ¶
func (x *ListRequest) GetPostId() string
func (*ListRequest) ProtoMessage ¶
func (*ListRequest) ProtoMessage()
func (*ListRequest) ProtoReflect ¶
func (x *ListRequest) ProtoReflect() protoreflect.Message
func (*ListRequest) Reset ¶
func (x *ListRequest) Reset()
func (*ListRequest) String ¶
func (x *ListRequest) String() string
type ListResponse ¶
type ListResponse struct {
Comments []*Comment `protobuf:"bytes,1,rep,name=comments,proto3" json:"comments,omitempty"`
Total int32 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"`
// contains filtered or unexported fields
}
func (*ListResponse) Descriptor
deprecated
func (*ListResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListResponse.ProtoReflect.Descriptor instead.
func (*ListResponse) GetComments ¶
func (x *ListResponse) GetComments() []*Comment
func (*ListResponse) GetTotal ¶
func (x *ListResponse) GetTotal() int32
func (*ListResponse) ProtoMessage ¶
func (*ListResponse) ProtoMessage()
func (*ListResponse) ProtoReflect ¶
func (x *ListResponse) ProtoReflect() protoreflect.Message
func (*ListResponse) Reset ¶
func (x *ListResponse) Reset()
func (*ListResponse) String ¶
func (x *ListResponse) String() string
type ReadRequest ¶
type ReadRequest struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
// contains filtered or unexported fields
}
func (*ReadRequest) Descriptor
deprecated
func (*ReadRequest) Descriptor() ([]byte, []int)
Deprecated: Use ReadRequest.ProtoReflect.Descriptor instead.
func (*ReadRequest) GetId ¶
func (x *ReadRequest) GetId() string
func (*ReadRequest) ProtoMessage ¶
func (*ReadRequest) ProtoMessage()
func (*ReadRequest) ProtoReflect ¶
func (x *ReadRequest) ProtoReflect() protoreflect.Message
func (*ReadRequest) Reset ¶
func (x *ReadRequest) Reset()
func (*ReadRequest) String ¶
func (x *ReadRequest) String() string
type ReadResponse ¶
type ReadResponse struct {
Comment *Comment `protobuf:"bytes,1,opt,name=comment,proto3" json:"comment,omitempty"`
// contains filtered or unexported fields
}
func (*ReadResponse) Descriptor
deprecated
func (*ReadResponse) Descriptor() ([]byte, []int)
Deprecated: Use ReadResponse.ProtoReflect.Descriptor instead.
func (*ReadResponse) GetComment ¶
func (x *ReadResponse) GetComment() *Comment
func (*ReadResponse) ProtoMessage ¶
func (*ReadResponse) ProtoMessage()
func (*ReadResponse) ProtoReflect ¶
func (x *ReadResponse) ProtoReflect() protoreflect.Message
func (*ReadResponse) Reset ¶
func (x *ReadResponse) Reset()
func (*ReadResponse) String ¶
func (x *ReadResponse) String() string
type UpdateRequest ¶
type UpdateRequest struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
UserId string `protobuf:"bytes,3,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
PostId string `protobuf:"bytes,4,opt,name=post_id,json=postId,proto3" json:"post_id,omitempty"`
// contains filtered or unexported fields
}
func (*UpdateRequest) Descriptor
deprecated
func (*UpdateRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdateRequest.ProtoReflect.Descriptor instead.
func (*UpdateRequest) GetContent ¶
func (x *UpdateRequest) GetContent() string
func (*UpdateRequest) GetId ¶
func (x *UpdateRequest) GetId() string
func (*UpdateRequest) GetPostId ¶
func (x *UpdateRequest) GetPostId() string
func (*UpdateRequest) GetUserId ¶
func (x *UpdateRequest) GetUserId() string
func (*UpdateRequest) ProtoMessage ¶
func (*UpdateRequest) ProtoMessage()
func (*UpdateRequest) ProtoReflect ¶
func (x *UpdateRequest) ProtoReflect() protoreflect.Message
func (*UpdateRequest) Reset ¶
func (x *UpdateRequest) Reset()
func (*UpdateRequest) String ¶
func (x *UpdateRequest) String() string
type UpdateResponse ¶
type UpdateResponse struct {
Comment *Comment `protobuf:"bytes,1,opt,name=comment,proto3" json:"comment,omitempty"`
// contains filtered or unexported fields
}
func (*UpdateResponse) Descriptor
deprecated
func (*UpdateResponse) Descriptor() ([]byte, []int)
Deprecated: Use UpdateResponse.ProtoReflect.Descriptor instead.
func (*UpdateResponse) GetComment ¶
func (x *UpdateResponse) GetComment() *Comment
func (*UpdateResponse) ProtoMessage ¶
func (*UpdateResponse) ProtoMessage()
func (*UpdateResponse) ProtoReflect ¶
func (x *UpdateResponse) ProtoReflect() protoreflect.Message
func (*UpdateResponse) Reset ¶
func (x *UpdateResponse) Reset()
func (*UpdateResponse) String ¶
func (x *UpdateResponse) String() string