dao

package
v0.0.0-...-f970f26 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 3, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseDB

func CloseDB()

CloseDB closes database connection

func Setup

func Setup()

Setup initialize the database

Types

type QuestionDAO

type QuestionDAO interface {
	GetByID(id int64) (*models.Question, error)
	GetBySubCat(sub string) ([]*models.Question, error)
	MGetBySubCat(sub string, count int) ([]*models.Question, error)
	GetByOffsetAndLimit(offset, limit int64) ([]*models.Question, error)
}

QuestionDAO ...

func NewQuestionDAO

func NewQuestionDAO() QuestionDAO

NewQuestionDAO ...

type QuestionDAOImpl

type QuestionDAOImpl struct{}

QuestionDAOImpl ...

func (*QuestionDAOImpl) GetByID

func (*QuestionDAOImpl) GetByID(id int64) (*models.Question, error)

GetByID get question by id

func (*QuestionDAOImpl) GetByOffsetAndLimit

func (*QuestionDAOImpl) GetByOffsetAndLimit(offset, limit int64) ([]*models.Question, error)

GetByOffsetAndLimit get questions by offset and limit

func (*QuestionDAOImpl) GetBySubCat

func (*QuestionDAOImpl) GetBySubCat(sub string) ([]*models.Question, error)

GetBySubCat get questions by sub category

func (*QuestionDAOImpl) MGetBySubCat

func (*QuestionDAOImpl) MGetBySubCat(sub string, count int) ([]*models.Question, error)

MGetBySubCat get a batch of random questions by sub category

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL