DB interface
parent
9e265bb8ca
commit
42ba81397d
|
|
@ -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
12
main.go
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue