Documentation ¶
Index ¶
- func NewDB(env *env.EnvConfig) *sqlx.DB
- type AcademicFieldRepositoryImpl
- type ResourceRepositoryImpl
- type SubjectRepositoryImpl
- func (sR *SubjectRepositoryImpl) GetById(id model.SubjectId) (*model.Subject, error)
- func (sR *SubjectRepositoryImpl) GetByIds(ids []model.SubjectId) ([]*model.Subject, error)
- func (sR SubjectRepositoryImpl) GetByRandom(category string, series string, academicField string, numSubjects int) ([]*model.Subject, error)
- func (sR SubjectRepositoryImpl) GetBySearchParameter(title string, faculty string, academicField string) ([]*model.Subject, error)
- func (sR SubjectRepositoryImpl) GetByVideoIds(videoIds []model.VideoId) ([]*model.Subject, error)
- type SyllabusRepositoryImpl
- type VideoRepositoryImpl
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AcademicFieldRepositoryImpl ¶
type AcademicFieldRepositoryImpl struct {
// contains filtered or unexported fields
}
func NewAcademicFieldRepositoryImpl ¶
func NewAcademicFieldRepositoryImpl(db *sqlx.DB) *AcademicFieldRepositoryImpl
func (*AcademicFieldRepositoryImpl) Get ¶
func (afR *AcademicFieldRepositoryImpl) Get() ([]string, error)
type ResourceRepositoryImpl ¶
type ResourceRepositoryImpl struct {
// contains filtered or unexported fields
}
func NewResourceRepositoryImpl ¶
func NewResourceRepositoryImpl(db *sqlx.DB) *ResourceRepositoryImpl
func (*ResourceRepositoryImpl) GetByIds ¶
func (vR *ResourceRepositoryImpl) GetByIds(ids []model.ResourceId) ([]*model.Resource, error)
type SubjectRepositoryImpl ¶
type SubjectRepositoryImpl struct {
// contains filtered or unexported fields
}
func NewSubjectRepositoryImpl ¶
func NewSubjectRepositoryImpl(db *sqlx.DB) *SubjectRepositoryImpl
func (SubjectRepositoryImpl) GetByRandom ¶
func (sR SubjectRepositoryImpl) GetByRandom( category string, series string, academicField string, numSubjects int) ([]*model.Subject, error)
WARNING: This method become slower as the number of subjects increases due to LIMIT clause. This also causes N+1 query problem.
func (SubjectRepositoryImpl) GetBySearchParameter ¶
func (SubjectRepositoryImpl) GetByVideoIds ¶
type SyllabusRepositoryImpl ¶
type SyllabusRepositoryImpl struct {
// contains filtered or unexported fields
}
func NewSyllabusRepositoryImpl ¶
func NewSyllabusRepositoryImpl(db *sqlx.DB) *SyllabusRepositoryImpl
func (*SyllabusRepositoryImpl) GetById ¶
func (sR *SyllabusRepositoryImpl) GetById(id model.SyllabusId) (*model.Syllabus, error)
func (*SyllabusRepositoryImpl) GetByIds ¶
func (sR *SyllabusRepositoryImpl) GetByIds(ids []model.SyllabusId) ([]*model.Syllabus, error)
type VideoRepositoryImpl ¶
type VideoRepositoryImpl struct {
// contains filtered or unexported fields
}
func NewVideoRepositoryImpl ¶
func NewVideoRepositoryImpl(db *sqlx.DB) *VideoRepositoryImpl
func (*VideoRepositoryImpl) GetByIds ¶
GetByIds returns videos with the given ids. This function is expected to get videos of one subject.
func (*VideoRepositoryImpl) GetBySearchParameter ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.