Files
kapow/internal/server/control/control.go
Héctor Hurtado e32116abad Rewrite
2019-10-08 09:20:58 +02:00

36 lines
730 B
Go

package control
import (
"net/http"
"github.com/gorilla/mux"
)
type ControlServer struct {
bindAddr string
ctrlMux *mux.Router
}
var Server *ControlServer
func (srv *ControlServer) Run(bindAddr string) {
Server = &ControlServer{bindAddr, mux.NewRouter()}
Server.ctrlMux.HandleFunc("/routes/{id}", Server.removeRoute).Methods("DELETE")
Server.ctrlMux.HandleFunc("/routes", Server.listRoutes).Methods("GET")
Server.ctrlMux.HandleFunc("/routes", Server.addRoute).Methods("POST")
}
func (srv *ControlServer) removeRoute(http.ResponseWriter, *http.Request) {
}
func (srv *ControlServer) listRoutes(http.ResponseWriter, *http.Request) {
}
func (srv *ControlServer) addRoute(http.ResponseWriter, *http.Request) {
}