Fixing build issues

This commit is contained in:
MichaelOultram 2015-07-30 14:17:01 +01:00
parent 4678298ae9
commit a246196786

17
web.go
View file

@ -28,14 +28,17 @@ type Page struct {
var external_ip = ""
func Webserver(port int) *WebServer {
var webserver = WebServer{port, make(map[*gumble.User]string), make(map[string]*gumble.User)}
http.HandleFunc("/", webserver.homepage)
http.HandleFunc("/add", webserver.add)
http.HandleFunc("/volume", webserver.volume)
http.HandleFunc("/skip", webserver.skip)
http.ListenAndServe(":"+strconv.Itoa(port), nil)
return WebServer{port, make(map[*gumble.User]string), make(map[string]*gumble.User)}.construct()
}
func (web *WebServer) construct() *WebServer {
http.HandleFunc("/", web.homepage)
http.HandleFunc("/add", web.add)
http.HandleFunc("/volume", web.volume)
http.HandleFunc("/skip", web.skip)
http.ListenAndServe(":"+strconv.Itoa(web.port), nil)
rand.Seed(time.Now().UnixNano())
return webserver
return web
}
func (web *WebServer) homepage(w http.ResponseWriter, r *http.Request) {