Beispiel #1
0
// NewHandler Returns with a Handler and initialize the card.
func NewHandler() (*Handler, error) {
	con := app.GetDBConnection()

	if err := con.Ping(); err != nil {
		return nil, err
	}

	h := &Handler{con}

	return h, nil
}
Beispiel #2
0
func init() {
	var err error

	con := app.GetDBConnection()
	if err != nil {
		log.Fatal(err)
	}

	ch := card.GetHandler()
	rh := result.GetHandler()
	h := SpacedRepetitionLearner{con, rh, ch}

	err = h.createSRTable()
	if err != nil {
		log.Fatal(err)
	}

	srLearner = &h
}