refactor to go-restful

This commit is contained in:
Mikaël Cluseau
2019-02-04 13:56:43 +11:00
parent 4d07db7b2c
commit e93b84b60c
390 changed files with 72017 additions and 233 deletions

View File

@ -7,6 +7,7 @@ import (
"path/filepath"
restful "github.com/emicklei/go-restful"
"github.com/mcluseau/go-swagger-ui"
"novit.nc/direktil/pkg/cas"
"novit.nc/direktil/local-server/pkg/apiutils"
@ -39,16 +40,7 @@ func main() {
restful.Add(buildWS())
})
// by default, serve a host resource by its IP
//http.HandleFunc("/", serveHostByIP)
//http.HandleFunc("/configs", uploadConfig)
http.HandleFunc("/hosts", serveHosts)
//http.HandleFunc("/hosts/", serveHost)
http.HandleFunc("/clusters", serveClusters)
http.HandleFunc("/clusters/", serveCluster)
swaggerui.HandleAt("/swagger-ui/")
if *address != "" {
log.Print("HTTP listening on ", *address)