chat/views.go
stephen mcquay fda6a98f79 initial chat server working
must send messages over javascript console for now
2015-04-05 15:00:11 -07:00

29 lines
560 B
Go

package chat
import (
"encoding/json"
"net/http"
)
func info(w http.ResponseWriter, req *http.Request) {
logs.Debug("info")
output := struct {
Version string `json:"version"`
}{
Version: "0.0.0",
}
w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(output)
}
type authResp struct {
Username string `json:"username,omitempty"`
Success bool `json:"success,omitempty"`
Failure string `json:"failure,omitempty"`
Admin bool `json:"admin,omitempty"`
}
type authReq struct {
Username string `json:"username"`
}