Skip to content

Comments Service ​

go
type CommentsService struct{ ... }

func NewCommentsService(client builder.TransportProvider) *CommentsService

Access via client.Comments().

Methods ​

Get ​

go
func (s *CommentsService) Get(ctx context.Context, blogId, postId, commentId string) (*schemas.Comment, error)

GET /v3/blogs/{blogId}/posts/{postId}/comments/{commentId}

List ​

go
func (s *CommentsService) List(ctx context.Context, blogId, postId string, opts ...CommentListOption) (*schemas.CommentList, error)

GET /v3/blogs/{blogId}/posts/{postId}/comments

ListByBlog ​

go
func (s *CommentsService) ListByBlog(ctx context.Context, blogId string, opts ...CommentListOption) (*schemas.CommentList, error)

GET /v3/blogs/{blogId}/comments

Approve ​

go
func (s *CommentsService) Approve(ctx context.Context, blogId, postId, commentId string) (*schemas.Comment, error)

POST .../comments/{commentId}/approve

Delete ​

go
func (s *CommentsService) Delete(ctx context.Context, blogId, postId, commentId string) error

DELETE /v3/blogs/{blogId}/posts/{postId}/comments/{commentId}

MarkAsSpam ​

go
func (s *CommentsService) MarkAsSpam(ctx context.Context, blogId, postId, commentId string) (*schemas.Comment, error)

POST .../comments/{commentId}/spam

RemoveContent ​

go
func (s *CommentsService) RemoveContent(ctx context.Context, blogId, postId, commentId string) (*schemas.Comment, error)

POST .../comments/{commentId}/removecontent

Options ​

go
type CommentListOption func(*builder.Builder)
OptionQuery parameterDescription
WithCommentPageToken(t)pageTokenContinue from a cursor
WithCommentMaxResults(n)maxResultsPage size cap
WithCommentStatus(s)statusLIVE, EMPTIED, PENDING, SPAM
WithCommentView(v)viewAccess level
WithCommentStartDate(d)startDateRFC 3339 lower bound
WithCommentEndDate(d)endDateRFC 3339 upper bound
WithCommentFetchBodies(b)fetchBodiesInclude comment bodies
WithCommentPost(id)postRestrict ListByBlog to one post