DB interface

master
bel 2023-04-04 19:10:15 -06:00
parent 9e265bb8ca
commit 42ba81397d
3 changed files with 16 additions and 12 deletions

BIN
anki.d

Binary file not shown.

16
db.go Normal file
View File

@ -0,0 +1,16 @@
package main
type (
db struct {
Knowledge Knowledge
Users map[string]User
Cadence []Duration
}
Knowledge struct {
Questions map[string]Question
Answers map[string]Answer
}
User struct {
History map[string][]History
}
)

12
main.go
View File

@ -22,15 +22,6 @@ type (
Answer(string) Answer
PushAnswer(string, string, string, bool) error
}
db struct {
Knowledge Knowledge
Users map[string]User
Cadence []Duration
}
Knowledge struct {
Questions map[string]Question
Answers map[string]Answer
}
Question struct {
Q string
Tags []string
@ -41,9 +32,6 @@ type (
TS int64
Author string
}
User struct {
History map[string][]History
}
History struct {
A string
TS int64