Documentation
¶
Index ¶
- func BuildHTTPHandler(r *mux.Router) http.Handler
- func BuildRouter() *mux.Router
- func CorrellationID(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
- func DeployRoute(r *mux.Router, logger log.Logger, controller *deploy.Controller, ...)
- func LastOperation(r *mux.Router, statusRet StatusRetriever, logger log.Logger)
- func Metrics(r *mux.Router)
- func SysRoute(r *mux.Router)
- func Templates(r *mux.Router, templateLoader deploy.TemplateLoader, ...)
- type Auth
- type Deploy
- type DeployClientFactory
- type LastOperationHandler
- type StatusRetriever
- type SysHandler
- type TemplateHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildHTTPHandler ¶
BuildHTTPHandler constructs a http.Handler it is also where common middleware is added via negroni
func BuildRouter ¶
BuildRouter is the main place we build the mux router
func CorrellationID ¶
func CorrellationID(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
CorrellationID handles setting a requestid on the request and response
func DeployRoute ¶
func DeployRoute(r *mux.Router, logger log.Logger, controller *deploy.Controller, clientFactory DeployClientFactory)
DeployRoute sets up the deploy route. Note if we were to turn this into a broker it would become the provision endpoint PUT /v2/service_instances/:instance_id
func LastOperation ¶
func LastOperation(r *mux.Router, statusRet StatusRetriever, logger log.Logger)
LastOperation sets up the LastOperationHandler and route that is used to retrieve the last operation and status of an operation performed on a service
func Templates ¶
func Templates(r *mux.Router, templateLoader deploy.TemplateLoader, clientfactory DeployClientFactory)
Templates sets up the template route handler for the web interface
Types ¶
type Auth ¶
type Auth struct {
// contains filtered or unexported fields
}
Auth handles auth
func (Auth) Auth ¶
func (a Auth) Auth(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
Auth handles authenticating requests
type Deploy ¶
type Deploy struct {
// contains filtered or unexported fields
}
Deploy handles deploying to OpenShift
func NewDeployHandler ¶
func NewDeployHandler(logger log.Logger, deployController *deploy.Controller, clientFactory DeployClientFactory) Deploy
NewDeployHandler creates a cloudApp controller.
type DeployClientFactory ¶
type DeployClientFactory interface {
DefaultDeployClient(host, token string) (deploy.Client, error)
}
DeployClientFactory defines how we want to get our OSCP and Kubernetes client
type LastOperationHandler ¶
type LastOperationHandler struct {
// contains filtered or unexported fields
}
LastOperationHandler handles returning the status of the last operation on a service. For example a provision
func NewLastOperationHandler ¶
func NewLastOperationHandler(statusRet StatusRetriever, logger log.Logger) LastOperationHandler
NewLastOperationHandler return a snew LastOperationHandler
func (LastOperationHandler) LastOperation ¶
func (lah LastOperationHandler) LastOperation(rw http.ResponseWriter, req *http.Request)
LastOperation handle the LastOperation requests
type StatusRetriever ¶
StatusRetriever defines how deploy status should be retrieved
type SysHandler ¶
type SysHandler struct{}
SysHandler is the handler for the /sys route
func (SysHandler) Health ¶
func (s SysHandler) Health(res http.ResponseWriter, req *http.Request)
Health checks dependencies and responds if the sevice feels it is healthy
func (SysHandler) Ping ¶
func (s SysHandler) Ping(res http.ResponseWriter, req *http.Request)
Ping is a simple liveliness check
type TemplateHandler ¶
type TemplateHandler struct {
// contains filtered or unexported fields
}
TemplateHandler is the handler for the /services/template route
func NewTemplateHandler ¶
func NewTemplateHandler(tl deploy.TemplateLoader, clientFactory DeployClientFactory) TemplateHandler
NewTemplateHandler creates a template controller.
func (TemplateHandler) MarkServices ¶
func (s TemplateHandler) MarkServices(res http.ResponseWriter, req *http.Request)
MarkServices all service templates that are deployed in an environment (label 'deployed' to true)