Documentation ¶
Index ¶
- Constants
- Variables
- type AppHandler
- type ApplyManifestAction
- type AuthAwareHandlerFunc
- type AuthAwareHandlerFuncWrapper
- type AuthInfoParser
- type AuthenticationMiddleware
- type BuildHandler
- type BuildpackHandler
- type BuildpackRepository
- type CFAppRepository
- type CFBuildRepository
- type CFDomainRepository
- type CFDropletRepository
- type CFOrgRepository
- type CFPackageRepository
- type CFProcessRepository
- type CFRoleRepository
- type CFRouteRepository
- type CFServiceBindingRepository
- type CFServiceInstanceRepository
- type DecoderValidator
- type DomainHandler
- type DropletHandler
- type FetchProcessStats
- type HandlerResponse
- type IdentityProvider
- type ImageRepository
- type JobHandler
- type LogCacheHandler
- type OrgHandler
- type PackageHandler
- type ProcessHandler
- type ResourceMatchesHandler
- type RoleHandler
- type RoleName
- type RootHandler
- type RootV3Handler
- type RouteHandler
- type ScaleAppProcess
- type ScaleProcess
- type ServiceBindingHandler
- type ServiceInstanceHandler
- type ServiceRouteBindingHandler
- type SpaceHandler
- type SpaceManifestHandler
- type SpaceRepository
- type WhoAmIHandler
Constants ¶
View Source
const ( AppsPath = "/v3/apps" AppPath = "/v3/apps/{guid}" AppCurrentDropletRelationshipPath = "/v3/apps/{guid}/relationships/current_droplet" AppCurrentDropletPath = "/v3/apps/{guid}/droplets/current" AppProcessesPath = "/v3/apps/{guid}/processes" AppProcessByTypePath = "/v3/apps/{guid}/processes/{type}" AppProcessScalePath = "/v3/apps/{guid}/processes/{processType}/actions/scale" AppRoutesPath = "/v3/apps/{guid}/routes" AppStartPath = "/v3/apps/{guid}/actions/start" AppStopPath = "/v3/apps/{guid}/actions/stop" AppRestartPath = "/v3/apps/{guid}/actions/restart" AppEnvVarsPath = "/v3/apps/{guid}/environment_variables" AppEnvPath = "/v3/apps/{guid}/env" AppStartedState = "STARTED" AppStoppedState = "STOPPED" )
View Source
const ( BuildPath = "/v3/builds/{guid}" BuildsPath = "/v3/builds" )
View Source
const ( LogCacheInfoPath = "/api/v1/info" LogCacheReadPath = "/api/v1/read/{guid}" )
View Source
const ( OrgsPath = "/v3/organizations" OrgPath = "/v3/organizations/{guid}" OrgDomainsPath = "/v3/organizations/{guid}/domains" )
View Source
const ( PackagePath = "/v3/packages/{guid}" PackagesPath = "/v3/packages" PackageUploadPath = "/v3/packages/{guid}/upload" PackageDropletsPath = "/v3/packages/{guid}/droplets" )
View Source
const ( ProcessPath = "/v3/processes/{guid}" ProcessSidecarsPath = "/v3/processes/{guid}/sidecars" ProcessScalePath = "/v3/processes/{guid}/actions/scale" ProcessStatsPath = "/v3/processes/{guid}/stats" ProcessesPath = "/v3/processes" )
View Source
const ( RoutePath = "/v3/routes/{guid}" RoutesPath = "/v3/routes" RouteDestinationsPath = "/v3/routes/{guid}/destinations" )
View Source
const ( ServiceBindingsPath = "/v3/service_credential_bindings" ServiceBindingPath = "/v3/service_credential_bindings/{guid}" )
View Source
const ( ServiceInstancesPath = "/v3/service_instances" ServiceInstancePath = "/v3/service_instances/{guid}" )
View Source
const ( SpacesPath = "/v3/spaces" SpacePath = "/v3/spaces/{guid}" )
View Source
const ( SpaceManifestApplyPath = "/v3/spaces/{spaceGUID}/actions/apply_manifest" SpaceManifestDiffPath = "/v3/spaces/{spaceGUID}/manifest_diff" )
View Source
const (
BuildpacksPath = "/v3/buildpacks"
)
View Source
const (
DomainsPath = "/v3/domains"
)
View Source
const (
DropletPath = "/v3/droplets/{guid}"
)
View Source
const (
JobPath = "/v3/jobs/{guid}"
)
View Source
const JobResourceType = "Job"
View Source
const (
ResourceMatchesPath = "/v3/resource_matches"
)
View Source
const (
RolesPath = "/v3/roles"
)
View Source
const (
RootPath = "/"
)
View Source
const (
RootV3Path = "/v3"
)
View Source
const (
ServiceRouteBindingsPath = "/v3/service_route_bindings"
)
View Source
const (
WhoAmIPath = "/whoami"
)
Variables ¶
View Source
var Logger = ctrl.Log.WithName("Shared Handler Functions")
Functions ¶
This section is empty.
Types ¶
type AppHandler ¶
type AppHandler struct {
// contains filtered or unexported fields
}
func NewAppHandler ¶
func NewAppHandler( logger logr.Logger, serverURL url.URL, appRepo CFAppRepository, dropletRepo CFDropletRepository, processRepo CFProcessRepository, routeRepo CFRouteRepository, domainRepo CFDomainRepository, spaceRepo SpaceRepository, scaleAppProcessFunc ScaleAppProcess, decoderValidator *DecoderValidator, ) *AppHandler
func (*AppHandler) RegisterRoutes ¶
func (h *AppHandler) RegisterRoutes(router *mux.Router)
type ApplyManifestAction ¶
type AuthAwareHandlerFunc ¶
type AuthAwareHandlerFunc func(authInfo authorization.Info, r *http.Request) (*HandlerResponse, error)
type AuthAwareHandlerFuncWrapper ¶
type AuthAwareHandlerFuncWrapper struct {
// contains filtered or unexported fields
}
func NewAuthAwareHandlerFuncWrapper ¶
func NewAuthAwareHandlerFuncWrapper(logger logr.Logger) *AuthAwareHandlerFuncWrapper
func (*AuthAwareHandlerFuncWrapper) Wrap ¶
func (wrapper *AuthAwareHandlerFuncWrapper) Wrap(delegate AuthAwareHandlerFunc) http.HandlerFunc
type AuthInfoParser ¶
type AuthInfoParser interface {
Parse(authHeader string) (authorization.Info, error)
}
type AuthenticationMiddleware ¶
type AuthenticationMiddleware struct {
// contains filtered or unexported fields
}
func NewAuthenticationMiddleware ¶
func NewAuthenticationMiddleware(logger logr.Logger, authInfoParser AuthInfoParser, identityProvider IdentityProvider) *AuthenticationMiddleware
func (*AuthenticationMiddleware) Middleware ¶
func (a *AuthenticationMiddleware) Middleware(next http.Handler) http.Handler
type BuildHandler ¶
type BuildHandler struct {
// contains filtered or unexported fields
}
func NewBuildHandler ¶
func NewBuildHandler( logger logr.Logger, serverURL url.URL, buildRepo CFBuildRepository, packageRepo CFPackageRepository, decoderValidator *DecoderValidator, ) *BuildHandler
func (*BuildHandler) RegisterRoutes ¶
func (h *BuildHandler) RegisterRoutes(router *mux.Router)
type BuildpackHandler ¶
type BuildpackHandler struct {
// contains filtered or unexported fields
}
func NewBuildpackHandler ¶
func NewBuildpackHandler( logger logr.Logger, serverURL url.URL, buildpackRepo BuildpackRepository, clusterBuilderName string, ) *BuildpackHandler
func (*BuildpackHandler) RegisterRoutes ¶
func (h *BuildpackHandler) RegisterRoutes(router *mux.Router)
type BuildpackRepository ¶
type BuildpackRepository interface {
GetBuildpacksForBuilder(ctx context.Context, authInfo authorization.Info, builderName string) ([]repositories.BuildpackRecord, error)
}
type CFAppRepository ¶
type CFAppRepository interface { GetApp(context.Context, authorization.Info, string) (repositories.AppRecord, error) ListApps(context.Context, authorization.Info, repositories.ListAppsMessage) ([]repositories.AppRecord, error) PatchAppEnvVars(context.Context, authorization.Info, repositories.PatchAppEnvVarsMessage) (repositories.AppEnvVarsRecord, error) CreateApp(context.Context, authorization.Info, repositories.CreateAppMessage) (repositories.AppRecord, error) SetCurrentDroplet(context.Context, authorization.Info, repositories.SetCurrentDropletMessage) (repositories.CurrentDropletRecord, error) SetAppDesiredState(context.Context, authorization.Info, repositories.SetAppDesiredStateMessage) (repositories.AppRecord, error) DeleteApp(context.Context, authorization.Info, repositories.DeleteAppMessage) error GetAppEnv(context.Context, authorization.Info, string) (map[string]string, error) }
type CFBuildRepository ¶
type CFBuildRepository interface { GetBuild(context.Context, authorization.Info, string) (repositories.BuildRecord, error) CreateBuild(context.Context, authorization.Info, repositories.CreateBuildMessage) (repositories.BuildRecord, error) }
type CFDomainRepository ¶
type CFDomainRepository interface { GetDomain(context.Context, authorization.Info, string) (repositories.DomainRecord, error) ListDomains(context.Context, authorization.Info, repositories.ListDomainsMessage) ([]repositories.DomainRecord, error) }
type CFDropletRepository ¶
type CFDropletRepository interface { GetDroplet(context.Context, authorization.Info, string) (repositories.DropletRecord, error) ListDroplets(context.Context, authorization.Info, repositories.ListDropletsMessage) ([]repositories.DropletRecord, error) }
type CFOrgRepository ¶
type CFOrgRepository interface { CreateOrg(context.Context, authorization.Info, repositories.CreateOrgMessage) (repositories.OrgRecord, error) ListOrgs(context.Context, authorization.Info, repositories.ListOrgsMessage) ([]repositories.OrgRecord, error) DeleteOrg(context.Context, authorization.Info, repositories.DeleteOrgMessage) error GetOrg(context.Context, authorization.Info, string) (repositories.OrgRecord, error) }
type CFPackageRepository ¶
type CFPackageRepository interface { GetPackage(context.Context, authorization.Info, string) (repositories.PackageRecord, error) ListPackages(context.Context, authorization.Info, repositories.ListPackagesMessage) ([]repositories.PackageRecord, error) CreatePackage(context.Context, authorization.Info, repositories.CreatePackageMessage) (repositories.PackageRecord, error) UpdatePackageSource(context.Context, authorization.Info, repositories.UpdatePackageSourceMessage) (repositories.PackageRecord, error) }
type CFProcessRepository ¶
type CFProcessRepository interface { GetProcess(context.Context, authorization.Info, string) (repositories.ProcessRecord, error) ListProcesses(context.Context, authorization.Info, repositories.ListProcessesMessage) ([]repositories.ProcessRecord, error) GetProcessByAppTypeAndSpace(context.Context, authorization.Info, string, string, string) (repositories.ProcessRecord, error) PatchProcess(context.Context, authorization.Info, repositories.PatchProcessMessage) (repositories.ProcessRecord, error) }
type CFRoleRepository ¶
type CFRoleRepository interface {
CreateRole(context.Context, authorization.Info, repositories.CreateRoleMessage) (repositories.RoleRecord, error)
}
type CFRouteRepository ¶
type CFRouteRepository interface { GetRoute(context.Context, authorization.Info, string) (repositories.RouteRecord, error) ListRoutes(context.Context, authorization.Info, repositories.ListRoutesMessage) ([]repositories.RouteRecord, error) ListRoutesForApp(context.Context, authorization.Info, string, string) ([]repositories.RouteRecord, error) CreateRoute(context.Context, authorization.Info, repositories.CreateRouteMessage) (repositories.RouteRecord, error) DeleteRoute(context.Context, authorization.Info, repositories.DeleteRouteMessage) error AddDestinationsToRoute(ctx context.Context, c authorization.Info, message repositories.AddDestinationsToRouteMessage) (repositories.RouteRecord, error) }
type CFServiceBindingRepository ¶
type CFServiceBindingRepository interface { CreateServiceBinding(context.Context, authorization.Info, repositories.CreateServiceBindingMessage) (repositories.ServiceBindingRecord, error) DeleteServiceBinding(context.Context, authorization.Info, string) error ServiceBindingExists(ctx context.Context, info authorization.Info, spaceGUID, appGUID, serviceInsanceGUID string) (bool, error) ListServiceBindings(context.Context, authorization.Info, repositories.ListServiceBindingsMessage) ([]repositories.ServiceBindingRecord, error) }
type CFServiceInstanceRepository ¶
type CFServiceInstanceRepository interface { CreateServiceInstance(context.Context, authorization.Info, repositories.CreateServiceInstanceMessage) (repositories.ServiceInstanceRecord, error) ListServiceInstances(context.Context, authorization.Info, repositories.ListServiceInstanceMessage) ([]repositories.ServiceInstanceRecord, error) GetServiceInstance(context.Context, authorization.Info, string) (repositories.ServiceInstanceRecord, error) DeleteServiceInstance(context.Context, authorization.Info, repositories.DeleteServiceInstanceMessage) error }
type DecoderValidator ¶
type DecoderValidator struct {
// contains filtered or unexported fields
}
func NewDefaultDecoderValidator ¶
func NewDefaultDecoderValidator() (*DecoderValidator, error)
func (*DecoderValidator) DecodeAndValidateJSONPayload ¶
func (dv *DecoderValidator) DecodeAndValidateJSONPayload(r *http.Request, object interface{}) error
func (*DecoderValidator) DecodeAndValidateYAMLPayload ¶
func (dv *DecoderValidator) DecodeAndValidateYAMLPayload(r *http.Request, object interface{}) error
type DomainHandler ¶
type DomainHandler struct {
// contains filtered or unexported fields
}
func NewDomainHandler ¶
func NewDomainHandler( logger logr.Logger, serverURL url.URL, domainRepo CFDomainRepository, ) *DomainHandler
func (*DomainHandler) DomainListHandler ¶
func (h *DomainHandler) DomainListHandler(authInfo authorization.Info, r *http.Request) (*HandlerResponse, error)
func (*DomainHandler) RegisterRoutes ¶
func (h *DomainHandler) RegisterRoutes(router *mux.Router)
type DropletHandler ¶
type DropletHandler struct {
// contains filtered or unexported fields
}
func NewDropletHandler ¶
func NewDropletHandler( logger logr.Logger, serverURL url.URL, dropletRepo CFDropletRepository, ) *DropletHandler
func (*DropletHandler) RegisterRoutes ¶
func (h *DropletHandler) RegisterRoutes(router *mux.Router)
type FetchProcessStats ¶
type FetchProcessStats func(context.Context, authorization.Info, string) ([]repositories.PodStatsRecord, error)
type HandlerResponse ¶
type HandlerResponse struct {
// contains filtered or unexported fields
}
func NewHandlerResponse ¶
func NewHandlerResponse(httpStatus int) *HandlerResponse
func (*HandlerResponse) WithBody ¶
func (r *HandlerResponse) WithBody(body interface{}) *HandlerResponse
func (*HandlerResponse) WithHeader ¶
func (r *HandlerResponse) WithHeader(key, value string) *HandlerResponse
type IdentityProvider ¶
type IdentityProvider interface {
GetIdentity(context.Context, authorization.Info) (authorization.Identity, error)
}
type ImageRepository ¶
type JobHandler ¶
type JobHandler struct {
// contains filtered or unexported fields
}
func NewJobHandler ¶
func NewJobHandler(logger logr.Logger, serverURL url.URL) *JobHandler
func (*JobHandler) RegisterRoutes ¶
func (h *JobHandler) RegisterRoutes(router *mux.Router)
type LogCacheHandler ¶
type LogCacheHandler struct{}
LogCacheHandler implements the minimal set of log-cache API endpoints/features necessary to support the "cf push" workflow. It does not support actually fetching and returning application logs at this time
func NewLogCacheHandler ¶
func NewLogCacheHandler() *LogCacheHandler
func (*LogCacheHandler) RegisterRoutes ¶
func (h *LogCacheHandler) RegisterRoutes(router *mux.Router)
type OrgHandler ¶
type OrgHandler struct {
// contains filtered or unexported fields
}
func NewOrgHandler ¶
func NewOrgHandler(apiBaseURL url.URL, orgRepo CFOrgRepository, domainRepo CFDomainRepository, decoderValidator *DecoderValidator) *OrgHandler
func (*OrgHandler) RegisterRoutes ¶
func (h *OrgHandler) RegisterRoutes(router *mux.Router)
type PackageHandler ¶
type PackageHandler struct {
// contains filtered or unexported fields
}
func NewPackageHandler ¶
func NewPackageHandler( logger logr.Logger, serverURL url.URL, packageRepo CFPackageRepository, appRepo CFAppRepository, dropletRepo CFDropletRepository, imageRepo ImageRepository, decoderValidator *DecoderValidator, registryBase string, registrySecretName string, ) *PackageHandler
func (*PackageHandler) RegisterRoutes ¶
func (h *PackageHandler) RegisterRoutes(router *mux.Router)
type ProcessHandler ¶
type ProcessHandler struct {
// contains filtered or unexported fields
}
func NewProcessHandler ¶
func NewProcessHandler( logger logr.Logger, serverURL url.URL, processRepo CFProcessRepository, fetchProcessStats FetchProcessStats, scaleProcessFunc ScaleProcess, decoderValidator *DecoderValidator, ) *ProcessHandler
func (*ProcessHandler) RegisterRoutes ¶
func (h *ProcessHandler) RegisterRoutes(router *mux.Router)
type ResourceMatchesHandler ¶
type ResourceMatchesHandler struct {
// contains filtered or unexported fields
}
func NewResourceMatchesHandler ¶
func NewResourceMatchesHandler(logger logr.Logger) *ResourceMatchesHandler
func (*ResourceMatchesHandler) RegisterRoutes ¶
func (h *ResourceMatchesHandler) RegisterRoutes(router *mux.Router)
type RoleHandler ¶
type RoleHandler struct {
// contains filtered or unexported fields
}
func NewRoleHandler ¶
func NewRoleHandler(apiBaseURL url.URL, roleRepo CFRoleRepository, decoderValidator *DecoderValidator) *RoleHandler
func (*RoleHandler) RegisterRoutes ¶
func (h *RoleHandler) RegisterRoutes(router *mux.Router)
type RoleName ¶
type RoleName string
const ( RoleAdmin RoleName = "admin" RoleAdminReadOnly RoleName = "admin_read_only" RoleGlobalAuditor RoleName = "global_auditor" RoleOrganizationAuditor RoleName = "organization_auditor" RoleOrganizationBillingManager RoleName = "organization_billing_manager" RoleOrganizationManager RoleName = "organization_manager" RoleOrganizationUser RoleName = "organization_user" RoleSpaceAuditor RoleName = "space_auditor" RoleSpaceDeveloper RoleName = "space_developer" RoleSpaceManager RoleName = "space_manager" RoleSpaceSupporter RoleName = "space_supporter" )
type RootHandler ¶
type RootHandler struct {
// contains filtered or unexported fields
}
func NewRootHandler ¶
func NewRootHandler(serverURL string) *RootHandler
func (*RootHandler) RegisterRoutes ¶
func (h *RootHandler) RegisterRoutes(router *mux.Router)
type RootV3Handler ¶
type RootV3Handler struct {
// contains filtered or unexported fields
}
func NewRootV3Handler ¶
func NewRootV3Handler(serverURL string) *RootV3Handler
func (*RootV3Handler) RegisterRoutes ¶
func (h *RootV3Handler) RegisterRoutes(router *mux.Router)
type RouteHandler ¶
type RouteHandler struct {
// contains filtered or unexported fields
}
func NewRouteHandler ¶
func NewRouteHandler( logger logr.Logger, serverURL url.URL, routeRepo CFRouteRepository, domainRepo CFDomainRepository, appRepo CFAppRepository, spaceRepo SpaceRepository, decoderValidator *DecoderValidator, ) *RouteHandler
func (*RouteHandler) RegisterRoutes ¶
func (h *RouteHandler) RegisterRoutes(router *mux.Router)
type ScaleAppProcess ¶
type ScaleAppProcess func(ctx context.Context, authInfo authorization.Info, appGUID string, processType string, scale repositories.ProcessScaleValues) (repositories.ProcessRecord, error)
type ScaleProcess ¶
type ScaleProcess func(ctx context.Context, authInfo authorization.Info, processGUID string, scale repositories.ProcessScaleValues) (repositories.ProcessRecord, error)
type ServiceBindingHandler ¶
type ServiceBindingHandler struct {
// contains filtered or unexported fields
}
func NewServiceBindingHandler ¶
func NewServiceBindingHandler(logger logr.Logger, serverURL url.URL, serviceBindingRepo CFServiceBindingRepository, appRepo CFAppRepository, serviceInstanceRepo CFServiceInstanceRepository, decoderValidator *DecoderValidator) *ServiceBindingHandler
func (*ServiceBindingHandler) RegisterRoutes ¶
func (h *ServiceBindingHandler) RegisterRoutes(router *mux.Router)
type ServiceInstanceHandler ¶
type ServiceInstanceHandler struct {
// contains filtered or unexported fields
}
func NewServiceInstanceHandler ¶
func NewServiceInstanceHandler( logger logr.Logger, serverURL url.URL, serviceInstanceRepo CFServiceInstanceRepository, spaceRepo SpaceRepository, decoderValidator *DecoderValidator, ) *ServiceInstanceHandler
func (*ServiceInstanceHandler) RegisterRoutes ¶
func (h *ServiceInstanceHandler) RegisterRoutes(router *mux.Router)
type ServiceRouteBindingHandler ¶
type ServiceRouteBindingHandler struct {
// contains filtered or unexported fields
}
func NewServiceRouteBindingHandler ¶
func NewServiceRouteBindingHandler( logger logr.Logger, serverURL url.URL, ) *ServiceRouteBindingHandler
func (*ServiceRouteBindingHandler) RegisterRoutes ¶
func (h *ServiceRouteBindingHandler) RegisterRoutes(router *mux.Router)
type SpaceHandler ¶
type SpaceHandler struct {
// contains filtered or unexported fields
}
func NewSpaceHandler ¶
func NewSpaceHandler(apiBaseURL url.URL, imageRegistrySecretName string, spaceRepo SpaceRepository, decoderValidator *DecoderValidator) *SpaceHandler
func (*SpaceHandler) RegisterRoutes ¶
func (h *SpaceHandler) RegisterRoutes(router *mux.Router)
type SpaceManifestHandler ¶
type SpaceManifestHandler struct {
// contains filtered or unexported fields
}
func NewSpaceManifestHandler ¶
func NewSpaceManifestHandler( logger logr.Logger, serverURL url.URL, defaultDomainName string, applyManifestAction ApplyManifestAction, spaceRepo repositories.CFSpaceRepository, decoderValidator *DecoderValidator, ) *SpaceManifestHandler
func (*SpaceManifestHandler) RegisterRoutes ¶
func (h *SpaceManifestHandler) RegisterRoutes(router *mux.Router)
type SpaceRepository ¶
type SpaceRepository interface { CreateSpace(context.Context, authorization.Info, repositories.CreateSpaceMessage) (repositories.SpaceRecord, error) ListSpaces(context.Context, authorization.Info, repositories.ListSpacesMessage) ([]repositories.SpaceRecord, error) GetSpace(context.Context, authorization.Info, string) (repositories.SpaceRecord, error) DeleteSpace(context.Context, authorization.Info, repositories.DeleteSpaceMessage) error }
type WhoAmIHandler ¶
type WhoAmIHandler struct {
// contains filtered or unexported fields
}
func NewWhoAmI ¶
func NewWhoAmI(identityProvider IdentityProvider, apiBaseURL url.URL) *WhoAmIHandler
func (*WhoAmIHandler) RegisterRoutes ¶
func (h *WhoAmIHandler) RegisterRoutes(router *mux.Router)
Source Files ¶
- app_handler.go
- auth_aware_handler.go
- authentication_middleware.go
- build_handler.go
- buildpack_handler.go
- domain_handler.go
- droplet_handler.go
- job_handler.go
- log_cache_handler.go
- org_handler.go
- package_handler.go
- process_handler.go
- resource_matches_handler.go
- role_handler.go
- root_handler.go
- root_v3_handler.go
- route_handler.go
- service_binding_handler.go
- service_instance_handler.go
- service_route_binding_handler.go
- shared.go
- space_handler.go
- space_manifest_handler.go
- whoami_handler.go
Click to show internal directories.
Click to hide internal directories.