Documentation
¶
Index ¶
- func CustomPromptHandler(promptType string, params map[string]string) error
- func Init(outDir string, localModulePath string) *projectconfig.ZeroProjectConfig
- func NoCondition(map[string]string) bool
- func NoValidation(string) error
- func PromptModuleParams(moduleConfig moduleconfig.ModuleConfig, parameters map[string]string) (map[string]string, error)
- func SpecificValueValidation(values ...string) func(string) error
- func ValidateAKID(input string) error
- func ValidateProjectName(input string) error
- func ValidateSAK(input string) error
- type CredentialPrompts
- type CustomConditionSignature
- type PromptHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CustomPromptHandler ¶ added in v0.1.0
CustomPromptHandler handles non-input and enum options prompts zero-module's parameters allow prompts to specify types of custom actions this allows non-standard enum / string input to be added, such as AWS profile picker
func Init ¶
func Init(outDir string, localModulePath string) *projectconfig.ZeroProjectConfig
Create cloud provider context
func NoCondition ¶
func NoValidation ¶
func PromptModuleParams ¶
func PromptModuleParams(moduleConfig moduleconfig.ModuleConfig, parameters map[string]string) (map[string]string, error)
PromptModuleParams renders series of prompt UI based on the config
func SpecificValueValidation ¶
func ValidateAKID ¶
func ValidateProjectName ¶
ValidateProjectName validates Project Name field user input.
func ValidateSAK ¶
Types ¶
type CredentialPrompts ¶
type CredentialPrompts struct { Vendor string Prompts []PromptHandler }
type CustomConditionSignature ¶
func CustomCondition ¶
func CustomCondition(fn CustomConditionSignature) CustomConditionSignature
func KeyMatchCondition ¶
func KeyMatchCondition(key string, value string) CustomConditionSignature
type PromptHandler ¶
type PromptHandler struct { moduleconfig.Parameter Condition CustomConditionSignature Validate func(string) error }
func (PromptHandler) RunPrompt ¶ added in v0.1.0
func (p PromptHandler) RunPrompt(projectParams map[string]string, envVarTranslationMap map[string]string) error
RunPrompt obtains the value of PromptHandler depending on the parameter's definition for the project config, there are multiple ways of obtaining the value values go into params depending on `Condition` as the highest precedence (Whether it gets this value) then follows this order to determine HOW it obtains that value 1. Execute (this could potentially be refactored into type + data) 2. type: specific ways of obtaining values (in AWS credential case it will set 2 values to the map) 3. value: directly assigns a value to a parameter 4. prompt: requires users to select an option OR input a string