interaction

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModeMainBranch     = "only main branch"
	ModeAllBranches    = "all branches"
	ModeSelectSpecific = "select branches"
	ModeTypeList       = "type IDs or names"
)

Variables

This section is empty.

Functions

func ApiHostValidator

func ApiHostValidator(val interface{}) error

func ValueRequired

func ValueRequired(val interface{}) error

Types

type Confirm

type Confirm struct {
	Label       string
	Description string
	Default     bool
	Help        string
}

type Prompt

type Prompt struct {
	Interactive bool // is terminal interactive?, can we ask questions?
	// contains filtered or unexported fields
}

func NewPrompt

func NewPrompt(stdin terminal.FileReader, stdout terminal.FileWriter, stderr terminal.FileWriter) *Prompt

func (*Prompt) Ask

func (p *Prompt) Ask(q *Question) (result string, ok bool)

func (*Prompt) Confirm

func (p *Prompt) Confirm(c *Confirm) bool

func (*Prompt) GetAllowedBranches

func (p *Prompt) GetAllowedBranches(allBranches []*model.Branch, isFlagSet bool, flagValue string) model.AllowedBranches

func (*Prompt) MultiSelect

func (p *Prompt) MultiSelect(s *Select) (result []string, ok bool)

func (*Prompt) Multiline

func (p *Prompt) Multiline(q *Question) (result string, ok bool)

func (*Prompt) Printf

func (p *Prompt) Printf(format string, a ...interface{})

func (*Prompt) Select

func (p *Prompt) Select(s *Select) (value string, ok bool)

func (*Prompt) SelectIndex

func (p *Prompt) SelectIndex(s *Select) (index int, ok bool)

type Question

type Question struct {
	Label       string
	Description string
	Help        string
	Validator   func(val interface{}) error
	Hidden      bool
}

type Select

type Select struct {
	Label       string
	Description string
	Help        string
	Options     []string
	Default     interface{}
	Validator   func(val interface{}) error
}

Jump to

Keyboard shortcuts

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