Documentation ¶
Index ¶
- Constants
- type CategoryService
- func (cs *CategoryService) Create(insertCategory dto.InsertCategory) (*models.Category, error)
- func (cs *CategoryService) Delete(id primitive.ObjectID) error
- func (cs *CategoryService) GetAll(filter string, page int64, pageSize int64) ([]models.Category, error)
- func (cs *CategoryService) GetById(id primitive.ObjectID) (*models.Category, error)
- func (cs *CategoryService) GetFreeCategory() *models.Category
- func (cs *CategoryService) GetVideosByCategoryId(id primitive.ObjectID) ([]models.Video, error)
- func (cs *CategoryService) Update(id primitive.ObjectID, newData dto.InsertCategory) (*models.Category, error)
- type DatabaseService
- type VideoService
- func (vs *VideoService) Create(model dto.InsertVideo) (*models.Video, error)
- func (vs *VideoService) Delete(id primitive.ObjectID) error
- func (vs *VideoService) GetAll(filter string, page int64, pageSize int64) ([]models.Video, error)
- func (vs *VideoService) GetAllFreeVideos() ([]models.Video, error)
- func (vs *VideoService) GetByID(id primitive.ObjectID) (*models.Video, error)
- func (vs *VideoService) Update(id primitive.ObjectID, newData dto.InsertVideo) (*models.Video, error)
Constants ¶
View Source
const ( VideoCollection = "videos" CategoriesCollection = "categories" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CategoryService ¶
type CategoryService struct {
// contains filtered or unexported fields
}
func ProvideCategoryService ¶
func ProvideCategoryService(database DatabaseService) CategoryService
func (*CategoryService) Create ¶
func (cs *CategoryService) Create(insertCategory dto.InsertCategory) (*models.Category, error)
func (*CategoryService) GetFreeCategory ¶
func (cs *CategoryService) GetFreeCategory() *models.Category
func (*CategoryService) GetVideosByCategoryId ¶
func (*CategoryService) Update ¶
func (cs *CategoryService) Update(id primitive.ObjectID, newData dto.InsertCategory) (*models.Category, error)
type DatabaseService ¶
func ProvideDatabaseService ¶
func ProvideDatabaseService() DatabaseService
type VideoService ¶
type VideoService struct {
// contains filtered or unexported fields
}
func ProvideVideoService ¶
func ProvideVideoService(cs CategoryService, service DatabaseService) VideoService
func (*VideoService) Create ¶
func (vs *VideoService) Create(model dto.InsertVideo) (*models.Video, error)
func (*VideoService) GetAllFreeVideos ¶
func (vs *VideoService) GetAllFreeVideos() ([]models.Video, error)
func (*VideoService) Update ¶
func (vs *VideoService) Update(id primitive.ObjectID, newData dto.InsertVideo) (*models.Video, error)
Click to show internal directories.
Click to hide internal directories.