Brian Buller
ba35073d95
* Use 'https://github.com/mjibson/esc' for embedded assets * Pull database name out of siteData object * Load site config from database, if available * Allow customizing site config from command line arguments * Clean up some templates * Update Readme (it still needs a lot of updating) * Started work on vote accumulation/management
45 lines
673 B
Go
45 lines
673 B
Go
package main
|
|
|
|
import "time"
|
|
|
|
type Vote struct {
|
|
Timestamp time.Time
|
|
ClientId string
|
|
}
|
|
|
|
func dbGetAllVotes() []Vote {
|
|
var ret []Vote
|
|
var err error
|
|
if err = db.OpenDB(); err != nil {
|
|
return ret
|
|
}
|
|
defer db.CloseDB()
|
|
|
|
votesBkt := []string{"votes"}
|
|
return ret
|
|
}
|
|
|
|
func dbGetVote(clientId string, timestamp time.Time) *Vote {
|
|
var err error
|
|
if err = db.OpenDB(); err != nil {
|
|
return nil
|
|
}
|
|
defer db.CloseDB()
|
|
|
|
vt := new(Vote)
|
|
|
|
return vt
|
|
}
|
|
|
|
func dbSaveVote(clientId string, timestamp time.Time, votes []string) error {
|
|
var err error
|
|
if err = db.OpenDB(); err != nil {
|
|
return nil
|
|
}
|
|
defer db.CloseDB()
|
|
|
|
votesBkt := []string{"votes", clientId}
|
|
|
|
return err
|
|
}
|