Documentation
¶
Index ¶
- Variables
- func AddCatalogRepositoryFlag(cmd *cobra.Command)
- func AddCloudProviderFlag(cmd *cobra.Command)
- func AddColorFlag(cmd *cobra.Command)
- func AddComponentDescriptionFlag(cmd *cobra.Command)
- func AddComponentFlag(cmd *cobra.Command)
- func AddConfigRepositoryFlag(cmd *cobra.Command)
- func AddCyContext(cmd *cobra.Command)
- func AddDescriptionFlag(cmd *cobra.Command)
- func AddEnvFlag(cmd *cobra.Command)
- func AddIconFlag(cmd *cobra.Command)
- func AddNameFlag(cmd *cobra.Command)
- func AddOwnerFlag(cmd *cobra.Command)
- func AddProjectFlag(cmd *cobra.Command)
- func AddStackFormsInputFlags(cmd *cobra.Command)
- func AddStackRefFlag(cmd *cobra.Command)
- func AddUseCaseFlag(cmd *cobra.Command)
- func GetCatalogRepository(cmd *cobra.Command) (string, error)
- func GetCloudProvider(cmd *cobra.Command) (*string, error)
- func GetColor(cmd *cobra.Command) (string, error)
- func GetComponent(cmd *cobra.Command) (string, error)
- func GetComponentDescription(cmd *cobra.Command) (*string, error)
- func GetConfigRepository(cmd *cobra.Command, org string, m middleware.Middleware) (string, error)
- func GetCyContext(cmd *cobra.Command) (org, project, env, component string, err error)
- func GetDescription(cmd *cobra.Command) (string, error)
- func GetEnv(cmd *cobra.Command) (string, error)
- func GetIcon(cmd *cobra.Command) (string, error)
- func GetName(cmd *cobra.Command) (string, error)
- func GetOrg(cmd *cobra.Command) (string, error)
- func GetOutput(cmd *cobra.Command) (string, error)
- func GetOwner(cmd *cobra.Command) (string, error)
- func GetProject(cmd *cobra.Command) (string, error)
- func GetStackRef(cmd *cobra.Command) (*string, error)
- func GetStackformsVars(cmd *cobra.Command, defaults *models.FormVariables) (*models.FormVariables, error)
- func GetUseCase(cmd *cobra.Command) (*string, error)
- func MergeJSONFileVars(jsonFiles []string) (*models.FormVariables, error)
- func MergeJSONVars(jsonVars []string) (*models.FormVariables, error)
- func MergeStackformsVars(defaults *models.FormVariables, envVars *models.FormVariables, ...) (*models.FormVariables, error)
- func PickRandomColor(env *string) string
- func PickRandomIcon(env *string) string
- func UpdateFormVar(field string, value string, vars models.FormVariables) error
Constants ¶
This section is empty.
Variables ¶
var ( DefaultIcon = "" DefaultColor = "" ValidIcons = []string{ "folder_open", "mdi-cube-outline", "public", "extension", "science", "bug_report", "bolt", "call_merge", "commit", "mdi-source-branch", "traffic", "mdi-clipboard-check-outline", "mdi-progress-clock", "visibility", "vpn_key", "lightbulb", "favorite", "star", "auto_awesome", "mdi-controller-classic", "precision_manufacturing", "tour", "podcasts", "inventory", "save", "security", "mdi-lifebuoy", "mdi-ab-testing", "mdi-api", "mdi-console", "mdi-database", "mdi-vpn", "mdi-server", "mdi-server-security", "mdi-network-outline", "mdi-lan", "mdi-nas", "mdi-ansible", "mdi-aws", "mdi-microsoft-azure", "mdi-google-cloud", "mdi-kubernetes", "mdi-terraform", } ValidColors = []string{ "dev", "prod", "demo", "success", "default", "error", "staging", "preprod", } )
var (
StackformsEnvVarName = "CY_STACKFORMS_VARS"
)
Functions ¶
func AddCloudProviderFlag ¶
func AddColorFlag ¶
func AddComponentFlag ¶
func AddConfigRepositoryFlag ¶
func AddCyContext ¶
func AddDescriptionFlag ¶
func AddEnvFlag ¶
func AddIconFlag ¶
func AddNameFlag ¶
func AddOwnerFlag ¶
func AddProjectFlag ¶
func AddStackFormsInputFlags ¶
func AddStackRefFlag ¶
func AddUseCaseFlag ¶
func GetConfigRepository ¶
func GetConfigRepository(cmd *cobra.Command, org string, m middleware.Middleware) (string, error)
GetConfigRepository return the config repository flag, if empty, will try to return the current org default config repository
func GetCyContext ¶
func GetStackformsVars ¶
func GetStackformsVars(cmd *cobra.Command, defaults *models.FormVariables) (*models.FormVariables, error)
GetStackformsVars wrap the flag parsing and the merge of the variables set by the user. The caller must provide the defaults values as he only knows if it must be fetched from a stack or a current component.
func MergeJSONFileVars ¶
func MergeJSONFileVars(jsonFiles []string) (*models.FormVariables, error)
MergeJSONFileVars will read and merge the Stackforms vars from the `json-file` arg
func MergeJSONVars ¶
func MergeJSONVars(jsonVars []string) (*models.FormVariables, error)
MergeJSONVars expect an array of valid JSON string as stackforms input and return a models.FormVariables
func MergeStackformsVars ¶
func MergeStackformsVars(defaults *models.FormVariables, envVars *models.FormVariables, jsonFiles, jsonStrings []string, keyValueField map[string]string) (*models.FormVariables, error)
MergeStackformsVars will parse and merge all variables inputs in the following order of precedence: file < jsonString < keyValueField
func PickRandomColor ¶
PickRandomColor will select a random color, if you fill env != nil it will try to infer the color based on the env name with our convention. This is define in the FE here: https://github.com/cycloidio/youdeploy-frontend-web/blob/develop/src/utils/config/icons.js
func PickRandomIcon ¶
PickRandomIcon will select a random icon, if you fill env != nil it will try to infer the icon based on the env name with our convention. This is define in the FE here: https://github.com/cycloidio/youdeploy-frontend-web/blob/develop/src/utils/config/icons.js
func UpdateFormVar ¶
func UpdateFormVar(field string, value string, vars models.FormVariables) error
UpdateFormVar will take a Stackform variable ref in the format section.group.var and update its value. The value is passed as string but can be any valid 'JSON' type.
Types ¶
This section is empty.