package routes
import "k8s.io/apiserver/pkg/server/routes"
Package routes holds a collection of optional genericapiserver http handlers.
Index ¶
- func StringFlagPutHandler(setter StringFlagSetterFunc) http.HandlerFunc
- type DebugFlags
- func (f DebugFlags) Index(w http.ResponseWriter, r *http.Request)
- func (f DebugFlags) Install(c *mux.PathRecorderMux, flag string, handler func(http.ResponseWriter, *http.Request))
- type DebugSocket
- func NewDebugSocket(path string) *DebugSocket
- func (s *DebugSocket) InstallDebugFlag(flag string, handler func(http.ResponseWriter, *http.Request))
- func (s *DebugSocket) InstallProfiling()
- func (s *DebugSocket) Run(stopCh <-chan struct{}) error
- type DefaultMetrics
- type Index
- type IndexLister
- type ListedPathProvider
- type ListedPathProviders
- type MetricsWithReset
- type OpenAPI
- func (oa OpenAPI) InstallV2(c *restful.Container, mux *mux.PathRecorderMux) (*handler.OpenAPIService, *spec.Swagger)
- func (oa OpenAPI) InstallV3(c *restful.Container, mux *mux.PathRecorderMux) *handler3.OpenAPIService
- type Profiling
- type StringFlagSetterFunc
- type Version
Functions ¶
func StringFlagPutHandler ¶
func StringFlagPutHandler(setter StringFlagSetterFunc) http.HandlerFunc
StringFlagPutHandler wraps an http Handler to set string type flag.
Types ¶
type DebugFlags ¶
type DebugFlags struct { }
DebugFlags adds handlers for flags under /debug/flags.
func (DebugFlags) Index ¶
func (f DebugFlags) Index(w http.ResponseWriter, r *http.Request)
Index responds with the `/debug/flags` request. For example, "/debug/flags/v" serves the "--v" flag. Index responds to a request for "/debug/flags/" with an HTML page listing the available flags.
func (DebugFlags) Install ¶
func (f DebugFlags) Install(c *mux.PathRecorderMux, flag string, handler func(http.ResponseWriter, *http.Request))
Install registers the APIServer's flags handler.
type DebugSocket ¶
type DebugSocket struct {
// contains filtered or unexported fields
}
DebugSocket installs profiling and debugflag as a Unix-Domain socket.
func NewDebugSocket ¶
func NewDebugSocket(path string) *DebugSocket
NewDebugSocket creates a new DebugSocket for the given path.
func (*DebugSocket) InstallDebugFlag ¶
func (s *DebugSocket) InstallDebugFlag(flag string, handler func(http.ResponseWriter, *http.Request))
InstallDebugFlag installs debug flag endpoints in the socket.
func (*DebugSocket) InstallProfiling ¶
func (s *DebugSocket) InstallProfiling()
InstallProfiling installs profiling endpoints in the socket.
func (*DebugSocket) Run ¶
func (s *DebugSocket) Run(stopCh <-chan struct{}) error
Run starts the server and waits for stopCh to be closed to close the server.
type DefaultMetrics ¶
type DefaultMetrics struct{}
DefaultMetrics installs the default prometheus metrics handler
func (DefaultMetrics) Install ¶
func (m DefaultMetrics) Install(c *mux.PathRecorderMux)
Install adds the DefaultMetrics handler
type Index ¶
type Index struct{}
Index provides a webservice for the http root / listing all known paths.
func (Index) Install ¶
func (i Index) Install(pathProvider ListedPathProvider, mux *mux.PathRecorderMux)
Install adds the Index webservice to the given mux.
type IndexLister ¶
type IndexLister struct { StatusCode int PathProvider ListedPathProvider }
IndexLister lists the available indexes with the status code provided
func (IndexLister) ServeHTTP ¶
func (i IndexLister) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP serves the available paths.
type ListedPathProvider ¶
type ListedPathProvider interface { // ListedPaths is an alphabetically sorted list of paths to be reported at /. ListedPaths() []string }
ListedPathProvider is an interface for providing paths that should be reported at /.
type ListedPathProviders ¶
type ListedPathProviders []ListedPathProvider
ListedPathProviders is a convenient way to combine multiple ListedPathProviders
func (ListedPathProviders) ListedPaths ¶
func (p ListedPathProviders) ListedPaths() []string
ListedPaths unions and sorts the included paths.
type MetricsWithReset ¶
type MetricsWithReset struct{}
MetricsWithReset install the prometheus metrics handler extended with support for the DELETE method which resets the metrics.
func (MetricsWithReset) Install ¶
func (m MetricsWithReset) Install(c *mux.PathRecorderMux)
Install adds the MetricsWithReset handler
type OpenAPI ¶
type OpenAPI struct { Config *common.Config V3Config *common.OpenAPIV3Config }
OpenAPI installs spec endpoints for each web service.
func (OpenAPI) InstallV2 ¶
func (oa OpenAPI) InstallV2(c *restful.Container, mux *mux.PathRecorderMux) (*handler.OpenAPIService, *spec.Swagger)
Install adds the SwaggerUI webservice to the given mux.
func (OpenAPI) InstallV3 ¶
func (oa OpenAPI) InstallV3(c *restful.Container, mux *mux.PathRecorderMux) *handler3.OpenAPIService
InstallV3 adds the static group/versions defined in the RegisteredWebServices to the OpenAPI v3 spec
type Profiling ¶
type Profiling struct{}
Profiling adds handlers for pprof under /debug/pprof.
func (Profiling) Install ¶
func (d Profiling) Install(c *mux.PathRecorderMux)
Install adds the Profiling webservice to the given mux.
type StringFlagSetterFunc ¶
StringFlagSetterFunc is a func used for setting string type flag.
type Version ¶
Version provides a webservice with version information.
func (Version) Install ¶
func (v Version) Install(c *restful.Container)
Install registers the APIServer's `/version` handler.
Source Files ¶
debugsocket.go doc.go flags.go index.go metrics.go openapi.go profiling.go version.go
- Version
- v0.33.0 (latest)
- Published
- Apr 23, 2025
- Platform
- linux/amd64
- Imports
- 30 packages
- Last checked
- 7 hours ago –
Tools for package owners.