Fixing build issues

This commit is contained in:
MichaelOultram 2015-07-30 15:14:30 +01:00
parent 4350d54c3b
commit d1105b7556
2 changed files with 7 additions and 7 deletions

View file

@ -172,7 +172,7 @@ var dj = mumbledj{
cache: NewSongCache(), cache: NewSongCache(),
} }
var web *WebServer var web WebServer
// main primarily performs startup tasks. Grabs and parses commandline // main primarily performs startup tasks. Grabs and parses commandline
// args, sets up the gumble client and its listeners, and then connects to the server. // args, sets up the gumble client and its listeners, and then connects to the server.

12
web.go
View file

@ -27,8 +27,8 @@ type Page struct {
var external_ip = "" var external_ip = ""
func makeWebserver(port int) *WebServer { func makeWebserver(port int) WebServer {
webserver := &WebServer{port, make(map[*gumble.User]string), make(map[string]*gumble.User)} webserver := WebServer{port, make(map[*gumble.User]string), make(map[string]*gumble.User)}
http.HandleFunc("/", webserver.homepage) http.HandleFunc("/", webserver.homepage)
http.HandleFunc("/add", webserver.add) http.HandleFunc("/add", webserver.add)
@ -40,7 +40,7 @@ func makeWebserver(port int) *WebServer {
return webserver return webserver
} }
func (web *WebServer) homepage(w http.ResponseWriter, r *http.Request) { func (web WebServer) homepage(w http.ResponseWriter, r *http.Request) {
var uname = web.token_client[r.URL.Path[1:]] var uname = web.token_client[r.URL.Path[1:]]
if uname == nil { if uname == nil {
fmt.Fprintf(w, "Invalid Token") fmt.Fprintf(w, "Invalid Token")
@ -50,7 +50,7 @@ func (web *WebServer) homepage(w http.ResponseWriter, r *http.Request) {
} }
} }
func (web *WebServer) add(w http.ResponseWriter, r *http.Request) { func (web WebServer) add(w http.ResponseWriter, r *http.Request) {
var uname = web.token_client[r.FormValue("token")] var uname = web.token_client[r.FormValue("token")]
if uname == nil { if uname == nil {
fmt.Fprintf(w, "Invalid Token") fmt.Fprintf(w, "Invalid Token")
@ -59,7 +59,7 @@ func (web *WebServer) add(w http.ResponseWriter, r *http.Request) {
} }
} }
func (web *WebServer) volume(w http.ResponseWriter, r *http.Request) { func (web WebServer) volume(w http.ResponseWriter, r *http.Request) {
var uname = web.token_client[r.FormValue("token")] var uname = web.token_client[r.FormValue("token")]
if uname == nil { if uname == nil {
fmt.Fprintf(w, "Invalid Token") fmt.Fprintf(w, "Invalid Token")
@ -69,7 +69,7 @@ func (web *WebServer) volume(w http.ResponseWriter, r *http.Request) {
} }
} }
func (web *WebServer) skip(w http.ResponseWriter, r *http.Request) { func (web WebServer) skip(w http.ResponseWriter, r *http.Request) {
var uname = web.token_client[r.FormValue("token")] var uname = web.token_client[r.FormValue("token")]
if uname == nil { if uname == nil {
fmt.Fprintf(w, "Invalid Token") fmt.Fprintf(w, "Invalid Token")