Documentation ¶
Overview ¶
Package mux contains abstractions for http multiplexing of APIs.
Index ¶
- type APIContainer
- type PathRecorderMux
- func (m *PathRecorderMux) Handle(path string, handler http.Handler)
- func (m *PathRecorderMux) HandleFunc(path string, handler func(http.ResponseWriter, *http.Request))
- func (m *PathRecorderMux) ListedPaths() []string
- func (m *PathRecorderMux) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (m *PathRecorderMux) UnlistedHandle(path string, handler http.Handler)
- func (m *PathRecorderMux) UnlistedHandleFunc(path string, handler func(http.ResponseWriter, *http.Request))
- func (m *PathRecorderMux) Unregister(path string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIContainer ¶
type APIContainer struct {
*restful.Container
}
APIContainer is a restful container which in addition support registering handlers that do not show up in swagger or in /
func NewAPIContainer ¶
func NewAPIContainer(mux *http.ServeMux, s runtime.NegotiatedSerializer, defaultMux http.Handler) *APIContainer
NewAPIContainer constructs a new container for APIs
func (*APIContainer) ListedPaths ¶
func (c *APIContainer) ListedPaths() []string
ListedPaths returns the paths of the webservices for listing on /.
type PathRecorderMux ¶
type PathRecorderMux struct {
// contains filtered or unexported fields
}
PathRecorderMux wraps a mux object and records the registered exposedPaths.
func NewPathRecorderMux ¶
func NewPathRecorderMux() *PathRecorderMux
NewPathRecorderMux creates a new PathRecorderMux with the given mux as the base mux.
func (*PathRecorderMux) Handle ¶
func (m *PathRecorderMux) Handle(path string, handler http.Handler)
Handle registers the handler for the given pattern. If a handler already exists for pattern, Handle panics.
func (*PathRecorderMux) HandleFunc ¶
func (m *PathRecorderMux) HandleFunc(path string, handler func(http.ResponseWriter, *http.Request))
HandleFunc registers the handler function for the given pattern. If a handler already exists for pattern, Handle panics.
func (*PathRecorderMux) ListedPaths ¶
func (m *PathRecorderMux) ListedPaths() []string
ListedPaths returns the registered handler exposedPaths.
func (*PathRecorderMux) ServeHTTP ¶
func (m *PathRecorderMux) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP makes it an http.Handler
func (*PathRecorderMux) UnlistedHandle ¶
func (m *PathRecorderMux) UnlistedHandle(path string, handler http.Handler)
UnlistedHandle registers the handler for the given pattern, but doesn't list it. If a handler already exists for pattern, Handle panics.
func (*PathRecorderMux) UnlistedHandleFunc ¶
func (m *PathRecorderMux) UnlistedHandleFunc(path string, handler func(http.ResponseWriter, *http.Request))
UnlistedHandleFunc registers the handler function for the given pattern, but doesn't list it. If a handler already exists for pattern, Handle panics.
func (*PathRecorderMux) Unregister ¶
func (m *PathRecorderMux) Unregister(path string)
Unregister removes a path from the mux.