Documentation ¶
Index ¶
- func CustomPromptHandler(promptType string, params map[string]string) error
- func Init(outDir, localModulePath, registryFilePath 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 ValidateOrganizationName(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, localModulePath, registryFilePath string) *projectconfig.ZeroProjectConfig
Create cloud provider context
func NoCondition ¶
NoCondition is a no-op condition check function that always returns true
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 ¶
SpecificValueValidation is a validation function that checks if the value is in the list of options
func ValidateAKID ¶
ValidateAKID checks if the input is a valid AWS Access Key ID
func ValidateOrganizationName ¶ added in v0.2.4
ValidateOrganizationName validates Organization Name field user input.
func ValidateProjectName ¶
ValidateProjectName validates Project Name field user input.
func ValidateSAK ¶
ValidateSAK checks if the input is a valid AWS Secret Access Key
Types ¶
type CredentialPrompts ¶
type CredentialPrompts struct { Vendor string Prompts []PromptHandler }
CredentialPrompts is a list of prompts for sensitive credentials
type CustomConditionSignature ¶
CustomConditionSignature is the function signature of a custom condition. It takes a map of parameters and returns a boolean
func KeyMatchCondition ¶
func KeyMatchCondition(key string, value string) CustomConditionSignature
KeyMatchCondition is a condition that checks if the key matches the value
type PromptHandler ¶
type PromptHandler struct { moduleconfig.Parameter Condition CustomConditionSignature Validate func(string) error }
PromptHandler defines how a user is prompted for a parameter, containing information about the parameter, conditions, and value validation
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