pushaction

package
v6.32.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2017 License: Apache-2.0 Imports: 13 Imported by: 115

Documentation

Overview

Package pushaction contains the business logic for orchestrating a V2 app push.

Index

Constants

View Source
const PushRetries = 3

Variables

This section is empty.

Functions

This section is empty.

Types

type Actor

type Actor struct {
	V2Actor V2Actor
}

Actor handles all business logic for Cloud Controller v2 operations.

func NewActor

func NewActor(v2Actor V2Actor) *Actor

NewActor returns a new actor.

func (Actor) Apply

func (actor Actor) Apply(config ApplicationConfig, progressBar ProgressBar) (<-chan ApplicationConfig, <-chan Event, <-chan Warnings, <-chan error)

func (Actor) BindRoutes

func (actor Actor) BindRoutes(config ApplicationConfig) (ApplicationConfig, bool, Warnings, error)

func (Actor) BindServices

func (actor Actor) BindServices(config ApplicationConfig) (ApplicationConfig, bool, Warnings, error)

func (Actor) CalculateRoutes

func (actor Actor) CalculateRoutes(routes []string, orgGUID string, spaceGUID string, existingRoutes []v2action.Route) ([]v2action.Route, Warnings, error)

func (Actor) ConvertToApplicationConfigs

func (actor Actor) ConvertToApplicationConfigs(orgGUID string, spaceGUID string, noStart bool, apps []manifest.Application) ([]ApplicationConfig, Warnings, error)

func (Actor) CreateAndBindApplicationRoutes

func (actor Actor) CreateAndBindApplicationRoutes(orgGUID string, spaceGUID string, app v2action.Application) (Warnings, error)

func (Actor) CreateArchive

func (actor Actor) CreateArchive(config ApplicationConfig) (string, error)

func (Actor) CreateOrUpdateApp

func (actor Actor) CreateOrUpdateApp(config ApplicationConfig) (ApplicationConfig, Event, Warnings, error)

func (Actor) CreateRoutes

func (actor Actor) CreateRoutes(config ApplicationConfig) (ApplicationConfig, bool, Warnings, error)

func (Actor) DefaultDomain

func (actor Actor) DefaultDomain(orgGUID string) (v2action.Domain, Warnings, error)

DefaultDomain looks up the shared and then private domains and returns back the first one in the list as the default.

func (Actor) FindOrReturnPartialApp

func (actor Actor) FindOrReturnPartialApp(appName string, spaceGUID string) (bool, Application, v2action.Warnings, error)

func (Actor) GetRouteWithDefaultDomain

func (actor Actor) GetRouteWithDefaultDomain(host string, orgGUID string, spaceGUID string, knownRoutes []v2action.Route) (v2action.Route, Warnings, error)

GetRouteWithDefaultDomain returns a route with the host and the default org domain. This may be a partial route (ie no GUID) if the route does not exist.

func (Actor) MergeAndValidateSettingsAndManifests

func (actor Actor) MergeAndValidateSettingsAndManifests(settings CommandLineSettings, apps []manifest.Application) ([]manifest.Application, error)

func (*Actor) ReadManifest

func (*Actor) ReadManifest(pathToManifest string) ([]manifest.Application, error)

func (Actor) SetMatchedResources

func (actor Actor) SetMatchedResources(config ApplicationConfig) (ApplicationConfig, Warnings)

func (Actor) UploadPackage

func (actor Actor) UploadPackage(config ApplicationConfig, archivePath string, progressbar ProgressBar, eventStream chan<- Event) (Warnings, error)

type AppNotFoundInManifestError

type AppNotFoundInManifestError struct {
	Name string
}

func (AppNotFoundInManifestError) Error

type Application

type Application struct {
	v2action.Application
	Stack v2action.Stack
}

func (*Application) SetStack

func (app *Application) SetStack(stack v2action.Stack)

func (Application) String

func (app Application) String() string

type ApplicationConfig

type ApplicationConfig struct {
	CurrentApplication Application
	DesiredApplication Application

	CurrentRoutes []v2action.Route
	DesiredRoutes []v2action.Route

	CurrentServices map[string]v2action.ServiceInstance
	DesiredServices map[string]v2action.ServiceInstance

	AllResources       []v2action.Resource
	MatchedResources   []v2action.Resource
	UnmatchedResources []v2action.Resource
	Archive            bool
	Path               string

	TargetedSpaceGUID string
}

func (ApplicationConfig) CreatingApplication

func (config ApplicationConfig) CreatingApplication() bool

func (ApplicationConfig) UpdatingApplication

func (config ApplicationConfig) UpdatingApplication() bool

type CommandLineOptionsWithMultipleAppsError

type CommandLineOptionsWithMultipleAppsError struct{}

func (CommandLineOptionsWithMultipleAppsError) Error

type CommandLineSettings

type CommandLineSettings struct {
	Buildpack          types.FilteredString
	Command            types.FilteredString
	CurrentDirectory   string
	DiskQuota          uint64
	DockerImage        string
	DockerPassword     string
	DockerUsername     string
	HealthCheckTimeout int
	HealthCheckType    string
	Instances          types.NullInt
	Memory             uint64
	Name               string
	ProvidedAppPath    string
	StackName          string
}

func (CommandLineSettings) ApplicationPath

func (settings CommandLineSettings) ApplicationPath() string

func (CommandLineSettings) OverrideManifestSettings

func (settings CommandLineSettings) OverrideManifestSettings(app manifest.Application) manifest.Application

func (CommandLineSettings) String

func (settings CommandLineSettings) String() string

type Event

type Event string
const (
	SettingUpApplication Event = "setting up application"
	CreatedApplication   Event = "created application"
	UpdatedApplication   Event = "updated application"
	ConfiguringRoutes    Event = "configuring routes"
	CreatedRoutes        Event = "created routes"
	BoundRoutes          Event = "bound routes"
	ConfiguringServices  Event = "configuring services"
	BoundServices        Event = "bound services"
	CreatingArchive      Event = "creating archive"
	ResourceMatching     Event = "resource matching"
	UploadingApplication Event = "uploading application"
	UploadComplete       Event = "upload complete"
	RetryUpload          Event = "retry upload"
	Complete             Event = "complete"
)

type MissingNameError

type MissingNameError struct{}

func (MissingNameError) Error

func (MissingNameError) Error() string

type NoDomainsFoundError

type NoDomainsFoundError struct {
	OrganizationGUID string
}

NoDomainsFoundError is returned when there are no private or shared domains accessible to an organization.

func (NoDomainsFoundError) Error

func (e NoDomainsFoundError) Error() string

type NonexistentAppPathError

type NonexistentAppPathError struct {
	Path string
}

func (NonexistentAppPathError) Error

func (e NonexistentAppPathError) Error() string

type ProgressBar

type ProgressBar interface {
	NewProgressBarWrapper(reader io.Reader, sizeOfFile int64) io.Reader
}

type UploadFailedError

type UploadFailedError struct {
	Err error
}

func (UploadFailedError) Error

func (UploadFailedError) Error() string

type V2Actor

type V2Actor interface {
	BindRouteToApplication(routeGUID string, appGUID string) (v2action.Warnings, error)
	BindServiceByApplicationAndServiceInstance(appGUID string, serviceInstanceGUID string) (v2action.Warnings, error)
	CreateApplication(application v2action.Application) (v2action.Application, v2action.Warnings, error)
	CreateRoute(route v2action.Route, generatePort bool) (v2action.Route, v2action.Warnings, error)
	FindRouteBoundToSpaceWithSettings(route v2action.Route) (v2action.Route, v2action.Warnings, error)
	GatherArchiveResources(archivePath string) ([]v2action.Resource, error)
	GatherDirectoryResources(sourceDir string) ([]v2action.Resource, error)
	GetApplicationByNameAndSpace(name string, spaceGUID string) (v2action.Application, v2action.Warnings, error)
	GetApplicationRoutes(applicationGUID string) (v2action.Routes, v2action.Warnings, error)
	GetDomainsByNameAndOrganization(domainNames []string, orgGUID string) ([]v2action.Domain, v2action.Warnings, error)
	GetOrganizationDomains(orgGUID string) ([]v2action.Domain, v2action.Warnings, error)
	GetServiceInstanceByNameAndSpace(name string, spaceGUID string) (v2action.ServiceInstance, v2action.Warnings, error)
	GetServiceInstancesByApplication(appGUID string) ([]v2action.ServiceInstance, v2action.Warnings, error)
	GetStack(guid string) (v2action.Stack, v2action.Warnings, error)
	GetStackByName(stackName string) (v2action.Stack, v2action.Warnings, error)
	PollJob(job v2action.Job) (v2action.Warnings, error)
	ResourceMatch(allResources []v2action.Resource) ([]v2action.Resource, []v2action.Resource, v2action.Warnings, error)
	UpdateApplication(application v2action.Application) (v2action.Application, v2action.Warnings, error)
	UploadApplicationPackage(appGUID string, existingResources []v2action.Resource, newResources io.Reader, newResourcesLength int64) (v2action.Job, v2action.Warnings, error)
	ZipArchiveResources(sourceArchivePath string, filesToInclude []v2action.Resource) (string, error)
	ZipDirectoryResources(sourceDir string, filesToInclude []v2action.Resource) (string, error)
}

type Warnings

type Warnings []string

Warnings is a list of warnings returned back from the cloud controller

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