Documentation ¶
Index ¶
- Constants
- Variables
- func Ask(qs []*survey.Question, response interface{}, opts ...survey.AskOpt)
- func AskOne(p survey.Prompt, response interface{}, opts ...survey.AskOpt)
- func ConfirmData(c *cli.Context, label string, data [][]string) bool
- func ConfirmDataWithMerge(c *cli.Context, label string, data [][]string) bool
- func ConfirmPrompt(label string) bool
- func GetClone(ctx *cli.Context, prev ...bool) bool
- func GetGenerateRepository(ctx *cli.Context, prev ...bool) bool
- func GetMatchRegex(ctx *cli.Context, prev ...bool) bool
- func GetOrAskForADescription(c *cli.Context, prev ...string) string
- func GetOrAskForAStringValue(c *cli.Context, field string, label string, prev ...string) string
- func GetOrAskForBool(c *cli.Context, field string, label string, prev ...bool) bool
- func GetOrAskForBoolDefaultTrue(c *cli.Context, field string, label string, prev ...bool) bool
- func GetOrAskForEmbedToken(ctx *cli.Context, prev ...bool) bool
- func GetOrAskForEnvironmentVars(c *cli.Context, prev ...map[string]string) map[string]string
- func GetOrAskForLocal(ctx *cli.Context, prev ...bool) bool
- func GetOrAskForSelection(c *cli.Context, field string, label string, items []string, prev ...string) string
- func GetOrAskForTags(c *cli.Context, prev ...[]string) (ret []string)
- func GetOrRequireABranch(c *cli.Context, prev ...string) string
- func GetOrRequireACall(c *cli.Context, source common.Source, prev ...string) string
- func GetOrRequireACommitMessage(c *cli.Context) (ret string)
- func GetOrRequireAMatch(c *cli.Context, prompt string, prev ...string) string
- func GetOrRequireAName(c *cli.Context, prompt string, prev ...string) string
- func GetOrRequireAPath(c *cli.Context, prompt string, prev ...string) string
- func GetOrRequireARepositoryName(ctx *cli.Context, prev ...string) string
- func GetOrRequireAString(c *cli.Context, field, prompt string, validator validateStringMethod, ...) string
- func GetOrRequireATimeout(ctx *cli.Context, prev ...uint64) (uint64, error)
- func GetOrRequireAUniqueName(c *cli.Context, prompt string, invalid []string, prev ...string) string
- func GetOrRequireAnEntryPoint(c *cli.Context, prev ...string) string
- func GetOrRequireMemoryAndType(ctx *cli.Context, new bool, prev ...uint64) (uint64, error)
- func GetOrSelectDomainsWithFQDN(ctx *cli.Context, prev ...string) ([]string, error)
- func GetOrSelectLanguage(ctx *cli.Context, prev ...string) (string, error)
- func GetOrSelectSource(ctx *cli.Context, prev ...string) (common.Source, error)
- func GetPrivate(ctx *cli.Context, prev ...bool) bool
- func GetSizeAndType(c *cli.Context, oldSize string, isNew bool) (size string)
- func GetUseACodeTemplate(ctx *cli.Context) bool
- func MultiSelect(c *cli.Context, cnf MultiSelectConfig) (ret []string)
- func NeedGenerateDomain(ctx *cli.Context) error
- func PanicIfPromptNotEnabled(prompt string)
- func RenderTable(data [][]string)
- func RenderTableWithMerge(data [][]string)
- func RequiredPaths(c *cli.Context, prev ...string) (ret []string)
- func RequiredString(c *cli.Context, prompt string, f stringPromptMethod, prev ...string) string
- func RequiredStringWithValidator(c *cli.Context, prompt string, f stringPromptMethod, ...) (ret string)
- func RequiredTags(c *cli.Context, prev ...[]string) (ret []string)
- func SelectABranch(c *cli.Context, repo *git.Repository) (branch string, err error)
- func SelectARepository(ctx *cli.Context, prev *repositoryLib.Info) (*repositoryLib.Info, error)
- func SelectARepositoryFromGithub() (common.Repository, error)
- func SelectAServiceWithProtocol(ctx *cli.Context, field string, prompt string, prev ...string) (string, error)
- func SelectATemplate(ctx *cli.Context, templateMap map[string]templates.TemplateInfo, ...) (url string, err error)
- func SelectInterface(names []string, prompt, _default string) (selectedInterface string, err error)
- func SelectInterfaceField(ctx *cli.Context, options []string, field string, prompt string, ...) (selected string, err error)
- func ValidateOk(err error) bool
- type MultiSelectConfig
Constants ¶
View Source
const ( // Prompts BranchPrompt = "Branch:" CommitMessagePrompt = "Commit Message:" DescriptionPrompt = "Description:" EntryPointPrompt = "Entry Point:" MemoryPrompt = "Memory:" PathsPrompt = "Paths [comma separated]:" SizePrompt = "Size:" TTLPrompt = "TTL:" UnitTypePrompt = "Unit type:" TrueSelect = "True" TrueSelectL = "true" FalseSelect = "False" FalseSelectL = "false" TagsPrompt = "Tags [comma separated]:" RegexPrompt = "Use Regex For Match:" LocalPrompt = "Local:" GenerateRepoPrompt = "Generate a Repository:" UseTemplatePrompt = "Use a Template:" SelectTemplatePrompt = "Select a Template:" RepositoryNamePrompt = "Repository Name:" RepositorySelectPrompt = "Select a Repository" ClonePrompt = "Clone this Repository" Domains = "Domains:" EmbedTokenPrompt = "Embed Git Token Into Clone URL:" BranchSelectPrompt = "Select a Branch:" PrivatePrompt = "Private:" SourcePrompt = "Code source:" CodeLanguagePrompt = "Code Language:" CallPrompt = "Entry Point:" TimeoutPrompt = "Time To Live:" NetworkPrompts = "Network:" NoDomainGeneratePrompt = "No domains found, generate one?" // Error messages Required = "Required" MustBeABooleanValue = "Must be a boolean value" FieldNotDefinedInConfig = "field not defined in config: %#v" DoubleStringNotFound = "%s %s not found" StringIsRequired = "%s is required" StringIsNotAValidSelection = "`%s` not a valid selection: %v" InvalidSize = "Invalid size: %s Ex:(10, 10GB, 10PB)" SelectPromptNoOptions = "no options to select from for prompt: %s" NoServiceFromFlag = "unable to find service with selection: (--%s %s)" // Device Errors TagLessThanThreeCharacters = "Tags cannot be less than three characters" )
Variables ¶
View Source
var ( NoServicesDefined = errors.New("no services defined in project config") NoValidDomains = errors.New("no valid domains") )
Errors
View Source
var PromptEnabled = true
View Source
var (
SelectionNone = "(none)"
)
Functions ¶
func ConfirmData ¶
func ConfirmDataWithMerge ¶
func ConfirmPrompt ¶
func GetGenerateRepository ¶
func GetMatchRegex ¶
func GetOrAskForADescription ¶
func GetOrAskForAStringValue ¶
func GetOrAskForBool ¶
func GetOrAskForEmbedToken ¶
func GetOrAskForEnvironmentVars ¶
Unused, was used in devices
func GetOrAskForLocal ¶
func GetOrAskForSelection ¶
func GetOrAskForTags ¶
func GetOrRequireABranch ¶
func GetOrRequireACall ¶
TODO parse the source, and make this a selection based on exported functions.
func GetOrRequireACommitMessage ¶
func GetOrRequireACommitMessage(c *cli.Context) (ret string)
func GetOrRequireAMatch ¶
func GetOrRequireAName ¶
func GetOrRequireAPath ¶
func GetOrRequireAString ¶
func GetOrRequireATimeout ¶
func GetOrRequireAUniqueName ¶
func GetOrSelectLanguage ¶
func GetOrSelectSource ¶
func GetPrivate ¶
func GetSizeAndType ¶
TODO should take and return expected type
func GetUseACodeTemplate ¶
func GetUseACodeTemplate(ctx *cli.Context) bool
func MultiSelect ¶
func MultiSelect(c *cli.Context, cnf MultiSelectConfig) (ret []string)
func NeedGenerateDomain ¶
func NeedGenerateDomain(ctx *cli.Context) error
NeedGenerateDomain checks for available domains if none found asks the user if they would like to generate one; returns an error
func PanicIfPromptNotEnabled ¶
func PanicIfPromptNotEnabled(prompt string)
func RenderTable ¶
func RenderTable(data [][]string)
func RenderTableWithMerge ¶
func RenderTableWithMerge(data [][]string)
func RequiredPaths ¶
func RequiredString ¶
func RequiredTags ¶
func SelectABranch ¶
func SelectABranch(c *cli.Context, repo *git.Repository) (branch string, err error)
func SelectARepository ¶
func SelectARepository(ctx *cli.Context, prev *repositoryLib.Info) (*repositoryLib.Info, error)
repository-id || repository-name/full-name
func SelectARepositoryFromGithub ¶
func SelectARepositoryFromGithub() (common.Repository, error)
func SelectATemplate ¶
func SelectInterface ¶
func SelectInterfaceField ¶
func ValidateOk ¶
Types ¶
Source Files ¶
- bool.go
- branch.go
- call.go
- cert.go
- channel_match.go
- clone.go
- commit_message.go
- confirm.go
- constants.go
- data.go
- description.go
- do_prompt.go
- domains.go
- entry_point.go
- env_vars.go
- error.go
- language.go
- local copy.go
- local.go
- memory.go
- multiselect.go
- name.go
- path.go
- paths.go
- private.go
- repository.go
- select.go
- selection.go
- service.go
- size.go
- source.go
- string.go
- survey.go
- tables.go
- tags.go
- template.go
- timeout.go
Click to show internal directories.
Click to hide internal directories.