DB interface
This commit is contained in:
16
db.go
Normal file
16
db.go
Normal 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
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
|
||||||
|
|||||||
Reference in New Issue
Block a user