prompt

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory

type Factory interface {
	CreateSelectPrompt(label string, items interface{}, tmpls *promptui.SelectTemplates) SelectPrompt
	CreateInputPrompt(label string) InputPrompt
}

Factory makes prompts

type InputPrompt

type InputPrompt interface {
	Run() (string, error)
}

InputPrompt is a user prompt which can be Run

func CreateTokenInputPrompt

func CreateTokenInputPrompt(f Factory) InputPrompt

CreateTokenInputPrompt returns prompt for auth key

type Prompter

type Prompter struct{}

Prompter is an implementation of Factory which creates prompts from the github.com/manifoldco/promptui library

func (*Prompter) CreateInputPrompt

func (b *Prompter) CreateInputPrompt(label string) InputPrompt

CreateInputPrompt creates a input prompt

func (*Prompter) CreateSelectPrompt

func (b *Prompter) CreateSelectPrompt(label string, items interface{}, tmpls *promptui.SelectTemplates) SelectPrompt

CreateSelectPrompt creates a select prompt

type Repo

type Repo struct {
	Name string `json:"name"`
	Path string `json:"repo_path"`
}

Repo stores a repo and its location

type SelectPrompt

type SelectPrompt interface {
	Run() (int, string, error)
}

SelectPrompt is a user prompt which can be Run

func CreateDriverSelectPrompt

func CreateDriverSelectPrompt(f Factory, drivers interface{}) SelectPrompt

CreateDriverSelectPrompt returns prompt for driver

func CreateProtoclSelectPrompt

func CreateProtoclSelectPrompt(f Factory, protocols []string) SelectPrompt

CreateProtoclSelectPrompt returns prompt for driver

func CreateRepoSelectPrompt

func CreateRepoSelectPrompt(f Factory, repos interface{}) SelectPrompt

CreateRepoSelectPrompt returns a Prompt to select a Repo cache entry from a given list and return the selected repo

Jump to

Keyboard shortcuts

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