project

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2020 License: EPL-2.0 Imports: 23 Imported by: 0

Documentation

Index

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(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

func IsProjectIDValid(projectID string) bool

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 FileList added in v0.14.0

type FileList []string

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 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

type ProjectError struct {
	Op   string
	Err  error
	Desc string
}

ProjectError : A Project error

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(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(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

type ProjectType struct {
	Language  string `json:"language"`
	BuildType string `json:"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 Result

type Result struct {
	Status        string `json:"status"`
	StatusMessage string `json:"status_message"`
}

Result : status message

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL