Documentation ¶
Index ¶
- type PGRepository
- func (repo *PGRepository) Delete(ctx context.Context, f *model.QuestionFilter) ([]*model.Question, error)
- func (repo *PGRepository) Fetch(ctx context.Context, cfg *question.FetchConfig) ([]*model.Question, int, error)
- func (repo *PGRepository) GenerateTest(ctx context.Context, cfg *question.GenerateTestConfig) ([]*model.Question, error)
- func (repo *PGRepository) Store(ctx context.Context, input *model.QuestionInput) (*model.Question, error)
- func (repo *PGRepository) UpdateOneByID(ctx context.Context, id int, input *model.QuestionInput) (*model.Question, error)
- type PGRepositoryConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PGRepository ¶ added in v1.0.2
type PGRepository struct { *pg.DB // contains filtered or unexported fields }
func NewPGRepository ¶
func NewPGRepository(cfg *PGRepositoryConfig) (*PGRepository, error)
func (*PGRepository) Delete ¶ added in v1.0.2
func (repo *PGRepository) Delete(ctx context.Context, f *model.QuestionFilter) ([]*model.Question, error)
func (*PGRepository) Fetch ¶ added in v1.0.2
func (repo *PGRepository) Fetch(ctx context.Context, cfg *question.FetchConfig) ([]*model.Question, int, error)
func (*PGRepository) GenerateTest ¶ added in v1.0.2
func (repo *PGRepository) GenerateTest(ctx context.Context, cfg *question.GenerateTestConfig) ([]*model.Question, error)
func (*PGRepository) Store ¶ added in v1.0.2
func (repo *PGRepository) Store(ctx context.Context, input *model.QuestionInput) (*model.Question, error)
func (*PGRepository) UpdateOneByID ¶ added in v1.0.2
func (repo *PGRepository) UpdateOneByID(ctx context.Context, id int, input *model.QuestionInput) (*model.Question, error)
type PGRepositoryConfig ¶
type PGRepositoryConfig struct { DB *pg.DB FileStorage fstorage.FileStorage }
Click to show internal directories.
Click to hide internal directories.