ui

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

The ui package contains functions for retrieving information from an end-user via the CLI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAuthDetails

func GetAuthDetails(a auth.Auth, prompterFactory func(message string, hidden bool) Prompter) (map[string]*auth.Detail, error)

GetAuthDetails retrieves the authentication details from the given authentication type and proceeds to prompt the user to provide input for each of the retrieved details. It returns the detail map configured with the input data from the end-user.

func NewSelectPrompt

func NewSelectPrompt(message string, options []string) *promptui.Select

NewSelectPrompt returns a promptui.SelectPrompt with its prompt message configured to the given message and the available options for the user to select configured to the given string slice.

Types

type Prompter

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

Prompter is used for testing purposes.

func NewPrompt

func NewPrompt(message string, hidden bool) Prompter

NewPrompt returns a promptui.Prompt which has its prompt message configured to the given message and adds an additional character mask if hidden is set to true.

Jump to

Keyboard shortcuts

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