Documentation ¶
Index ¶
- Constants
- func AppendConfigToDisk(specObj *model.SpecObject, filename string) error
- func ChangeSelectedAccount(clusterName string) error
- func CheckPortAvailability(port, s string) (string, error)
- func CloseTheCloser(c io.Closer)
- func CreateChart(chartLocation, downloadURL string) (*action.Configuration, *chart.Chart, error)
- func CreateConfigFile(path string) error
- func CreateDirIfNotExist(dir string) error
- func CreateFileIfNotExist(path, content string) error
- func CreateSpecObject(api, objType string, meta map[string]string, spec interface{}) (*model.SpecObject, error)
- func ExtractValuesObj(setValuesFlag, valuesYamlFile string) (map[string]interface{}, error)
- func FileExists(filename string) bool
- func GenerateAccountsFile(credential *model.Credential) error
- func Get(method, url string, params map[string]string, vPtr interface{}) error
- func GetContainers(ctx context.Context, dockerClient *client.Client, ...) ([]types.Container, error)
- func GetCredentials() (*model.Credential, error)
- func GetDatabaseContainerName(id, alias string) string
- func GetHelmChartDownloadURL(url, version string) string
- func GetInternalServiceDomain(projectID, serviceID, version string) string
- func GetMountConfigFilePath(id string) string
- func GetMountHostsFilePath(id string) string
- func GetMountRoutingConfigPath(id string) string
- func GetMountSecretsDir(id string) string
- func GetMountTempSecretsDir(id string) string
- func GetNetworkName(clusterName string) string
- func GetProjectID() (string, bool)
- func GetProjectsFromSC() ([]*model.Projects, error)
- func GetProjectsNamesFromArray(projects []*model.Projects) ([]string, error)
- func GetRegistryContainerName(clusterName string) string
- func GetSCImageName(imagePrefix, version string, t model.ImageType) string
- func GetScContainers(clusterName, name string) string
- func GetSecretsDir(id string) string
- func GetServiceDomain(projectID, serviceID string) string
- func GetSpaceCloudClusterDirectory(clusterID string) string
- func GetSpaceCloudConfigFilePath(id string) string
- func GetSpaceCloudDirectory() string
- func GetSpaceCloudHostsFilePath(id string) string
- func GetSpaceCloudRoutingConfigPath(id string) string
- func GetTempSecretsDir(id string) string
- func HelmGet(releaseName string) (*release.Release, error)
- func HelmInstall(chartReleaseName, chartLocation, downloadURL, namespace string, ...) (*chart.Chart, error)
- func HelmList(filterRegex string) ([]*release.Release, error)
- func HelmShow(chartLocation, downloadURL, releaseArg string) (string, error)
- func HelmUninstall(releaseName string) error
- func HelmUpgrade(releaseName, chartLocation, downloadURL, namespace string, ...) (*chart.Chart, error)
- func LogDebug(message string, extraFields map[string]interface{})
- func LogError(message string, err error) error
- func LogInfo(message string)
- func LoginStart(userName, ID, key, url string) error
- func LoginWithSelectedAccount() (*model.Account, string, error)
- func PrintYaml(objs []*model.SpecObject) error
- func PullImageIfNotExist(ctx context.Context, dockerClient *client.Client, image string) error
- func ReadSpecObjectsFromFile(fileName string) ([]*model.SpecObject, error)
- func RemoveAccount(clusterName string) error
- func SetDefaultProject(project string) error
- func SetLogLevel(loglevel string)
- func StoreCredentials(account *model.Account) error
- func UnmarshalYAML(in []byte, out *model.SpecObject) error
- type MockInputInterface
Constants ¶
const DockerfileGolang string = `` /* 251-byte string literal not displayed */
DockerfileGolang is the docker file to use for golang projects
const DockerfileNodejs string = `` /* 167-byte string literal not displayed */
DockerfileNodejs is the docker file to use for node js projects
const DockerfilePython string = `` /* 199-byte string literal not displayed */
DockerfilePython is the docker file to use for python projects
Variables ¶
This section is empty.
Functions ¶
func AppendConfigToDisk ¶
func AppendConfigToDisk(specObj *model.SpecObject, filename string) error
AppendConfigToDisk creates a yml file or appends to existing
func ChangeSelectedAccount ¶
ChangeSelectedAccount change selected account according to cluster name provided
func CheckPortAvailability ¶
CheckPortAvailability checks if specified port is available on local machine
func CreateChart ¶
CreateChart returns chart object, which describe the provide chart
func CreateConfigFile ¶
CreateConfigFile create empty config file
func CreateDirIfNotExist ¶
CreateDirIfNotExist creates a directory if it doesn't already exists
func CreateFileIfNotExist ¶
CreateFileIfNotExist creates a file with the provided content if it doesn't already exists
func CreateSpecObject ¶
func CreateSpecObject(api, objType string, meta map[string]string, spec interface{}) (*model.SpecObject, error)
CreateSpecObject returns the string equivalent of the git op object
func ExtractValuesObj ¶
ExtractValuesObj extract chart values from yaml file & cli flags
func GenerateAccountsFile ¶
func GenerateAccountsFile(credential *model.Credential) error
GenerateAccountsFile generates the yaml file for accounts
func GetContainers ¶
func GetContainers(ctx context.Context, dockerClient *client.Client, clusterName, containerType string) ([]types.Container, error)
GetContainers gets container running in a specific cluster
func GetCredentials ¶
func GetCredentials() (*model.Credential, error)
GetCredentials get all the stored credentials
func GetDatabaseContainerName ¶
GetDatabaseContainerName provides name for database container
func GetHelmChartDownloadURL ¶
GetHelmChartDownloadURL adjusts the url prefixes according to the version
func GetInternalServiceDomain ¶
GetInternalServiceDomain is used for getting internal service domain
func GetMountConfigFilePath ¶
GetMountConfigFilePath returns the path of the config files to be mounted in space cloud
func GetMountHostsFilePath ¶
GetMountHostsFilePath returns the path of the hosts files to be mounted in in space cloud
func GetMountRoutingConfigPath ¶
GetMountRoutingConfigPath returns the path of the routing config to be mounted in space cloud
func GetMountSecretsDir ¶
GetMountSecretsDir returns the path of the secret dir to be mounted in space cloud
func GetMountTempSecretsDir ¶
GetMountTempSecretsDir returns the path of the temp secret dir to be mounted in space cloud
func GetNetworkName ¶
GetNetworkName provides network name of particular cluster
func GetProjectID ¶
GetProjectID checks if project is specified in flags
func GetProjectsFromSC ¶
GetProjectsFromSC returns the projects array from sc
func GetProjectsNamesFromArray ¶
GetProjectsNamesFromArray returns the array of projects names
func GetRegistryContainerName ¶
GetRegistryContainerName provides name for registry container
func GetSCImageName ¶
GetSCImageName get the sc image name and add the image prefix when required
func GetScContainers ¶
GetScContainers provides name for space-cloud containers
func GetSecretsDir ¶
GetSecretsDir returns the path of the directory storing all the secrets
func GetServiceDomain ¶
GetServiceDomain is used for getting the main service domain
func GetSpaceCloudClusterDirectory ¶
GetSpaceCloudClusterDirectory gets the root space cloud directory
func GetSpaceCloudConfigFilePath ¶
GetSpaceCloudConfigFilePath returns the path of the file storing the config
func GetSpaceCloudDirectory ¶
func GetSpaceCloudDirectory() string
GetSpaceCloudDirectory gets the root space cloud directory
func GetSpaceCloudHostsFilePath ¶
GetSpaceCloudHostsFilePath returns the path of the hosts files used in space cloud
func GetSpaceCloudRoutingConfigPath ¶
GetSpaceCloudRoutingConfigPath returns the path of the file storing the service routing config
func GetTempSecretsDir ¶
GetTempSecretsDir gets the path of the directory storing all the temp secrets
func HelmInstall ¶
func HelmInstall(chartReleaseName, chartLocation, downloadURL, namespace string, valuesFileObj map[string]interface{}) (*chart.Chart, error)
HelmInstall install helm chart
func HelmUninstall ¶
HelmUninstall uninstall helm chart
func HelmUpgrade ¶
func HelmUpgrade(releaseName, chartLocation, downloadURL, namespace string, valuesFileObj map[string]interface{}) (*chart.Chart, error)
HelmUpgrade upgrade space cloud chart
func LoginStart ¶
LoginStart take info of the user
func LoginWithSelectedAccount ¶
LoginWithSelectedAccount returns selected account & login token
func PrintYaml ¶
func PrintYaml(objs []*model.SpecObject) error
PrintYaml prints array of yaml object
func PullImageIfNotExist ¶
PullImageIfNotExist pulls the docker image if it does not exist
func ReadSpecObjectsFromFile ¶
func ReadSpecObjectsFromFile(fileName string) ([]*model.SpecObject, error)
ReadSpecObjectsFromFile returns the spec objects present in the file
func RemoveAccount ¶
RemoveAccount removes account from accounts file
func SetDefaultProject ¶
SetDefaultProject sets the default project for the selected account in accounts.yaml file if empty value provided it will try to project from server & prompts user to select project from server response
func SetLogLevel ¶
func SetLogLevel(loglevel string)
SetLogLevel sets a single verbosity level for log messages.
func StoreCredentials ¶
StoreCredentials stores the credential in the accounts config file
func UnmarshalYAML ¶
func UnmarshalYAML(in []byte, out *model.SpecObject) error
UnmarshalYAML converts to map[string]interface{} instead of map[interface{}]interface{}.
Types ¶
type MockInputInterface ¶
MockInputInterface is the mock interface for survey package
func (*MockInputInterface) AskOne ¶
func (m *MockInputInterface) AskOne(p survey.Prompt, response interface{}) error
AskOne is the mock method for MockInputInterface