Documentation ¶
Overview ¶
Package badger implements the srs/db.Handler interface with a badger backend
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
Handler is a badger client.
It accepts an Algo to allow for atomic operations. (for example Update must read from the db, decode, compute new values according to the review, and write back to db)
func (*Handler) Insert ¶
Insert runs the Algo on a all cards of a Review, and saves the result in the db. It returns a slice of review Due structs containing the Due Date for each of the card ids. There are two cases:
1) New cards for existing DeckId: this requires a lookup of the last CardId in the db 2) New cards for new DeckId created in this session, which do no require lookup, index starts at 0.
Insert is atomic