Documentation ¶
Index ¶
- func CopyFile(sourceFilePath, targetFilePath string) error
- func CreateTempFile(filePath string) error
- func CreateTimestamp() int64
- func DirIsEmpty(path string) (bool, error)
- func DownloadAndExtractZip(zipURL *url.URL, destination string) error
- func DownloadFile(URL *url.URL, destination string) error
- func DownloadFromRepoURL(URL *url.URL, destination string, gitCredentials *GitCredentials) error
- func DownloadFromTarGzURL(URL *url.URL, destination string, gitCredentials *GitCredentials) error
- func DownloadFromURLThenExtract(inURL, destination string, gitCredentials *GitCredentials) error
- func ExtractTarToFileSystem(tarReader *tar.Reader, destination string) error
- func GetZipURL(owner, repo, branch string, client *github.Client) (*url.URL, error)
- func IsTarGzURL(URL *url.URL) bool
- func OnAddTemplateRepo(extensions []Extension, url string, repos []TemplateRepo)
- func OnDeleteTemplateRepo(extensions []Extension, url string, repos []TemplateRepo)
- func PathExists(path string) bool
- func PrettyPrintJSON(i interface{})
- func RemoveDuplicateEntries(inputArr []string) []string
- func ReplaceInFiles(projectPath string, oldStr string, newStr string) error
- func RunCommand(projectPath string, command ExtensionCommand, params map[string]string) error
- func UnTar(pathToTarFile, destination string) error
- func UnZip(filePath, destination string) error
- func WaitForService(url string, successStatusCode int, maxRetries int) error
- func Zip(zipFileName, targetDirectory string) error
- type Authentication
- type Extension
- type ExtensionCommand
- type ExtensionConfig
- type GitCredentials
- type HTTPClient
- type TemplateRepo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTempFile ¶
CreateTempFile in the same directory as the binary for docker compose
func DirIsEmpty ¶
DirIsEmpty returns true if the directory at the given path if empty
func DownloadAndExtractZip ¶
DownloadAndExtractZip downloads a zip file from a URL and extracts it to a destination
func DownloadFile ¶
DownloadFile from URL to file destination
func DownloadFromRepoURL ¶
func DownloadFromRepoURL(URL *url.URL, destination string, gitCredentials *GitCredentials) error
DownloadFromRepoURL downloads a repo from a URL to a destination
func DownloadFromTarGzURL ¶
func DownloadFromTarGzURL(URL *url.URL, destination string, gitCredentials *GitCredentials) error
DownloadFromTarGzURL downloads a tar.gz file from a URL and extracts it to a destination
func DownloadFromURLThenExtract ¶
func DownloadFromURLThenExtract(inURL, destination string, gitCredentials *GitCredentials) error
DownloadFromURLThenExtract downloads files from a URL to a destination, extracting them if necessary
func ExtractTarToFileSystem ¶ added in v0.14.0
ExtractTarToFileSystem reads a tar Reader to a filesystem
func IsTarGzURL ¶
IsTarGzURL returns whether the provided URL is a tar.gz file
func OnAddTemplateRepo ¶
func OnAddTemplateRepo(extensions []Extension, url string, repos []TemplateRepo)
OnAddTemplateRepo runs any extension command associated with a repo add
func OnDeleteTemplateRepo ¶
func OnDeleteTemplateRepo(extensions []Extension, url string, repos []TemplateRepo)
OnDeleteTemplateRepo runs any extension command associated with a repo delete
func PathExists ¶
PathExists returns whether a path exists on the local file system.
func PrettyPrintJSON ¶
func PrettyPrintJSON(i interface{})
PrettyPrintJSON : Format JSON output for display
func RemoveDuplicateEntries ¶
RemoveDuplicateEntries elements
func ReplaceInFiles ¶
ReplaceInFiles the placeholder string "[PROJ_NAME_PLACEHOLDER]" with a generated name based on the project directory
func RunCommand ¶
func RunCommand(projectPath string, command ExtensionCommand, params map[string]string) error
RunCommand runs a command defined by an extension
func WaitForService ¶
WaitForService : Wait for service to start
Types ¶
type Authentication ¶ added in v0.14.0
type Authentication struct {
Username string `json:"username,omitempty"`
}
Authentication represents a template respository's authentication.
type Extension ¶
type Extension struct { ProjectType string `json:"projectType"` Detection string `json:"detection"` Commands []ExtensionCommand `json:"commands"` Config ExtensionConfig `json:"config"` }
Extension represents a project extension defined by codewind.yaml
type ExtensionCommand ¶
type ExtensionCommand struct { Name string `json:"name"` Command string `json:"command"` Args []string `json:"args"` }
ExtensionCommand represents a command defined by a project extension
type ExtensionConfig ¶
type ExtensionConfig struct {
Style string `json:"style"`
}
ExtensionConfig represents a project extension's config element
type GitCredentials ¶ added in v0.14.0
type GitCredentials struct { Username string `json:"username,omitempty"` Password string `json:"password,omitempty"` PersonalAccessToken string `json:"personalAccessToken,omitempty"` }
GitCredentials : credentials to access GitHub or GitHubEnterprise
func ExtractGitCredentials ¶ added in v0.14.0
func ExtractGitCredentials(username, password, personalAccessToken string) (*GitCredentials, error)
ExtractGitCredentials extracts and formats git credentials from the provided arguments
type HTTPClient ¶
HTTPClient : An net HTTP Client to simplify testing
type TemplateRepo ¶
type TemplateRepo struct { Description string `json:"description"` URL string `json:"url"` Name string `json:"name"` ID string `json:"id"` Enabled bool `json:"enabled"` Protected bool `json:"protected"` ProjectStyles []string `json:"projectStyles"` Authentication *Authentication `json:"authentication,omitempty"` }
TemplateRepo represents a template repository.