apis

package
v0.0.0-...-d88c78e Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2021 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppCreateEndpoint            = "/v3/apps"
	AppGetEndpoint               = "/v3/apps/{guid}"
	AppListEndpoint              = "/v3/apps"
	AppSetCurrentDropletEndpoint = "/v3/apps/{guid}/relationships/current_droplet"
	AppGetProcessesEndpoint      = "/v3/apps/{guid}/processes"
	AppGetRoutesEndpoint         = "/v3/apps/{guid}/routes"
	AppStartEndpoint             = "/v3/apps/{guid}/actions/start"
	AppStopEndpoint              = "/v3/apps/{guid}/actions/stop"

	AppStartedState = "STARTED"
	AppStoppedState = "STOPPED"
)
View Source
const (
	BuildGetEndpoint    = "/v3/builds/{guid}"
	BuildCreateEndpoint = "/v3/builds"
)
View Source
const (
	PackageCreateEndpoint = "/v3/packages"
	PackageUploadEndpoint = "/v3/packages/{guid}/upload"
)
View Source
const (
	ProcessGetEndpoint         = "/v3/processes/{guid}"
	ProcessGetSidecarsEndpoint = "/v3/processes/{guid}/sidecars"
)
View Source
const (
	RouteGetEndpoint             = "/v3/routes/{guid}"
	RouteGetListEndpoint         = "/v3/routes"
	RouteGetDestinationsEndpoint = "/v3/routes/{guid}/destinations"
	RouteCreateEndpoint          = "/v3/routes"
)
View Source
const (
	DropletGetEndpoint = "/v3/droplets/{guid}"
)
View Source
const (
	OrgListEndpoint = "/v3/organizations"
)
View Source
const (
	ResourceMatchesEndpoint = "/v3/resource_matches"
)
View Source
const (
	RootGetEndpoint = "/"
)
View Source
const (
	RootV3GetEndpoint = "/v3"
)
View Source
const (
	SpacesEndpoint = "/v3/spaces"
)

Variables

View Source
var Logger = ctrl.Log.WithName("Shared Handler Functions")

Functions

func DecodeAndValidatePayload

func DecodeAndValidatePayload(r *http.Request, object interface{}) *requestMalformedError

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,
	buildClient ClientBuilder,
	k8sConfig *rest.Config) *AppHandler

func (*AppHandler) RegisterRoutes

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

type BuildHandler

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

func NewBuildHandler

func NewBuildHandler(
	logger logr.Logger,
	serverURL url.URL,
	buildRepo CFBuildRepository,
	packageRepo CFPackageRepository,
	buildClient ClientBuilder,
	k8sConfig *rest.Config) *BuildHandler

func (*BuildHandler) RegisterRoutes

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

type CFDomainRepository

type CFDomainRepository interface {
	FetchDomain(context.Context, client.Client, string) (repositories.DomainRecord, error)
}

type CFDropletRepository

type CFDropletRepository interface {
	FetchDroplet(context.Context, client.Client, string) (repositories.DropletRecord, error)
}

type CFOrgRepository

type CFOrgRepository interface {
	CreateOrg(context context.Context, org repositories.OrgRecord) (repositories.OrgRecord, error)
	FetchOrgs(context context.Context, orgNames []string) ([]repositories.OrgRecord, error)
}

type CFProcessRepository

type CFProcessRepository interface {
	FetchProcess(context.Context, client.Client, string) (repositories.ProcessRecord, error)
	FetchProcessesForApp(context.Context, client.Client, string, string) ([]repositories.ProcessRecord, error)
}

type CFSpaceRepository

type CFSpaceRepository interface {
	CreateSpace(context.Context, repositories.SpaceRecord) (repositories.SpaceRecord, error)
	FetchSpaces(context.Context, []string, []string) ([]repositories.SpaceRecord, error)
}

type ClientBuilder

type ClientBuilder func(*rest.Config) (client.Client, error)

type DropletHandler

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

func NewDropletHandler

func NewDropletHandler(
	logger logr.Logger,
	serverURL url.URL,
	dropletRepo CFDropletRepository,
	buildClient ClientBuilder,
	k8sConfig *rest.Config) *DropletHandler

func (*DropletHandler) RegisterRoutes

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

type OrgHandler

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

func NewOrgHandler

func NewOrgHandler(apiBaseURL url.URL, orgRepoProvider OrgRepositoryProvider) *OrgHandler

func (*OrgHandler) RegisterRoutes

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

type OrgRepositoryProvider

type OrgRepositoryProvider interface {
	OrgRepoForRequest(request *http.Request) (CFOrgRepository, error)
}

type PackageHandler

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

func NewPackageHandler

func NewPackageHandler(
	logger logr.Logger,
	serverURL url.URL,
	packageRepo CFPackageRepository,
	appRepo CFAppRepository,
	buildClient ClientBuilder,
	uploadSourceImage SourceImageUploader,
	buildRegistryAuth RegistryAuthBuilder,
	k8sConfig *rest.Config,
	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,
	buildClient ClientBuilder,
	k8sConfig *rest.Config) *ProcessHandler

func (*ProcessHandler) LogError

func (h *ProcessHandler) LogError(w http.ResponseWriter, processGUID string, err error)

func (*ProcessHandler) RegisterRoutes

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

type RegistryAuthBuilder

type RegistryAuthBuilder func(ctx context.Context) (remote.Option, error)

type ResourceMatchesHandler

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

func NewResourceMatchesHandler

func NewResourceMatchesHandler(serverURL string) *ResourceMatchesHandler

func (*ResourceMatchesHandler) RegisterRoutes

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

type RootHandler

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

func NewRootHandler

func NewRootHandler(logger logr.Logger, 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,
	buildClient ClientBuilder,
	k8sConfig *rest.Config) *RouteHandler

func (*RouteHandler) RegisterRoutes

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

type SourceImageUploader

type SourceImageUploader func(imageRef string, packageSrcFile multipart.File, credentialOption remote.Option) (imageRefWithDigest string, err error)

type SpaceHandler

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

func NewSpaceHandler

func NewSpaceHandler(spaceRepo CFSpaceRepository, apiBaseURL url.URL) *SpaceHandler

func (*SpaceHandler) RegisterRoutes

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

func (*SpaceHandler) SpaceCreateHandler

func (h *SpaceHandler) SpaceCreateHandler(w http.ResponseWriter, r *http.Request)

func (*SpaceHandler) SpaceListHandler

func (h *SpaceHandler) SpaceListHandler(w http.ResponseWriter, r *http.Request)

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