web

package
v0.0.0-...-f35731a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 8, 2017 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildHTTPHandler

func BuildHTTPHandler(r *mux.Router) http.Handler

BuildHTTPHandler constructs a http.Handler it is also where common middleware is added via negroni

func BuildRouter

func BuildRouter() *mux.Router

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 Metrics

func Metrics(r *mux.Router)

Metrics route

func SysRoute

func SysRoute(r *mux.Router)

SysRoute sets up the sys routes

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.

func (Deploy) Deploy

func (d Deploy) Deploy(res http.ResponseWriter, req *http.Request)

Deploy decodes the deploy payload. Pulls together a client which is then used to send generated templates to the OpenShift PaaS

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

type StatusRetriever interface {
	Get(key string) (*status.Status, error)
}

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址