Documentation ¶
Overview ¶
Package input contains helpers to use a text editor as an input for various field of a bug
Index ¶
- Variables
- func BugCommentEditorInput(repo repository.RepoCommon, preMessage string) (string, error)
- func BugCommentFileInput(fileName string) (string, error)
- func BugCreateEditorInput(repo repository.RepoCommon, preTitle string, preMessage string) (string, string, error)
- func BugCreateFileInput(fileName string) (string, string, error)
- func BugTitleEditorInput(repo repository.RepoCommon, preTitle string) (string, error)
- func ChecklistEditorInput(repo repository.RepoCommon, checklist bug.Checklist) (bool, error)
- func ConfigEditorInput(repo repository.RepoCommon, existingConfig string) (string, error)
- func ConfigFileInput(fileName string) (string, error)
- func IdentityVersionKeyEditorInput(repo repository.RepoCommon, preMessage string) (string, error)
- func IsURL(name string, value string) (string, error)
- func Prompt(prompt, name string, validators ...PromptValidator) (string, error)
- func PromptChoice(prompt string, choices []string) (int, error)
- func PromptDefault(prompt, name, preValue string, validators ...PromptValidator) (string, error)
- func PromptPassword(prompt, name string, validators ...PromptValidator) (string, error)
- func QueryEditorInput(repo repository.RepoCommon, preQuery string) (string, error)
- func Required(name string, value string) (string, error)
- func TextFileInput(fileName string) (string, error)
- type PromptValidator
Constants ¶
This section is empty.
Variables ¶
var ErrEmptyMessage = errors.New("empty message")
ErrEmptyMessage is returned when the required message has not been entered
var ErrEmptyTitle = errors.New("empty title")
ErrEmptyMessage is returned when the required title has not been entered
Functions ¶
func BugCommentEditorInput ¶
func BugCommentEditorInput(repo repository.RepoCommon, preMessage string) (string, error)
BugCommentEditorInput will open the default editor in the terminal with a template for the user to fill. The file is then processed to extract a comment.
func BugCommentFileInput ¶
BugCommentFileInput read either from a file or from the standard input and extract a message
func BugCreateEditorInput ¶
func BugCreateEditorInput(repo repository.RepoCommon, preTitle string, preMessage string) (string, string, error)
BugCreateEditorInput will open the default editor in the terminal with a template for the user to fill. The file is then processed to extract title and message.
func BugCreateFileInput ¶
BugCreateFileInput read from either from a file or from the standard input and extract a title and a message
func BugTitleEditorInput ¶
func BugTitleEditorInput(repo repository.RepoCommon, preTitle string) (string, error)
BugTitleEditorInput will open the default editor in the terminal with a template for the user to fill. The file is then processed to extract a title.
func ChecklistEditorInput ¶
func ChecklistEditorInput(repo repository.RepoCommon, checklist bug.Checklist) (bool, error)
ChecklistEditorInput will open the default editor in the terminal with a checklist for the user to fill. The file is then processed to extract the comment and status for each question, results are added to checklist. Returns bool indicating if anything changed and any error value.
func ConfigEditorInput ¶
func ConfigEditorInput(repo repository.RepoCommon, existingConfig string) (string, error)
ConfigEditorInput will open the default editor in the terminal with a template for the user to fill.
func ConfigFileInput ¶
ConfigFileInput read either from a file or from the standard input and extract the config data
func IdentityVersionKeyEditorInput ¶
func IdentityVersionKeyEditorInput(repo repository.RepoCommon, preMessage string) (string, error)
IdentityVersionKeyEditorInput will open the default editor in the terminal with a template for the user to fill. The file is then processed to extract the key.
func Prompt ¶
func Prompt(prompt, name string, validators ...PromptValidator) (string, error)
Prompt is a simple text input.
func PromptChoice ¶
PromptChoice is a prompt giving possible choices Return the index starting at zero of the choice selected.
func PromptDefault ¶
func PromptDefault(prompt, name, preValue string, validators ...PromptValidator) (string, error)
PromptDefault is a simple text input with a default value.
func PromptPassword ¶
func PromptPassword(prompt, name string, validators ...PromptValidator) (string, error)
PromptPassword is a specialized text input that doesn't display the characters entered.
func QueryEditorInput ¶
func QueryEditorInput(repo repository.RepoCommon, preQuery string) (string, error)
QueryEditorInput will open the default editor in the terminal with a template for the user to fill. The file is then processed to extract a query.
func TextFileInput ¶
TextFileInput loads and returns the contents of a given file. If - is passed through, much like git, it will read from stdin. This can be piped data, unless there is a tty in which case the user will be prompted to enter a message.