ui

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInterrupted = errors.New("user interrupted")

ErrInterrupted must be returned when user interrupted operation

Functions

This section is empty.

Types

type Dialog

type Dialog interface {
	// One result for one question
	One(ctx context.Context, question string, defaultValue string) (string, error)
	// Many results for one question
	Many(ctx context.Context, question string, defaultValue []string) ([]string, error)
	// Select one option from list
	Select(ctx context.Context, question string, defaultValue string, options []string) (string, error)
	// Choose several options from list
	Choose(ctx context.Context, question string, defaultValue []string, options []string) ([]string, error)
}

type UI

type UI interface {
	Dialog
	// Error shows error message
	Error(ctx context.Context, message string) error
	// Title shows UI title
	Title(ctx context.Context, message string) error
	// Info shows information message
	Info(ctx context.Context, message string) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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