Documentation ¶
Index ¶
Constants ¶
View Source
const (
APP_NAME_PATTERN = "^[a-z][a-z0-9-]*$"
)
Variables ¶
View Source
var ( ErrInvalidAppName = errors.New("invalid application name") ErrAppAlreadyDeployed = errors.New("application is already deployed") ErrAppAlreadyBeingDeployed = errors.New("application is already being deployed") ErrAppStillStopping = errors.New("application is still stopping") ErrFailedAppModulePreparation = errors.New("failed to prepare application module") ErrFailedToDeployApplication = errors.New("failed to deploy application") ErrDeploymentIsBeingPerformed = errors.New("deployment is being performed") ErrDeploymentAlreadyBeenPerformed = errors.New("deployment has already been performed") APPLICATION_STATUS_NAMES = map[ApplicationStatus]string{ UndeployedApp: "undeployed", DeployingApp: "deploying", DeployedApp: "deployed", GracefullyStoppingApp: "gracefully-stopping", GracefullyStoppedApp: "gracefully-stopped", ErroneouslyStoppedApp: "erroneously-stopped", FailedToPrepareApp: "failed-to-prepare", } )
Functions ¶
func IsAgentSet ¶
func IsAgentSet() bool
Types ¶
type Agent ¶
type Agent interface { GetOrCreateApplication(name ApplicationName) (Application, error) GetApplication(name ApplicationName) (Application, bool) }
Node agent, the implementation can be executed in-process or in another process on the same machine.
type Application ¶
type Application interface { Status() ApplicationStatus TimedStatus() TimedApplicationStatus PrepareDeployment(ApplicationDeploymentParams) (ApplicationDeployment, error) //Stop gracefully stops the application. Stop() //UnsafelyStop unsafely stops the application. UnsafelyStop() }
type ApplicationDeployment ¶
type ApplicationDeployment interface { Perform() error Status() DeploymentStatus }
An application deployment is a stateful representation of a deployment
type ApplicationName ¶
type ApplicationName string
func ApplicationNameFrom ¶
func ApplicationNameFrom(s string) (ApplicationName, error)
type ApplicationStatus ¶
type ApplicationStatus int
const ( UndeployedApp ApplicationStatus = iota + 1 DeployingApp DeployedApp GracefullyStoppingApp GracefullyStoppedApp ErroneouslyStoppedApp //execution error or error during stop FailedToPrepareApp )
func (ApplicationStatus) String ¶
func (s ApplicationStatus) String() string
type DeploymentStatus ¶
type DeploymentStatus int
const ( NotStartedDeployment DeploymentStatus = iota //default ActiveDeployment FailedDeployment SuccessfulDeployment )
type TimedApplicationStatus ¶
type TimedApplicationStatus struct { Status ApplicationStatus ChangeTime time.Time }
Click to show internal directories.
Click to hide internal directories.