ui

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AskForDateTime added in v0.26.0

func AskForDateTime(
	name,
	value string,
	convert func(string) (time.Time, error),
) (time.Time, error)

AskForDateTime interactively ask for one date and time from the user

func AskForDateTimeOrNil added in v0.26.0

func AskForDateTimeOrNil(
	name,
	value string,
	convert func(string) (time.Time, error),
) (*time.Time, error)

func AskForInt added in v0.26.0

func AskForInt(message string, d int) (int, error)

AskForInt interactively ask for one int from the user

func AskForText

func AskForText(message, d string, opts ...InputOption) (string, error)

AskForText interactively ask for one string from the user

func AskFromOptions

func AskFromOptions(message string, options []string, d string) (string, error)

AskFromOptions interactively ask the user to choose one option or none

func AskManyFromOptions

func AskManyFromOptions(message string, options, d []string) ([]string, error)

AskManyFromOptions interactively ask the user to choose none or many option

func Confirm

func Confirm(message string, d bool) (bool, error)

Confirm interactively ask the user a yes/no question

func WithSuggestion added in v0.26.0

func WithSuggestion(fn func(toComplete string) []string) func(*survey.Input)

WithSuggestion applies the suggestion function to the input question

Types

type InputOption added in v0.26.0

type InputOption func(*survey.Input)

InputOption represets a funcion the customizes a survey.Input object

type RGB added in v0.25.0

type RGB [3]int

func HEX added in v0.25.0

func HEX(hex string) (RGB, error)

func (RGB) B added in v0.25.0

func (c RGB) B() int

func (RGB) G added in v0.25.0

func (c RGB) G() int

func (RGB) R added in v0.25.0

func (c RGB) R() int

func (RGB) Values added in v0.25.0

func (c RGB) Values() []int

Jump to

Keyboard shortcuts

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