Documentation ¶
Index ¶
Constants ¶
const (
//ErrorCodeTODO the placeholder for errors
ErrorCodeTODO = 1
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApidClient ¶
type ApidClient interface { //PollDeployments poll the deployments and return the deployment PollDeployments(etag string, timeout int) (*Deployment, error) //SetDeploymentResult set the deployment result SetDeploymentResult(result *DeploymentResult) error }
ApidClient the apidClient
func CreateApidClient ¶
func CreateApidClient(apidHostPath string) (ApidClient, error)
CreateApidClient create the client and validate the input
type ApidClientImpl ¶
type ApidClientImpl struct {
// contains filtered or unexported fields
}
ApidClientImpl the client impl. Use the CreateApidClient function to perform validation.
func (*ApidClientImpl) PollDeployments ¶
func (apidClient *ApidClientImpl) PollDeployments(etag string, timeout int) (*Deployment, error)
PollDeployments poll the deployments fromthe apidHostPath with the etag (optional) and timeout (0 for none) returns the deployment response, or an error if one occurs. A nil deploymentresponse indicates a timeout on polling (TODO, should this be a custom error?)
func (*ApidClientImpl) SetDeploymentResult ¶
func (apidClient *ApidClientImpl) SetDeploymentResult(result *DeploymentResult) error
SetDeploymentResult set the result of the deployment. Returns an error if the call was unsuccessful
type BundleError ¶
type BundleError struct { BundleID string `json:"bundleId"` ErrorCode int `json:"errorCode"` Reason string `json:"reason"` }
BundleError Any Bundle-specific error that occurred on deployment
type Deployment ¶
type Deployment struct { ETAG string ID string `json:"deploymentId"` System *SystemBundle `json:"system"` Bundles []*DeploymentBundle `json:"bundles"` }
Deployment the type of deployment to return
type DeploymentBundle ¶
type DeploymentBundle struct { BundleID string `json:"bundleId"` AuthCode string `json:"authCode"` URL string `json:"url"` BasePath string `json:"basePath"` Target string `json:"target"` VirtualHosts []string `json:"virtualHosts"` }
DeploymentBundle the bundle to deploy in a response
func (*DeploymentBundle) FilePath ¶
func (bundle *DeploymentBundle) FilePath() string
FilePath parse the file path in the bundle
type DeploymentError ¶
type DeploymentError struct { ErrorCode int `json:"errorCode"` Reason string `json:"reason"` BundleErrors []BundleError `json:"bundleErrors"` }
DeploymentError The error that occurred on deployment
type DeploymentResult ¶
type DeploymentResult struct { //The deploymentId ID string //The status of the deployment Status DeploymentStatus `json:"status"` //Any errors that may have occurred. If we're successful, this can be nil or empty Error *DeploymentError `json:"error"` }
DeploymentResult the result of a deployment
type DeploymentStatus ¶
type DeploymentStatus string
DeploymentStatus the status of the deployment
const ( //StatusFail the deployment failed StatusFail DeploymentStatus = "FAIL" //StatusSuccess the deployment succeeded. StatusSuccess DeploymentStatus = "SUCCESS" )
type SystemBundle ¶
SystemBundle the root bundle
func (*SystemBundle) FilePath ¶
func (bundle *SystemBundle) FilePath() string
FilePath parse the file path in teh bundle