Add history record struct and collect timestamps for query history

This commit is contained in:
Dan Sosedoff
2015-01-04 18:11:13 -06:00
parent 8b3c5bd8e9
commit 58a9c2b2bf
4 changed files with 343 additions and 306 deletions

21
history.go Normal file
View File

@@ -0,0 +1,21 @@
package main
import (
"time"
)
type HistoryRecord struct {
Query string `json:"query"`
Timestamp string `json:"timestamp"`
}
func NewHistory() []HistoryRecord {
return make([]HistoryRecord, 0)
}
func NewHistoryRecord(query string) HistoryRecord {
return HistoryRecord{
Query: query,
Timestamp: time.Now().String(),
}
}