Documentation ¶
Index ¶
- type Comment
- type CommentService
- type Service
- func (service *Service) DeleteComment(ID uint) error
- func (s *Service) GetAllComments() ([]Comment, error)
- func (service *Service) GetComment(ID uint) (Comment, error)
- func (service *Service) GetCommentsBySlug(slug string) ([]Comment, error)
- func (service *Service) PostComment(comment Comment) (Comment, error)
- func (service *Service) UpdateComment(ID uint, newComment Comment) (Comment, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommentService ¶
type CommentService interface { GetComment(ID uint) (Comment, error) PostComment(comment Comment) (Comment, error) UpdateComment(ID uint, newComment Comment) (Comment, error) DeleteComment(ID uint) error GetAllComments() ([]Comment, error) }
CommentService -
type Service ¶
The comment service
func (*Service) DeleteComment ¶
Deletes a comment from the database by ID
func (*Service) GetAllComments ¶
Retrieves all comments from the database
func (*Service) GetComment ¶
Retrieves comments by their ID from the database
func (*Service) GetCommentsBySlug ¶
Retrieves all comments by slug (path - /article/name/)
func (*Service) PostComment ¶
Adds a new comment to the database
Click to show internal directories.
Click to hide internal directories.