Versions in this module Expand all Collapse all v1 v1.7.0 Nov 22, 2026 v1.6.0 Nov 19, 2026 v1.5.0 Nov 15, 2026 v1.4.0 Nov 12, 2026 v1.3.0 Nov 8, 2026 v1.2.2 Nov 7, 2026 v1.2.1 Nov 3, 2026 v1.2.0 Oct 31, 2026 v1.1.4 Nov 2, 2026 v1.1.3 Nov 1, 2026 v1.1.2 Nov 1, 2026 v1.1.1 Oct 31, 2026 Changes in this version + var ErrContentNotFound = errors.New("comments: content not found") + type CommentHandler struct + func NewCommentHandler(commentService CommentService, content ContentResolver, ...) *CommentHandler + func (h *CommentHandler) CreateComment(w http.ResponseWriter, r *http.Request) + func (h *CommentHandler) DeleteComment(w http.ResponseWriter, r *http.Request) + func (h *CommentHandler) DeleteOwnComment(w http.ResponseWriter, r *http.Request) + func (h *CommentHandler) GetComments(w http.ResponseWriter, r *http.Request) + func (h *CommentHandler) GetCommentsForModeration(w http.ResponseWriter, r *http.Request) + func (h *CommentHandler) GetMyComments(w http.ResponseWriter, r *http.Request) + func (h *CommentHandler) GetPendingComments(w http.ResponseWriter, r *http.Request) + func (h *CommentHandler) UpdateCommentStatus(w http.ResponseWriter, r *http.Request) + type CommentHandlerOption func(*CommentHandler) + func WithCommentRoleService(rs RoleCapabilities) CommentHandlerOption + type CommentResponse struct + Author string + Comment string + CreatedAt time.Time + ID int + Role string + Status string + Username string + type CommentService interface + CountComments func(ctx context.Context, userID int) (int, error) + DeleteComment func(ctx context.Context, commentID int) error + DeleteOwnComment func(ctx context.Context, commentID int, principal kernel.Principal) error + GetComment func(ctx context.Context, commentID int) (*commentdomain.Comment, error) + GetCommentsByStatus func(ctx context.Context, status commentdomain.CommentStatus) ([]*commentdomain.Comment, error) + GetCommentsByUserID func(ctx context.Context, userID int) ([]*commentdomain.Comment, error) + GetCommentsForContent func(ctx context.Context, contentID int) ([]*commentdomain.Comment, error) + GetCommentsForModeration func(ctx context.Context, contentID int) ([]*commentdomain.Comment, error) + SubmitComment func(ctx context.Context, contentID int, principal kernel.Principal, ...) (*commentdomain.Comment, error) + UpdateCommentStatus func(ctx context.Context, commentID int, status commentdomain.CommentStatus) error + type ContentRef struct + AllowComments bool + ID int + type ContentResolver func(ctx context.Context, slug, language string) (ContentRef, error) + type CreateCommentRequest struct + Comment string + type PendingCommentResponse struct + Author string + Comment string + ContentID int + ContentSlug string + ContentTitle string + CreatedAt time.Time + ID int + Status string + Username string + type RoleCapabilities interface + CanComment func(name string) bool + type UpdateCommentStatusRequest struct + Status string