1
0
mirror of https://github.com/rancher/steve.git synced 2025-09-08 18:59:58 +00:00

Add column support

This commit is contained in:
Darren Shepherd
2019-08-14 11:08:34 -07:00
parent db650d6c19
commit 583309b969
23 changed files with 365 additions and 177 deletions

View File

@@ -0,0 +1,29 @@
package router
import (
"net/http"
"github.com/gorilla/mux"
)
type Handlers struct {
K8sResource http.Handler
GenericResource http.Handler
K8sProxy http.Handler
}
func Routes(h Handlers) http.Handler {
m := mux.NewRouter()
m.UseEncodedPath()
m.StrictSlash(true)
m.NotFoundHandler = h.K8sProxy
m.Path("/v1/{type:schemas}/{name:.*}").Handler(h.GenericResource)
m.Path("/v1/{group}.{version}.{resource}").Handler(h.K8sResource)
m.Path("/v1/{group}.{version}.{resource}/{nameorns}").Handler(h.K8sResource)
m.Path("/v1/{group}.{version}.{resource}/{namespace}/{name}").Handler(h.K8sResource)
m.Path("/v1/{type}").Handler(h.GenericResource)
m.Path("/v1/{type}/{name}").Handler(h.GenericResource)
return m
}