handlers

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2022 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

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"
	RouteDestinationPath  = "/v3/routes/{guid}/destinations/{destination_guid}"
)
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 (
	TasksPath                = "/v3/apps/{appGUID}/tasks"
	TaskRoot                 = "/v3/tasks"
	TaskPath                 = TaskRoot + "/{taskGUID}"
	TaskCancelPath           = TaskRoot + "/{taskGUID}/actions/cancel"
	TaskCancelPathDeprecated = TaskRoot + "/{taskGUID}/cancel"
)
View Source
const (
	BuildpacksPath = "/v3/buildpacks"
)
View Source
const CorrelationIDHeader = "X-Correlation-ID"
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 (
	OAuthTokenPath = "/oauth/token"
)
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

This section is empty.

Functions

This section is empty.

Types

type AppHandler

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

func NewAppHandler

func NewAppHandler(
	serverURL url.URL,
	appRepo CFAppRepository,
	dropletRepo CFDropletRepository,
	processRepo CFProcessRepository,
	routeRepo CFRouteRepository,
	domainRepo CFDomainRepository,
	spaceRepo SpaceRepository,
	appProcessScaler AppProcessScaler,
	decoderValidator *DecoderValidator,
) *AppHandler

func (*AppHandler) RegisterRoutes

func (h *AppHandler) RegisterRoutes(router *mux.Router)

type AppLogsReader

type AppLogsReader interface {
	Read(ctx context.Context, logger logr.Logger, authInfo authorization.Info, appGUID string, read payloads.LogRead) ([]repositories.LogRecord, error)
}

type AppProcessScaler

type AppProcessScaler interface {
	ScaleAppProcess(ctx context.Context, authInfo authorization.Info, appGUID string, processType string, scale repositories.ProcessScaleValues) (repositories.ProcessRecord, error)
}

type AuthAwareHandlerFunc

type AuthAwareHandlerFunc func(ctx context.Context, logger logr.Logger, 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 NewUnauthenticatedHandlerFuncWrapper

func NewUnauthenticatedHandlerFuncWrapper(logger logr.Logger) *AuthAwareHandlerFuncWrapper

func (*AuthAwareHandlerFuncWrapper) Wrap

type AuthInfoParser

type AuthInfoParser interface {
	Parse(authHeader string) (authorization.Info, error)
}

type AuthInfoProvider

type AuthInfoProvider func(ctx context.Context) (authorization.Info, bool)

type AuthenticationMiddleware

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

func NewAuthenticationMiddleware

func NewAuthenticationMiddleware(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(
	serverURL url.URL,
	buildRepo CFBuildRepository,
	packageRepo CFPackageRepository,
	appRepo CFAppRepository,
	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(
	serverURL url.URL,
	buildpackRepo BuildpackRepository,
) *BuildpackHandler

func (*BuildpackHandler) RegisterRoutes

func (h *BuildpackHandler) RegisterRoutes(router *mux.Router)

type BuildpackRepository

type BuildpackRepository interface {
	ListBuildpacks(ctx context.Context, authInfo authorization.Info) ([]repositories.BuildpackRecord, error)
}

type CFRoleRepository

type CFRoleRepository interface {
	CreateRole(context.Context, authorization.Info, repositories.CreateRoleMessage) (repositories.RoleRecord, error)
}

type CorrelationIDMiddleware

type CorrelationIDMiddleware struct{}

func NewCorrelationIDMiddleware

func NewCorrelationIDMiddleware() CorrelationIDMiddleware

func (CorrelationIDMiddleware) Middleware

func (a CorrelationIDMiddleware) Middleware(next http.Handler) http.Handler

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(
	serverURL url.URL,
	domainRepo CFDomainRepository,
) *DomainHandler

func (*DomainHandler) DomainListHandler

func (h *DomainHandler) DomainListHandler(ctx context.Context, logger logr.Logger, 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(
	serverURL url.URL,
	dropletRepo CFDropletRepository,
) *DropletHandler

func (*DropletHandler) RegisterRoutes

func (h *DropletHandler) RegisterRoutes(router *mux.Router)

type HTTPLogging

type HTTPLogging struct{}

func NewHTTPLogging

func NewHTTPLogging() HTTPLogging

func (HTTPLogging) Middleware

func (l HTTPLogging) Middleware(next http.Handler) http.Handler

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 ImageRepository interface {
	UploadSourceImage(ctx context.Context, authInfo authorization.Info, imageRef string, srcReader io.Reader, spaceGUID string) (imageRefWithDigest string, err error)
}

type JobHandler

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

func NewJobHandler

func NewJobHandler(serverURL url.URL) *JobHandler

func (*JobHandler) RegisterRoutes

func (h *JobHandler) RegisterRoutes(router *mux.Router)

type LogCacheHandler

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

LogCacheHandler implements the minimal set of log-cache API endpoints/features necessary to support the "cf push" workfloh.handlerWrapper.

func NewLogCacheHandler

func NewLogCacheHandler(
	appRepo CFAppRepository,
	buildRepository CFBuildRepository,
	appLogsReader AppLogsReader,
) *LogCacheHandler

func (*LogCacheHandler) RegisterRoutes

func (h *LogCacheHandler) RegisterRoutes(router *mux.Router)

type ManifestApplier

type ManifestApplier interface {
	Apply(ctx context.Context, authInfo authorization.Info, spaceGUID string, manifest payloads.Manifest) error
}

type OAuthTokenHandler

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

func NewOAuthToken

func NewOAuthToken(apiBaseURL url.URL) *OAuthTokenHandler

func (*OAuthTokenHandler) RegisterRoutes

func (h *OAuthTokenHandler) 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, userCertificateExpirationWarningDuration time.Duration) *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(
	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(
	serverURL url.URL,
	processRepo CFProcessRepository,
	processStatsFetcher ProcessStatsFetcher,
	scaleProcessFunc ProcessScaler,
	decoderValidator *DecoderValidator,
) *ProcessHandler

func (*ProcessHandler) RegisterRoutes

func (h *ProcessHandler) RegisterRoutes(router *mux.Router)

type ProcessScaler

type ProcessScaler interface {
	ScaleProcess(ctx context.Context, authInfo authorization.Info, processGUID string, scale repositories.ProcessScaleValues) (repositories.ProcessRecord, error)
}

type ProcessStatsFetcher

type ProcessStatsFetcher interface {
	FetchStats(context.Context, authorization.Info, string) ([]repositories.PodStatsRecord, error)
}

type ResourceMatchesHandler

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

func NewResourceMatchesHandler

func NewResourceMatchesHandler() *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(
	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 ServiceBindingHandler

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

func NewServiceBindingHandler

func NewServiceBindingHandler(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(
	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(
	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(
	serverURL url.URL,
	manifestApplier ManifestApplier,
	spaceRepo CFSpaceRepository,
	decoderValidator *DecoderValidator,
) *SpaceManifestHandler

func (*SpaceManifestHandler) RegisterRoutes

func (h *SpaceManifestHandler) RegisterRoutes(router *mux.Router)

type TaskHandler

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

func NewTaskHandler

func NewTaskHandler(
	serverURL url.URL,
	appRepo CFAppRepository,
	taskRepo CFTaskRepository,
	decoderValidator *DecoderValidator,
) *TaskHandler

func (*TaskHandler) RegisterRoutes

func (h *TaskHandler) RegisterRoutes(router *mux.Router)

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)

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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