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 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 PromptCredential(target, name string, credentials []auth.Credential, choices []string) (auth.Credential, int, error)
- func PromptDefault(prompt, name, preValue string, validators ...PromptValidator) (string, error)
- func PromptPassword(prompt, name string, validators ...PromptValidator) (string, error)
- func PromptURLWithRemote(prompt, name string, validRemotes []string, validators ...PromptValidator) (string, error)
- func QueryEditorInput(repo repository.RepoCommon, preQuery string) (string, error)
- func Required(name string, value 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 from 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 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 PromptCredential ¶
func PromptCredential(target, name string, credentials []auth.Credential, choices []string) (auth.Credential, int, error)
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 PromptURLWithRemote ¶
func PromptURLWithRemote(prompt, name string, validRemotes []string, validators ...PromptValidator) (string, error)
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.