Documentation ¶
Index ¶
- func GetImagesByItemId(itemId, businessId string, db *sql.DB) (images []models.Image, err error)
- type ContentRepository
- func (r *ContentRepository) FindAll(ctx context.Context) (articles []models.Cms, err error)
- func (r *ContentRepository) FindAllByCategoryId(categoryId string, ctx context.Context) (articles []models.Cms, err error)
- func (r *ContentRepository) FindAllByType(cmsType string, ctx context.Context) (articles []models.Cms, err error)
- func (r *ContentRepository) FindAllCategories(ctx context.Context) (categories []models.CmsCategory, err error)
- func (r *ContentRepository) FindOneById(cmsId string, ctx context.Context) (cms models.Cms, err error)
- type ContentRepositoryInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ContentRepository ¶
type ContentRepository struct { DB *sql.DB BusinessId string Cache *cache.Cache // contains filtered or unexported fields }
func NewContentRepository ¶
func NewContentRepository(db *sql.DB) (*ContentRepository, error)
func (*ContentRepository) FindAllByCategoryId ¶
func (*ContentRepository) FindAllByType ¶
func (r *ContentRepository) FindAllByType(cmsType string, ctx context.Context) (articles []models.Cms, err error)
Type as defined as content type, is a string and is stored by values by example (post, page, etc)
func (*ContentRepository) FindAllCategories ¶
func (r *ContentRepository) FindAllCategories(ctx context.Context) (categories []models.CmsCategory, err error)
func (*ContentRepository) FindOneById ¶
type ContentRepositoryInterface ¶
type ContentRepositoryInterface interface { FindAll(ctx context.Context) ([]models.Cms, error) FindAllByType(cmsType string, ctx context.Context) ([]models.Cms, error) FindAllByCategoryId(categoryId string, ctx context.Context) ([]models.Cms, error) FindAllCategories(ctx context.Context) ([]models.CmsCategory, error) FindOneById(cmsId string, ctx context.Context) (models.Cms, error) }
Click to show internal directories.
Click to hide internal directories.