Documentation ¶
Index ¶
- Constants
- func ConfigHandler(w http.ResponseWriter, r *http.Request) (int, error)
- func CreateHttpApiHandler(client *client.Client, heapsterClient HeapsterClient, ...) http.Handler
- func FormatRequestLog(req *restful.Request) string
- func FormatResponseLog(resp *restful.Response, req *restful.Request) string
- type ApiHandler
- type AppConfig
- type AppHandler
Constants ¶
View Source
const ( // RequestLogString is a template for request log message. RequestLogString = "Incoming %s %s %s request from %s" // ResponseLogString is a template for response log message. ResponseLogString = "Outcoming response to %s with %d status code" )
View Source
const ( // ConfigTemplateName is a name of config template ConfigTemplateName string = "appConfig" // ConfigTemplate is a template of a config ConfigTemplate string = "var appConfig_DO_NOT_USE_DIRECTLY = {{.}}" )
Variables ¶
This section is empty.
Functions ¶
func ConfigHandler ¶
func CreateHttpApiHandler ¶
func CreateHttpApiHandler(client *client.Client, heapsterClient HeapsterClient, clientConfig clientcmd.ClientConfig) http.Handler
CreateHttpApiHandler creates a new HTTP handler that handles all requests to the API of the backend.
func FormatRequestLog ¶
FormatRequestLog formats request log string. TODO(maciaszczykm): Display request body.
Types ¶
type ApiHandler ¶
type ApiHandler struct {
// contains filtered or unexported fields
}
ApiHandler is a representation of API handler. Structure contains client, Heapster client and client configuration.
type AppConfig ¶
type AppConfig struct { // ServerTime is current server time (milliseconds elapsed since 1 January 1970 00:00:00 UTC). ServerTime int64 `json:"serverTime"` }
AppConfig is a global configuration of application.
type AppHandler ¶
AppHandler is a application handler.
func (AppHandler) ServeHTTP ¶
func (fn AppHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP serves HTTP endpoint with application configuration.
Click to show internal directories.
Click to hide internal directories.