project

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 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 ConnectionFileExists

func ConnectionFileExists(projectID string) bool

ConnectionFileExists : Returns true if connection file exists for the projectID

func DownloadTemplate

func DownloadTemplate(destination string, url string) (*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 GetConnection

func GetConnection(projectID string) (*ConnectionFile, *ProjectError)

GetConnection : List the connection for a projectID

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

type ConnectionFile struct {
	SchemaVersion int    `json:"schemaVersion"`
	ID            string `json:"connectionID"`
}

ConnectionFile : Structure of the project-connections file

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

func CreateConnectionFile(projectID string) *ProjectError

CreateConnectionFile : Creates the /connections/{project_id}.json file if one doesn't exist, with default local connection

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 ResetConnectionFile

func ResetConnectionFile(projectID string) *ProjectError

ResetConnectionFile : Reset target file

func SetConnection

func SetConnection(conID string, projectID string) *ProjectError

SetConnection : Add a connection target

func Unbind

func Unbind(httpClient utils.HTTPClient, connection *connections.Connection, url, projectID string) *ProjectError

Unbind a project from Codewind

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