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
|
Answer(string) Answer
|
||||||
PushAnswer(string, string, string, bool) error
|
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 {
|
Question struct {
|
||||||
Q string
|
Q string
|
||||||
Tags []string
|
Tags []string
|
||||||
|
|
@ -41,9 +32,6 @@ type (
|
||||||
TS int64
|
TS int64
|
||||||
Author string
|
Author string
|
||||||
}
|
}
|
||||||
User struct {
|
|
||||||
History map[string][]History
|
|
||||||
}
|
|
||||||
History struct {
|
History struct {
|
||||||
A string
|
A string
|
||||||
TS int64
|
TS int64
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue