Back to godoc.org

Package handlers

v0.0.0-...-bf245c4
Latest Go to latest

The latest major version is .

Published: Jul 1, 2020 | License: Apache-2.0 | Module: code.cloudfoundry.org/routing-api

Index

Constants

const (
	RouterGroupsReadScope   = "routing.router_groups.read"
	RouterGroupsWriteScope  = "routing.router_groups.write"
	RoutingRoutesReadScope  = "routing.routes.read"
	RoutingRoutesWriteScope = "routing.routes.write"
)

func LogWrap

func LogWrap(handler http.Handler, logger lager.Logger) http.HandlerFunc

func NewTestRequest

func NewTestRequest(body interface{}) *http.Request

type EventStreamHandler

type EventStreamHandler struct {
	// contains filtered or unexported fields
}

func NewEventStreamHandler

func NewEventStreamHandler(uaaClient uaaclient.Client, database db.DB, logger lager.Logger, stats metrics.PartialStatsdClient) *EventStreamHandler

func (*EventStreamHandler) EventStream

func (h *EventStreamHandler) EventStream(w http.ResponseWriter, req *http.Request)

func (*EventStreamHandler) TcpEventStream

func (h *EventStreamHandler) TcpEventStream(w http.ResponseWriter, req *http.Request)

type RouteValidator

type RouteValidator interface {
	ValidateCreate(routes []models.Route, maxTTL int) *routing_api.Error
	ValidateDelete(routes []models.Route) *routing_api.Error

	ValidateCreateTcpRouteMapping(tcpRouteMappings []models.TcpRouteMapping, routerGroups models.RouterGroups, maxTTL int) *routing_api.Error
	ValidateDeleteTcpRouteMapping(tcpRouteMappings []models.TcpRouteMapping) *routing_api.Error
}

go:generate counterfeiter -o fakes/fake_validator.go . RouteValidator

type RouterGroupsHandler

type RouterGroupsHandler struct {
	// contains filtered or unexported fields
}

func NewRouteGroupsHandler

func NewRouteGroupsHandler(uaaClient uaaclient.Client, logger lager.Logger, db db.DB) *RouterGroupsHandler

func (*RouterGroupsHandler) CreateRouterGroup

func (h *RouterGroupsHandler) CreateRouterGroup(w http.ResponseWriter, req *http.Request)

func (*RouterGroupsHandler) DeleteRouterGroup

func (h *RouterGroupsHandler) DeleteRouterGroup(w http.ResponseWriter, req *http.Request)

func (*RouterGroupsHandler) ListRouterGroups

func (h *RouterGroupsHandler) ListRouterGroups(w http.ResponseWriter, req *http.Request)

func (*RouterGroupsHandler) UpdateRouterGroup

func (h *RouterGroupsHandler) UpdateRouterGroup(w http.ResponseWriter, req *http.Request)

type RoutesHandler

type RoutesHandler struct {
	// contains filtered or unexported fields
}

func NewRoutesHandler

func NewRoutesHandler(uaaClient uaaclient.Client, maxTTL int, validator RouteValidator, database db.DB, logger lager.Logger) *RoutesHandler

func (*RoutesHandler) Delete

func (h *RoutesHandler) Delete(w http.ResponseWriter, req *http.Request)

func (*RoutesHandler) List

func (h *RoutesHandler) List(w http.ResponseWriter, req *http.Request)

func (*RoutesHandler) Upsert

func (h *RoutesHandler) Upsert(w http.ResponseWriter, req *http.Request)

type TcpRouteMappingsHandler

type TcpRouteMappingsHandler struct {
	// contains filtered or unexported fields
}

func NewTcpRouteMappingsHandler

func NewTcpRouteMappingsHandler(uaaClient uaaclient.Client, validator RouteValidator, database db.DB, ttl int, logger lager.Logger) *TcpRouteMappingsHandler

func (*TcpRouteMappingsHandler) Delete

func (h *TcpRouteMappingsHandler) Delete(w http.ResponseWriter, req *http.Request)

func (*TcpRouteMappingsHandler) List

func (h *TcpRouteMappingsHandler) List(w http.ResponseWriter, req *http.Request)

func (*TcpRouteMappingsHandler) Upsert

func (h *TcpRouteMappingsHandler) Upsert(w http.ResponseWriter, req *http.Request)

type Validator

type Validator struct{}

func NewValidator

func NewValidator() Validator

func (Validator) ValidateCreate

func (v Validator) ValidateCreate(routes []models.Route, maxTTL int) *routing_api.Error

func (Validator) ValidateCreateTcpRouteMapping

func (v Validator) ValidateCreateTcpRouteMapping(tcpRouteMappings []models.TcpRouteMapping, routerGroups models.RouterGroups, maxTTL int) *routing_api.Error

func (Validator) ValidateDelete

func (v Validator) ValidateDelete(routes []models.Route) *routing_api.Error

func (Validator) ValidateDeleteTcpRouteMapping

func (v Validator) ValidateDeleteTcpRouteMapping(tcpRouteMappings []models.TcpRouteMapping) *routing_api.Error

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier