Documentation ¶
Overview ¶
Package input manages interaction with the user via input/output.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var InitSurvey = []*survey.Question{ { Name: "Name", Prompt: &survey.Input{Message: "Project name"}, Validate: survey.Required, }, { Name: "Type", Prompt: &survey.Select{Message: "Project type", Options: []string{ manifest.Executable.String(), manifest.Library.String(), }, }, }, { Name: "Description", Prompt: &survey.Input{Message: "Project description"}, }, { Name: "Version", Prompt: &survey.Input{ Message: "Project version", Default: "1.0.0", }, Validate: func(ans interface{}) error { _, err := semver.NewVersion(ans.(string)) return err }, Transform: func(ans interface{}) (newAns interface{}) { v, _ := semver.NewVersion(ans.(string)) return v.String() }, }, { Name: "License", Prompt: &survey.Input{ Message: "Project license", Default: "UNLICENSED", Help: "You can read about code licenses on https://choosealicense.com/", }, }, }
InitSurvey is the definition of the user interaction happening in the init command to choose project parameters.
View Source
var SurveyOptions = make([]survey.AskOpt, 0)
SurveyOptions is the options passed to the survey library
Functions ¶
func InitNonInteractive ¶ added in v0.1.1
func InitNonInteractive(val InitValues) (manifest.Manifest, error)
Types ¶
type InitValues ¶ added in v0.1.1
type LoginPayload ¶
LoginPayload is the data retrieved from the user to log them in.
func Login ¶
func Login() (*LoginPayload, error)
Login handles the user interaction during the login command.
Click to show internal directories.
Click to hide internal directories.