Documentation
¶
Index ¶
- func Bind(projectPath string, name string, language string, projectType string, ...) (*BindResponse, *ProjectError)
- func BindProject(c *cli.Context) (*BindResponse, *ProjectError)
- func DownloadTemplate(destination, url string, gitCredentials *utils.GitCredentials) (*Result, *ProjectError)
- func GetAll(httpClient utils.HTTPClient, connection *connections.Connection, url string) ([]Project, *ProjectError)
- func GetProjectFileList(httpClient utils.HTTPClient, connection *connections.Connection, ...) (FileList, *ProjectError)
- func GetProjectFromID(httpClient utils.HTTPClient, connection *connections.Connection, ...) (*Project, *ProjectError)
- func GetProjectFromName(httpClient utils.HTTPClient, connection *connections.Connection, ...) (*Project, *ProjectError)
- func GetProjectLinks(httpClient utils.HTTPClient, conInfo *connections.Connection, conURL string, ...) ([]Link, *ProjectError)
- func IsProjectIDValid(projectID string) bool
- func RestartProject(httpClient utils.HTTPClient, conInfo *connections.Connection, conURL string, ...) error
- func SyncProject(c *cli.Context) (*SyncResponse, *ProjectError)
- func ValidateProject(c *cli.Context) (*ValidationResponse, *ProjectError)
- type BindEndRequest
- type BindRequest
- type BindResponse
- type CWSettings
- type CompleteRequest
- type FileList
- type FileUploadMsg
- type Link
- type LinkError
- type LinkParameters
- type Project
- type ProjectError
- func CreateProjectLink(httpClient utils.HTTPClient, conInfo *connections.Connection, conURL string, ...) *ProjectError
- func DeleteProjectLink(httpClient utils.HTTPClient, conInfo *connections.Connection, conURL string, ...) *ProjectError
- func GetConnectionID(projectID string) (string, *ProjectError)
- func GetProjectIDFromName(httpClient utils.HTTPClient, connection *connections.Connection, ...) (string, *ProjectError)
- func RemoveConnectionFile(projectID string) *ProjectError
- func RemoveProject(c *cli.Context) *ProjectError
- func Unbind(httpClient utils.HTTPClient, connection *connections.Connection, ...) *ProjectError
- func UpdateProjectLink(httpClient utils.HTTPClient, conInfo *connections.Connection, conURL string, ...) *ProjectError
- func UpgradeProjects(oldDir string) (*map[string]interface{}, *ProjectError)
- type ProjectType
- type RestartParameters
- type Result
- type SyncInfo
- type SyncResponse
- type UploadedFile
- type ValidationResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bind ¶
func Bind(projectPath string, name string, language string, projectType string, conID string) (*BindResponse, *ProjectError)
Bind is used to bind a project for building and running
func BindProject ¶
func BindProject(c *cli.Context) (*BindResponse, *ProjectError)
BindProject : Bind a project
func DownloadTemplate ¶
func DownloadTemplate(destination, url string, gitCredentials *utils.GitCredentials) (*Result, *ProjectError)
DownloadTemplate using the url/link provided
func GetAll ¶
func GetAll(httpClient utils.HTTPClient, connection *connections.Connection, url string) ([]Project, *ProjectError)
GetAll : returns all projects that are bound to Codewind
func GetProjectFileList ¶ added in v0.14.0
func GetProjectFileList(httpClient utils.HTTPClient, connection *connections.Connection, url, projectID string) (FileList, *ProjectError)
GetProjectFromID : Get project details from Codewind
func GetProjectFromID ¶
func GetProjectFromID(httpClient utils.HTTPClient, connection *connections.Connection, url, projectID string) (*Project, *ProjectError)
GetProjectFromID : Get project details from Codewind
func GetProjectFromName ¶
func GetProjectFromName(httpClient utils.HTTPClient, connection *connections.Connection, url, projectName string) (*Project, *ProjectError)
GetProjectFromName : Get a project using its name
func GetProjectLinks ¶ added in v0.14.0
func GetProjectLinks(httpClient utils.HTTPClient, conInfo *connections.Connection, conURL string, projectID string) ([]Link, *ProjectError)
GetProjectLinks calls the project links API on PFE with a POST request
func IsProjectIDValid ¶
IsProjectIDValid : Checks if a supplied project ID is in the correct format
func RestartProject ¶
func RestartProject(httpClient utils.HTTPClient, conInfo *connections.Connection, conURL string, projectID string, startMode string) error
RestartProject calls the restart API on the connected PFE, for the given projectID and startMode
func SyncProject ¶
func SyncProject(c *cli.Context) (*SyncResponse, *ProjectError)
SyncProject syncs a project with its remote connection
func ValidateProject ¶
func ValidateProject(c *cli.Context) (*ValidationResponse, *ProjectError)
ValidateProject returns the language and buildType for a project at given filesystem path, and writes a default .cw-settings file to that project
Types ¶
type BindEndRequest ¶
type BindEndRequest struct {
ProjectID string `json:"id"`
}
BindEndRequest represents the request body parameters required to complete a bind
type BindRequest ¶
type BindRequest struct {
Language string `json:"language"`
ProjectType string `json:"projectType"`
Name string `json:"name"`
Path string `json:"path"`
Time int64 `json:"creationTime"`
}
BindRequest represents the response to validating a project on the users filesystem result is an interface as it could be ProjectType or string depending on success or failure.
type BindResponse ¶
type BindResponse struct {
ProjectID string `json:"projectID"`
Status string `json:"status"`
StatusCode int `json:"statusCode"`
UploadedFiles []UploadedFile `json:"uploadedFiles"`
}
BindResponse represents the API response
type CWSettings ¶
type CWSettings struct {
ContextRoot string `json:"contextRoot"`
InternalPort string `json:"internalPort"`
HealthCheck string `json:"healthCheck"`
InternalDebugPort *string `json:"internalDebugPort,omitempty"`
IsHTTPS bool `json:"isHttps"`
IgnoredPaths []string `json:"ignoredPaths"`
MavenProfiles []string `json:"mavenProfiles,omitempty"`
MavenProperties []string `json:"mavenProperties,omitempty"`
StatusPingTimeout string `json:"statusPingTimeout"`
}
CWSettings represents the .cw-settings file which is written to a project
type CompleteRequest ¶
type CompleteRequest struct {
FileList []string `json:"fileList"`
DirectoryList []string `json:"directoryList"`
ModifiedList []string `json:"modifiedList"`
TimeStamp int64 `json:"timeStamp"`
}
CompleteRequest is the request body format for calling the upload complete API
type FileUploadMsg ¶
type FileUploadMsg struct {
IsDirectory bool `json:"isDirectory"`
Mode uint `json:"mode"`
RelativePath string `json:"path"`
Message string `json:"msg"`
}
FileUploadMsg is the message sent on uploading a file
type Link ¶ added in v0.14.0
type Link struct {
ProjectID string `json:"projectID"`
ProjectName string `json:"projectName"`
EnvName string `json:"envName"`
ProjectURL string `json:"projectURL"`
}
Link : The structure of a Link object returned from PFE
type LinkError ¶ added in v0.14.0
type LinkError struct {
Name string `json:"name"`
Code string `json:"code"`
Message string `json:"message"`
}
LinkError : The json error returned from PFE
type LinkParameters ¶ added in v0.14.0
type LinkParameters struct {
EnvName string `json:"envName"`
TargetProjectID string `json:"targetProjectID,omitempty"`
UpdatedEnvName string `json:"updatedEnvName,omitempty"`
}
LinkParameters : The request structure to create a link
type Project ¶
type Project struct {
ProjectID string `json:"projectID"`
Name string `json:"name"`
Language string `json:"language"`
Host string `json:"host"`
LocationOnDisk string `json:"locOnDisk"`
AppStatus string `json:"appStatus"`
}
Project : Represents a project
type ProjectError ¶
ProjectError : A Project error
func CreateProjectLink ¶ added in v0.14.0
func CreateProjectLink(httpClient utils.HTTPClient, conInfo *connections.Connection, conURL string, projectID string, targetProjectID string, envName string) *ProjectError
CreateProjectLink calls the project link API on PFE with a POST request
func DeleteProjectLink ¶ added in v0.14.0
func DeleteProjectLink(httpClient utils.HTTPClient, conInfo *connections.Connection, conURL string, projectID string, envName string) *ProjectError
DeleteProjectLink calls the project link API on PFE with a DELETE request
func GetConnectionID ¶
func GetConnectionID(projectID string) (string, *ProjectError)
GetConnectionID : Gets the the connectionID for a given projectID
func GetProjectIDFromName ¶
func GetProjectIDFromName(httpClient utils.HTTPClient, connection *connections.Connection, url, projectName string) (string, *ProjectError)
GetProjectIDFromName : Get a project ID using its name
func RemoveConnectionFile ¶
func RemoveConnectionFile(projectID string) *ProjectError
RemoveConnectionFile : Remove the connection file for a project
func RemoveProject ¶
func RemoveProject(c *cli.Context) *ProjectError
RemoveProject : Unbind a project from Codewind and delete json connection file
func Unbind ¶
func Unbind(httpClient utils.HTTPClient, connection *connections.Connection, url, projectID string) *ProjectError
Unbind a project from Codewind
func UpdateProjectLink ¶ added in v0.14.0
func UpdateProjectLink(httpClient utils.HTTPClient, conInfo *connections.Connection, conURL string, projectID string, envName string, updatedEnvName string) *ProjectError
UpdateProjectLink calls the project link API on PFE with a PUT request
func UpgradeProjects ¶
func UpgradeProjects(oldDir string) (*map[string]interface{}, *ProjectError)
UpgradeProjects : Upgrades Projects
func (*ProjectError) Error ¶
func (pe *ProjectError) Error() string
ProjectError : Error formatted in JSON containing an errorOp and a description from either a fault condition in the CLI, or an error payload from a REST request
type ProjectType ¶
ProjectType represents the information Codewind requires to build a project.
type RestartParameters ¶
type RestartParameters struct {
StartMode string `json:"startMode"`
}
RestartParameters : The request structure to restart a project
type SyncInfo ¶
type SyncInfo struct {
UploadedFileList []UploadedFile
// contains filtered or unexported fields
}
SyncInfo contains the information from a project sync
type SyncResponse ¶
type SyncResponse struct {
Status string `json:"status"`
StatusCode int `json:"statusCode"`
UploadedFiles []UploadedFile `json:"uploadedFiles"`
}
SyncResponse is the status of the file syncing
type UploadedFile ¶
type UploadedFile struct {
FilePath string `json:"filePath"`
Status string `json:"status"`
StatusCode int `json:"statusCode"`
}
UploadedFile is the file to sync
type ValidationResponse ¶
type ValidationResponse struct {
Status string `json:"status"`
Path string `json:"projectPath"`
Result interface{} `json:"result"`
}
ValidationResponse represents the response to validating a project on the users filesystem.