Documentation ¶
Overview ¶
Posts routes and controllers logic package for the backend.
Index ¶
- Constants
- func NewPostRepository(cache db.Cacher) models.PostRepositoryInterface
- func NewPostService(postRepository models.PostRepositoryInterface, ...) models.PostServiceInterface
- func Router() chi.Router
- type PostRepository
- func (r *PostRepository) Delete(postID string) error
- func (r *PostRepository) GetAll() (*map[string]models.Post, error)
- func (r *PostRepository) GetByID(postID string) (*models.Post, error)
- func (r *PostRepository) GetPage(pageOpts interface{}) (*map[string]models.Post, *map[string]models.User, error)
- func (r *PostRepository) Save(post *models.Post) error
- type PostService
- func (s *PostService) Create(ctx context.Context, post *models.Post) error
- func (s *PostService) Delete(ctx context.Context, postID string) error
- func (s *PostService) FindAll(ctx context.Context) (*map[string]models.Post, *models.User, error)
- func (s *PostService) FindByID(ctx context.Context, postID string) (*models.Post, *models.User, error)
- func (s *PostService) FindPage(ctx context.Context, opts interface{}) (*map[string]models.Post, *map[string]models.User, error)
- func (s *PostService) Update(ctx context.Context, post *models.Post) error
Constants ¶
View Source
const (
PKG_NAME = "posts"
)
Variables ¶
This section is empty.
Functions ¶
func NewPostRepository ¶ added in v0.44.22
func NewPostRepository(cache db.Cacher) models.PostRepositoryInterface
func NewPostService ¶ added in v0.44.26
func NewPostService( postRepository models.PostRepositoryInterface, userRepository models.UserRepositoryInterface, ) models.PostServiceInterface
Types ¶
type PostRepository ¶ added in v0.44.22
type PostRepository struct {
// contains filtered or unexported fields
}
The implementation of pkg/models.PostRepositoryInterface.
func (*PostRepository) Delete ¶ added in v0.44.22
func (r *PostRepository) Delete(postID string) error
func (*PostRepository) GetAll ¶ added in v0.44.22
func (r *PostRepository) GetAll() (*map[string]models.Post, error)
func (*PostRepository) GetByID ¶ added in v0.44.22
func (r *PostRepository) GetByID(postID string) (*models.Post, error)
type PostService ¶ added in v0.44.26
type PostService struct {
// contains filtered or unexported fields
}
func (*PostService) Delete ¶ added in v0.44.26
func (s *PostService) Delete(ctx context.Context, postID string) error
Click to show internal directories.
Click to hide internal directories.