Documentation ¶
Index ¶
- Constants
- func EnvForDir(dir string, base []string) []string
- func GetVCS() *vcsCmd
- func Init(portalProxy interfaces.PortalProxy) (interfaces.StratosPlugin, error)
- func MergeEnvLists(in, out []string) []string
- type Applications
- type CFAppPush
- func (cfAppPush *CFAppPush) AddAdminGroupRoutes(echoGroup *echo.Group)
- func (cfAppPush *CFAppPush) AddSessionGroupRoutes(echoGroup *echo.Group)
- func (cfAppPush *CFAppPush) GetEndpointPlugin() (interfaces.EndpointPlugin, error)
- func (cfAppPush *CFAppPush) GetMiddlewarePlugin() (interfaces.MiddlewarePlugin, error)
- func (cfAppPush *CFAppPush) GetRoutePlugin() (interfaces.RoutePlugin, error)
- func (cfAppPush *CFAppPush) Init() error
- func (cfAppPush *CFAppPush) SendEvent(clientWebSocket *websocket.Conn, event MessageType, data string)
- type CFPush
- type CFPushApp
- type CFPushAppConfig
- type CFPushAppOverrides
- type CloneDetails
- type DeployAppMessageSender
- type DeploySource
- type DockerImageSourceInfo
- type ErrorType
- type FolderSourceInfo
- type GitSCMSourceInfo
- type GitUrlSourceInfo
- type ManifestResponse
- type MessageType
- type PushConnectionWrapper
- type PushError
- type RawManifestApplication
- type SocketMessage
- type SocketWriter
- type StratosProject
Constants ¶
const ( SCM_TYPE_GITHUB = "github" SCM_TYPE_GITLAB = "gitlab" )
Variables ¶
This section is empty.
Functions ¶
func Init ¶
func Init(portalProxy interfaces.PortalProxy) (interfaces.StratosPlugin, error)
Init creates a new CFAppPush
func MergeEnvLists ¶
Types ¶
type Applications ¶
type Applications struct {
Applications []RawManifestApplication `yaml:"applications"`
}
type CFAppPush ¶
type CFAppPush struct {
// contains filtered or unexported fields
}
CFAppPush is a plugin to allow applications to be pushed to Cloud Foundry from Stratos
func (*CFAppPush) AddAdminGroupRoutes ¶
func (cfAppPush *CFAppPush) AddAdminGroupRoutes(echoGroup *echo.Group)
AddAdminGroupRoutes adds the admin routes for this plugin to the Echo server
func (*CFAppPush) AddSessionGroupRoutes ¶
func (cfAppPush *CFAppPush) AddSessionGroupRoutes(echoGroup *echo.Group)
AddSessionGroupRoutes adds the session routes for this plugin to the Echo server
func (*CFAppPush) GetEndpointPlugin ¶
func (cfAppPush *CFAppPush) GetEndpointPlugin() (interfaces.EndpointPlugin, error)
GetEndpointPlugin gets the endpoint plugin for this plugin
func (*CFAppPush) GetMiddlewarePlugin ¶
func (cfAppPush *CFAppPush) GetMiddlewarePlugin() (interfaces.MiddlewarePlugin, error)
GetMiddlewarePlugin gets the middleware plugin for this plugin
func (*CFAppPush) GetRoutePlugin ¶
func (cfAppPush *CFAppPush) GetRoutePlugin() (interfaces.RoutePlugin, error)
GetRoutePlugin gets the route plugin for this plugin
type CFPush ¶
type CFPush interface { Init(appDir string, manifestPath string, overrides CFPushAppOverrides) error Run(DeployAppMessageSender, *websocket.Conn) error }
CFPush Interface
func Constructor ¶
func Constructor(config *CFPushAppConfig, portalProxy interfaces.PortalProxy) CFPush
Constructor returns a CFPush based on the supplied config
type CFPushApp ¶
type CFPushApp struct {
// contains filtered or unexported fields
}
CFPushApp abstracts the push functionality form the CLI library
type CFPushAppConfig ¶
type CFPushAppConfig struct { AuthorizationEndpoint string CFClient string CFClientSecret string APIEndpointURL string DopplerLoggingEndpoint string SkipSSLValidation bool AuthToken string OrgGUID string OrgName string SpaceGUID string SpaceName string OutputWriter io.Writer DialTimeout string EndpointID string UserID string }
CFPushAppConfig is the configuration used
type CFPushAppOverrides ¶
type CFPushAppOverrides struct { Name string `json:"name"` Buildpack string `json:"buildpack"` StartCmd string `json:"startCmd"` HealthCheckType string `json:"healthCheckType"` Stack string `json:"stack"` Time *int `json:"time"` Instances *int `json:"instances"` DiskQuota string `json:"diskQuota"` MemQuota string `json:"memQuota"` DoNotStart bool `json:"doNotStart"` NoRoute bool `json:"noRoute"` RandomRoute bool `json:"randomRoute"` Host string `json:"host"` Domain string `json:"domain"` Path string `json:"path"` DockerImage string `json:"dockerImage"` DockerUsername string `json:"dockerUsername"` }
CFPushAppOverrides represents the document that can be sent from the client with the app overrrides for the push
type CloneDetails ¶
type DeployAppMessageSender ¶
type DeployAppMessageSender interface {
SendEvent(clientWebSocket *websocket.Conn, event MessageType, data string)
}
DeployAppMessageSender is the interface for sending a message over a web socket
type DeploySource ¶
type DockerImageSourceInfo ¶
type DockerImageSourceInfo struct { DeploySource ApplicationName string `json:"applicationName"` DockerImage string `json:"dockerImage"` DockerUsername string `json:"dockerUsername"` }
DockerImageSourceInfo - Structure used to provide metadata about the docker source
type FolderSourceInfo ¶
type FolderSourceInfo struct { DeploySource WaitAfterUpload bool `json:"wait"` Files int `json:"files"` Folders []string `json:"folders,omitempty"` }
type GitSCMSourceInfo ¶
type GitSCMSourceInfo struct { DeploySource Project string `json:"project"` Branch string `json:"branch"` URL string `json:"url"` CommitHash string `json:"commit"` SCM string `json:"scm"` EndpointGUID string `json:"endpointGuid"` // credentials of which to use, e.g. of a private GitHub instance Username string `json:"username"` // GitLab username has to be supplied by the frontend }
Structure used to provide metadata about the GitHub source
type GitUrlSourceInfo ¶
type GitUrlSourceInfo struct { DeploySource Project string `json:"project"` // Not sent from client Branch string `json:"branch"` Url string `json:"url"` CommitHash string `json:"commit"` // Not sent from client }
Structure used to provide metadata about the Git Url source
type ManifestResponse ¶
type ManifestResponse struct {
Manifest string
}
type MessageType ¶
type MessageType int
const ( DATA MessageType = iota + 20000 MANIFEST CLOSE_SUCCESS APP_GUID_NOTIFY )
Success
const ( CLOSE_PUSH_ERROR MessageType = iota + 40000 CLOSE_NO_MANIFEST CLOSE_INVALID_MANIFEST CLOSE_FAILED_CLONE CLOSE_FAILED_NO_BRANCH CLOSE_FAILURE CLOSE_NO_SESSION CLOSE_NO_CNSI CLOSE_NO_CNSI_USERTOKEN CLOSE_ACK )
Close - error cases
const ( EVENT_CLONED MessageType = iota + 10000 EVENT_FETCHED_MANIFEST EVENT_PUSH_STARTED EVENT_PUSH_COMPLETED )
Events
const ( SOURCE_REQUIRED MessageType = iota + 30000 SOURCE_GITSCM SOURCE_FOLDER SOURCE_FILE SOURCE_FILE_DATA SOURCE_FILE_ACK SOURCE_GITURL SOURCE_WAIT_ACK SOURCE_DOCKER_IMG )
Source exchange messages
const ( OVERRIDES_REQUIRED MessageType = iota + 50000 OVERRIDES_SUPPLIED )
Application Overrides messages
type PushConnectionWrapper ¶
type PushConnectionWrapper struct {
// contains filtered or unexported fields
}
PushConnectionWrapper can wrap a given connection allowing the wrapper to modify all requests going in and out of the given connection.
func (PushConnectionWrapper) Make ¶
func (cw PushConnectionWrapper) Make(request *cloudcontroller.Request, passedResponse *cloudcontroller.Response) error
Make makes an HTTP request
func (PushConnectionWrapper) Wrap ¶
func (cw PushConnectionWrapper) Wrap(innerconnection cloudcontroller.Connection) cloudcontroller.Connection
Wrap an existing connection
type RawManifestApplication ¶
type RawManifestApplication struct { Name string `yaml:"name,omitempty"` Buildpack string `yaml:"buildpack,omitempty"` Buildpacks []string `yaml:"buildpacks,omitempty"` Command string `yaml:"command,omitempty"` DeprecatedDomain interface{} `yaml:"domain,omitempty"` DeprecatedDomains interface{} `yaml:"domains,omitempty"` DeprecatedHost interface{} `yaml:"host,omitempty"` DeprecatedHosts interface{} `yaml:"hosts,omitempty"` DeprecatedNoHostname interface{} `yaml:"no-hostname,omitempty"` DiskQuota string `yaml:"disk_quota,omitempty"` Docker rawDockerInfo `yaml:"docker,omitempty"` DropletPath string `yaml:"droplet-path,omitempty"` EnvironmentVariables map[string]string `yaml:"env,omitempty"` HealthCheckHTTPEndpoint string `yaml:"health-check-http-endpoint,omitempty"` HealthCheckType string `yaml:"health-check-type,omitempty"` Instances *int `yaml:"instances,omitempty"` Memory string `yaml:"memory,omitempty"` NoRoute bool `yaml:"no-route,omitempty"` Path string `yaml:"path,omitempty"` RandomRoute bool `yaml:"random-route,omitempty"` Routes []rawManifestRoute `yaml:"routes,omitempty"` Services []string `yaml:"services,omitempty"` StackName string `yaml:"stack,omitempty"` Timeout int `yaml:"timeout,omitempty"` }
Based on manifest.rawManifestApplicaiton
type SocketMessage ¶
type SocketMessage struct { Message string `json:"message"` Timestamp int64 `json:"timestamp"` Type MessageType `json:"type"` }
type SocketWriter ¶
type SocketWriter struct {
// contains filtered or unexported fields
}
type StratosProject ¶
type StratosProject struct { DeploySource interface{} `json:"deploySource"` DeployOverrides interface{} `json:"deployOverrides"` }