chat/views.go

29 lines
560 B
Go
Raw Normal View History

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"`
}