Documentation ¶
Index ¶
- func AppSlugMiddleware(next http.Handler) http.Handler
- func GetContextParams(r *http.Request) types.UpgradeServiceParams
- func JSON(w http.ResponseWriter, code int, payload interface{})
- func LoggingMiddleware(next http.Handler) http.Handler
- func NewLoggingResponseWriter(w http.ResponseWriter) *loggingResponseWriter
- func ParamsMiddleware(params types.UpgradeServiceParams) mux.MiddlewareFunc
- func RegisterAPIRoutes(r *mux.Router, handler UpgradeServiceHandler)
- func SetContextParams(r *http.Request, params types.UpgradeServiceParams) *http.Request
- type CurrentConfigResponse
- type DeployRequest
- type DeployResponse
- type DownloadFileFromConfigResponse
- type GetPreflightResultResponse
- type Handler
- func (h *Handler) CurrentConfig(w http.ResponseWriter, r *http.Request)
- func (h *Handler) Deploy(w http.ResponseWriter, r *http.Request)
- func (h *Handler) DownloadFileFromConfig(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetPreflightResult(w http.ResponseWriter, r *http.Request)
- func (h *Handler) Info(w http.ResponseWriter, r *http.Request)
- func (h *Handler) LiveConfig(w http.ResponseWriter, r *http.Request)
- func (h *Handler) Ping(w http.ResponseWriter, r *http.Request)
- func (h *Handler) SaveConfig(w http.ResponseWriter, r *http.Request)
- func (h *Handler) StartPreflightChecks(w http.ResponseWriter, r *http.Request)
- type InfoResponse
- type LiveConfigRequest
- type LiveConfigResponse
- type PingResponse
- type SPAHandler
- type SaveConfigRequest
- type SaveConfigResponse
- type StatusNotFoundHandler
- type UpgradeServiceHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetContextParams ¶
func GetContextParams(r *http.Request) types.UpgradeServiceParams
func JSON ¶
func JSON(w http.ResponseWriter, code int, payload interface{})
func NewLoggingResponseWriter ¶
func NewLoggingResponseWriter(w http.ResponseWriter) *loggingResponseWriter
func ParamsMiddleware ¶
func ParamsMiddleware(params types.UpgradeServiceParams) mux.MiddlewareFunc
func RegisterAPIRoutes ¶
func RegisterAPIRoutes(r *mux.Router, handler UpgradeServiceHandler)
func SetContextParams ¶
Types ¶
type CurrentConfigResponse ¶
type CurrentConfigResponse struct { Success bool `json:"success"` Error string `json:"error,omitempty"` ConfigGroups []kotsv1beta1.ConfigGroup `json:"configGroups"` ValidationErrors []configtypes.ConfigGroupValidationError `json:"validationErrors,omitempty"` }
type DeployRequest ¶
type DeployResponse ¶
type GetPreflightResultResponse ¶
type GetPreflightResultResponse struct { PreflightProgress string `json:"preflightProgress,omitempty"` PreflightResult preflighttypes.PreflightResult `json:"preflightResult"` }
type Handler ¶
type Handler struct { }
func (*Handler) CurrentConfig ¶
func (h *Handler) CurrentConfig(w http.ResponseWriter, r *http.Request)
func (*Handler) DownloadFileFromConfig ¶
func (h *Handler) DownloadFileFromConfig(w http.ResponseWriter, r *http.Request)
func (*Handler) GetPreflightResult ¶
func (h *Handler) GetPreflightResult(w http.ResponseWriter, r *http.Request)
func (*Handler) LiveConfig ¶
func (h *Handler) LiveConfig(w http.ResponseWriter, r *http.Request)
func (*Handler) SaveConfig ¶
func (h *Handler) SaveConfig(w http.ResponseWriter, r *http.Request)
func (*Handler) StartPreflightChecks ¶
func (h *Handler) StartPreflightChecks(w http.ResponseWriter, r *http.Request)
type InfoResponse ¶
type LiveConfigRequest ¶
type LiveConfigRequest struct {
ConfigGroups []kotsv1beta1.ConfigGroup `json:"configGroups"`
}
type LiveConfigResponse ¶
type LiveConfigResponse struct { Success bool `json:"success"` Error string `json:"error,omitempty"` ConfigGroups []kotsv1beta1.ConfigGroup `json:"configGroups"` ValidationErrors []configtypes.ConfigGroupValidationError `json:"validationErrors,omitempty"` }
type PingResponse ¶
type PingResponse struct {
Ping string `json:"ping"`
}
type SPAHandler ¶
type SPAHandler struct { }
SPAHandler implements the http.Handler interface, so we can use it to respond to HTTP requests. The path to the static directory and path to the index file within that static directory are used to serve the SPA in the given static directory.
func (SPAHandler) ServeHTTP ¶
func (h SPAHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP inspects the URL path to locate a file within the static dir on the SPA handler. If a file is found, it will be served. If not, the file located at the index path on the SPA handler will be served. This is suitable behavior for serving an SPA (single page application).
type SaveConfigRequest ¶
type SaveConfigRequest struct {
ConfigGroups []kotsv1beta1.ConfigGroup `json:"configGroups"`
}
type SaveConfigResponse ¶
type SaveConfigResponse struct { Success bool `json:"success"` Error string `json:"error,omitempty"` RequiredItems []string `json:"requiredItems,omitempty"` ValidationErrors []configtypes.ConfigGroupValidationError `json:"validationErrors,omitempty"` }
type StatusNotFoundHandler ¶
type StatusNotFoundHandler struct { }
func (StatusNotFoundHandler) ServeHTTP ¶
func (h StatusNotFoundHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type UpgradeServiceHandler ¶
type UpgradeServiceHandler interface { Info(w http.ResponseWriter, r *http.Request) Ping(w http.ResponseWriter, r *http.Request) CurrentConfig(w http.ResponseWriter, r *http.Request) LiveConfig(w http.ResponseWriter, r *http.Request) SaveConfig(w http.ResponseWriter, r *http.Request) DownloadFileFromConfig(w http.ResponseWriter, r *http.Request) StartPreflightChecks(w http.ResponseWriter, r *http.Request) GetPreflightResult(w http.ResponseWriter, r *http.Request) Deploy(w http.ResponseWriter, r *http.Request) }
Click to show internal directories.
Click to hide internal directories.