Documentation
¶
Index ¶
- type CreateRequest
- type PostHandler
- type PostHandlerImpl
- type PostRepository
- type PostRepositoryImpl
- func (repo *PostRepositoryImpl) Create(post *models.Post) error
- func (repo *PostRepositoryImpl) Delete(postID uint) error
- func (repo *PostRepositoryImpl) FindALL() ([]models.Post, error)
- func (repo *PostRepositoryImpl) FindByID(postID uint) (*models.Post, error)
- func (repo *PostRepositoryImpl) FindByUserID(authorID uint) ([]models.Post, error)
- func (repo *PostRepositoryImpl) Update(postID uint, updatedFields *models.Post) error
- type PostService
- type PostServiceImpl
- func (s *PostServiceImpl) CreatePost(post *models.Post) error
- func (s *PostServiceImpl) DeletePost(postID uint) error
- func (s *PostServiceImpl) GetAllPosts() ([]models.Post, error)
- func (s *PostServiceImpl) GetPostById(postID uint) (*models.Post, error)
- func (s *PostServiceImpl) GetPostsByAuthorID(authorID uint) ([]models.Post, error)
- func (s *PostServiceImpl) UpdatePost(postID uint, updatedFields *models.Post) error
- type UpdateRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateRequest ¶
type PostHandler ¶
type PostHandlerImpl ¶
type PostHandlerImpl struct { PostService PostService // contains filtered or unexported fields }
func NewPostHandler ¶
func NewPostHandler(postService PostService, validator *validate.XValidator) *PostHandlerImpl
func (*PostHandlerImpl) CreatePost ¶
func (h *PostHandlerImpl) CreatePost(c *fiber.Ctx) error
func (*PostHandlerImpl) DeletePost ¶
func (h *PostHandlerImpl) DeletePost(c *fiber.Ctx) error
func (*PostHandlerImpl) GetAllPosts ¶
func (h *PostHandlerImpl) GetAllPosts(c *fiber.Ctx) error
func (*PostHandlerImpl) GetPostById ¶
func (h *PostHandlerImpl) GetPostById(c *fiber.Ctx) error
func (*PostHandlerImpl) UpdatePost ¶
func (h *PostHandlerImpl) UpdatePost(c *fiber.Ctx) error
type PostRepository ¶
type PostRepositoryImpl ¶
type PostRepositoryImpl struct {
// contains filtered or unexported fields
}
func NewPostRepository ¶
func NewPostRepository(db *gorm.DB) *PostRepositoryImpl
func (*PostRepositoryImpl) Delete ¶
func (repo *PostRepositoryImpl) Delete(postID uint) error
func (*PostRepositoryImpl) FindALL ¶
func (repo *PostRepositoryImpl) FindALL() ([]models.Post, error)
func (*PostRepositoryImpl) FindByID ¶
func (repo *PostRepositoryImpl) FindByID(postID uint) (*models.Post, error)
func (*PostRepositoryImpl) FindByUserID ¶
func (repo *PostRepositoryImpl) FindByUserID(authorID uint) ([]models.Post, error)
type PostService ¶
type PostServiceImpl ¶
type PostServiceImpl struct {
PostRepo PostRepository
}
func NewPostService ¶
func NewPostService(postRepo PostRepository) *PostServiceImpl
func (*PostServiceImpl) CreatePost ¶
func (s *PostServiceImpl) CreatePost(post *models.Post) error
func (*PostServiceImpl) DeletePost ¶
func (s *PostServiceImpl) DeletePost(postID uint) error
func (*PostServiceImpl) GetAllPosts ¶
func (s *PostServiceImpl) GetAllPosts() ([]models.Post, error)
func (*PostServiceImpl) GetPostById ¶
func (s *PostServiceImpl) GetPostById(postID uint) (*models.Post, error)
func (*PostServiceImpl) GetPostsByAuthorID ¶
func (s *PostServiceImpl) GetPostsByAuthorID(authorID uint) ([]models.Post, error)
func (*PostServiceImpl) UpdatePost ¶
func (s *PostServiceImpl) UpdatePost(postID uint, updatedFields *models.Post) error
type UpdateRequest ¶
Click to show internal directories.
Click to hide internal directories.