init

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2021 License: MPL-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CustomPromptHandler added in v0.1.0

func CustomPromptHandler(promptType string, params map[string]string) error

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 NoCondition(map[string]string) bool

func NoValidation

func NoValidation(string) error

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 SpecificValueValidation(values ...string) func(string) error

func ValidateAKID

func ValidateAKID(input string) error

func ValidateProjectName

func ValidateProjectName(input string) error

ValidateProjectName validates Project Name field user input.

func ValidateSAK

func ValidateSAK(input string) error

Types

type CredentialPrompts

type CredentialPrompts struct {
	Vendor  string
	Prompts []PromptHandler
}

type CustomConditionSignature

type CustomConditionSignature func(map[string]string) bool

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL