genericapiserver: turn APIContainer.SecretRoutes into a real ServeMux

pull/6/head
Dr. Stefan Schimanski 2016-12-15 19:39:40 +01:00
parent cbbe421db8
commit df7e711c0a
2 changed files with 6 additions and 2 deletions

View File

@ -29,8 +29,12 @@ import (
// handlers that do not show up in swagger or in /
type APIContainer struct {
*restful.Container
// NonSwaggerRoutes are recorded and are visible at /, but do not show up in Swagger.
NonSwaggerRoutes PathRecorderMux
SecretRoutes Mux
// SecretRoutes are not recorded, are not visible at / and do not show up in Swagger.
SecretRoutes *http.ServeMux
}
// NewAPIContainer constructs a new container for APIs

View File

@ -26,7 +26,7 @@ import (
func TestNewAPIContainer(t *testing.T) {
mux := http.NewServeMux()
c := NewAPIContainer(mux, nil)
assert.Equal(t, mux, c.SecretRoutes.(*http.ServeMux), "SecretRoutes ServeMux's do not match")
assert.Equal(t, mux, c.SecretRoutes, "SecretRoutes ServeMux's do not match")
assert.Equal(t, mux, c.Container.ServeMux, "Container ServeMux's do not match")
}