Documentation
¶
Index ¶
- func AddRegistrySecret(conInfo *connections.Connection, conURL string, httpClient utils.HTTPClient, ...) (*[]RegistryResponse, error)
- func AddTemplateRepo(conID, URL, description, name string) ([]utils.TemplateRepo, error)
- func CreateMockResponseBody(mockResponse interface{}) io.ReadCloser
- func DeleteTemplateRepo(conID, URL string) ([]utils.TemplateRepo, error)
- func DisableTemplateRepos(conID string, repoURLs []string) ([]utils.TemplateRepo, error)
- func EnableTemplateRepos(conID string, repoURLs []string) ([]utils.TemplateRepo, error)
- func GetExtensions(conID string) ([]utils.Extension, error)
- func GetGatekeeperVersionFromConnection(connection *connections.Connection, url string, HTTPClient utils.HTTPClient) (string, error)
- func GetPFEVersionFromConnection(connection *connections.Connection, conURL string, HTTPClient utils.HTTPClient) (string, error)
- func GetPerformanceVersionFromConnection(connection *connections.Connection, url string, HTTPClient utils.HTTPClient) (string, error)
- func GetRegistrySecrets(conInfo *connections.Connection, conURL string, httpClient utils.HTTPClient) (*[]RegistryResponse, error)
- func GetTemplateRepos(conID string) ([]utils.TemplateRepo, error)
- func GetTemplateStyles(conID string) ([]string, error)
- func HTTPRequestWithRetryOnLock(httpClient utils.HTTPClient, originalRequest *http.Request, ...) (*http.Response, *sechttp.HTTPSecError)
- func IsPFEReady(httpClient utils.HTTPClient, host string) (bool, error)
- func RemoveRegistrySecret(conInfo *connections.Connection, conURL string, httpClient utils.HTTPClient, ...) (*[]RegistryResponse, error)
- func SetLogLevel(conInfo *connections.Connection, conURL string, httpClient utils.HTTPClient, ...) error
- type AddressParameter
- type ContainerVersions
- type ContainerVersionsList
- type Credentials
- type EnvResponse
- type IgnoredPaths
- type LogParameter
- type LoggingResponse
- type MockMultipleResponses
- type MockResponse
- type RegistryParameters
- type RegistryResponse
- type RepoOperation
- type SubResponseFromBatchOperation
- type Template
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddRegistrySecret ¶
func AddRegistrySecret(conInfo *connections.Connection, conURL string, httpClient utils.HTTPClient, address string, username string, password string) (*[]RegistryResponse, error)
AddRegistrySecret : Set a registry secret in the PFE container
func AddTemplateRepo ¶
func AddTemplateRepo(conID, URL, description, name string) ([]utils.TemplateRepo, error)
AddTemplateRepo adds a template repo to PFE and returns the new list of existing repos
func CreateMockResponseBody ¶
func CreateMockResponseBody(mockResponse interface{}) io.ReadCloser
CreateMockResponseBody is a helper function that creates a mock JSON response body
func DeleteTemplateRepo ¶
func DeleteTemplateRepo(conID, URL string) ([]utils.TemplateRepo, error)
DeleteTemplateRepo deletes a template repo from PFE and returns the new list of existing repos
func DisableTemplateRepos ¶
func DisableTemplateRepos(conID string, repoURLs []string) ([]utils.TemplateRepo, error)
DisableTemplateRepos enables a template repo in PFE and returns the new list of template repos
func EnableTemplateRepos ¶
func EnableTemplateRepos(conID string, repoURLs []string) ([]utils.TemplateRepo, error)
EnableTemplateRepos enables a template repo in PFE and returns the new list of template repos
func GetExtensions ¶
GetExtensions gets project extensions from PFE's REST API.
func GetGatekeeperVersionFromConnection ¶
func GetGatekeeperVersionFromConnection(connection *connections.Connection, url string, HTTPClient utils.HTTPClient) (string, error)
GetGatekeeperVersionFromConnection : Get the version of the Gatekeeper container, deployed to the connection with the given ID
func GetPFEVersionFromConnection ¶
func GetPFEVersionFromConnection(connection *connections.Connection, conURL string, HTTPClient utils.HTTPClient) (string, error)
GetPFEVersionFromConnection : Get the version of the PFE container, deployed to the connection with the given ID
func GetPerformanceVersionFromConnection ¶
func GetPerformanceVersionFromConnection(connection *connections.Connection, url string, HTTPClient utils.HTTPClient) (string, error)
GetPerformanceVersionFromConnection : Get the version of the Performance container, deployed to the connection with the given ID
func GetRegistrySecrets ¶
func GetRegistrySecrets(conInfo *connections.Connection, conURL string, httpClient utils.HTTPClient) (*[]RegistryResponse, error)
GetRegistrySecrets : Get the current registry secrets for the PFE container
func GetTemplateRepos ¶
func GetTemplateRepos(conID string) ([]utils.TemplateRepo, error)
GetTemplateRepos gets all template repos from PFE's REST API
func GetTemplateStyles ¶
GetTemplateStyles gets all template styles from PFE's REST API
func HTTPRequestWithRetryOnLock ¶
func HTTPRequestWithRetryOnLock(httpClient utils.HTTPClient, originalRequest *http.Request, connection *connections.Connection) (*http.Response, *sechttp.HTTPSecError)
HTTPRequestWithRetryOnLock : Retries a request until either the maxHTTPRetries limit has been hit or the response status code is not equal to 423 (templates locked HTTP code)
func IsPFEReady ¶
func IsPFEReady(httpClient utils.HTTPClient, host string) (bool, error)
IsPFEReady : Get PFE Ready for connection
func RemoveRegistrySecret ¶
func RemoveRegistrySecret(conInfo *connections.Connection, conURL string, httpClient utils.HTTPClient, address string) (*[]RegistryResponse, error)
RemoveRegistrySecret : Remove a registry secret from the PFE container
func SetLogLevel ¶
func SetLogLevel(conInfo *connections.Connection, conURL string, httpClient utils.HTTPClient, newLogLevel string) error
SetLogLevel : Set the current log level for the PFE container
Types ¶
type AddressParameter ¶
type AddressParameter struct {
Address string `json:"address"`
}
AddressParameter : Used when removing credentials.
type ContainerVersions ¶
type ContainerVersions struct {
CwctlVersion string `json:"cwctlVersion,omitempty"`
PerformanceVersion string `json:"performanceVersion"`
GatekeeperVersion string `json:"gatekeeperVersion,omitempty"`
PFEVersion string `json:"PFEVersion"`
}
ContainerVersions : The versions of the Codewind containers that are running
func GetContainerVersions ¶
func GetContainerVersions(conURL, cwctlVersion string, connection *connections.Connection, httpClient utils.HTTPClient) (ContainerVersions, error)
GetContainerVersions : Get the versions of each Codewind container, for a given connection ID
type ContainerVersionsList ¶
type ContainerVersionsList struct {
CwctlVersion string `json:"cwctlVersion"`
Connections map[string]ContainerVersions `json:"connections"`
ConnectionErrors map[string]error `json:"errors"`
}
ContainerVersionsList : The versions of the Codewind containers that are running on all connections Adds errors into the struct in order to report as many correct versions as possible
func GetAllContainerVersions ¶
func GetAllContainerVersions(connectionsList []connections.Connection, cwctlVersion string, httpClient utils.HTTPClient) (ContainerVersionsList, error)
GetAllContainerVersions : Get the versions of each Codewind container for each given connection ID
type Credentials ¶
Credentials : The registry credentials, sent as a base64 encoded string.
type EnvResponse ¶
type EnvResponse struct {
Version string `json:"codewind_version"`
ImageBuildTime string `json:"image_build_time"`
}
EnvResponse : The relevant response fields from the remote environment API
type IgnoredPaths ¶
type IgnoredPaths []string
IgnoredPaths is the list of paths to ignore, when syncing a project
func GetIgnoredPaths ¶
func GetIgnoredPaths(httpClient utils.HTTPClient, connection *connections.Connection, projectType string, conURL string) (IgnoredPaths, error)
GetIgnoredPaths calls pfe to get the default ignoredPaths for that projectType
type LogParameter ¶
type LogParameter struct {
Level string `json:"level"`
}
LogParameter : The request structure to set the log level
type LoggingResponse ¶
type LoggingResponse struct {
CurrentLevel string `json:"currentLevel"`
DefaultLevel string `json:"defaultLevel"`
AllLevels []string `json:"allLevels"`
}
LoggingResponse : The logging level information
func GetLogLevel ¶
func GetLogLevel(conInfo *connections.Connection, conURL string, httpClient utils.HTTPClient) (LoggingResponse, error)
GetLogLevel : Get the current log level for the PFE container
type MockMultipleResponses ¶
type MockMultipleResponses struct {
MockResponses []MockResponse
Counter int
}
MockMultipleResponses takes a slice of MockResponses and iterates through them on each request Used when a function makes multiple PFE API requests
type MockResponse ¶
type MockResponse struct {
StatusCode int
Body io.ReadCloser
}
MockResponse mocks the response of a http client
type RegistryParameters ¶
type RegistryParameters struct {
Address string `json:"address"`
Credentials string `json:"credentials"`
}
RegistryParameters : The request structure to set the log level
type RegistryResponse ¶
RegistryResponse : The registry information
type RepoOperation ¶
type RepoOperation struct {
Operation string `json:"op"`
URL string `json:"url"`
Value string `json:"value"`
}
RepoOperation represents a requested operation on a template repository.
type SubResponseFromBatchOperation ¶
type SubResponseFromBatchOperation struct {
Status int `json:"status"`
RequestedOperation RepoOperation `json:"requestedOperation"`
Error string `json:"error"`
}
SubResponseFromBatchOperation represents a sub-response to a requested operation on a template repository.
func BatchPatchTemplateRepos ¶
func BatchPatchTemplateRepos(conID string, operations []RepoOperation) ([]SubResponseFromBatchOperation, error)
BatchPatchTemplateRepos requests that PFE perform batch operations on template repositories and returns a list of sub-responses to the requested operations
type Template ¶
type Template struct {
Label string `json:"label"`
Description string `json:"description"`
Language string `json:"language"`
URL string `json:"url"`
ProjectType string `json:"projectType"`
ProjectStyle string `json:"projectStyle,omitempty"`
Source string `json:"source,omitempty"`
SourceID string `json:"sourceId,omitempty"`
}
Template represents a project template.