Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCanceled = fmt.Errorf("operation canceled")
Functions ¶
This section is empty.
Types ¶
type App ¶
type App interface { Name() string Run(firstScreen Screen) error NewPassword(question string, hd func(string) Screen) Screen NewInput(question string, hd func(string) Screen) Screen NewMultiSelect(question string, choices []string, hd func(s []string) Screen) Screen NewOutput(message string, next func() Screen) Screen NewSelect(question string, choices []string, hd func(string) Screen) Screen NewError(message string) Screen }
type DateTime ¶
type DateTime string
the string is the format of the expected datetime (excel format)
type GUI ¶
type GUI interface { Input(msg string, prefilled string, hideText bool, opts GUIOptions) (res string, back bool, err error) Select(msg string, items []string, selected string, opts GUIOptions) (res string, back bool, err error) MultiSelect(msg string, items []string, preselected []string, opts GUIOptions) (res []string, back bool, err error) Output(msg string, opts GUIOptions) (back bool, err error) Error(msg string, opts GUIOptions) SetApp(a AppExt) }
var DefaultGUI GUI
type GUIOptions ¶ added in v0.2.0
type Option ¶
type Option func(s *app)
func WithBackNavigation ¶
func WithBackNavigation() Option
func WithBreadcrumb ¶
func WithBreadcrumb() Option
func WithDefaultGui ¶ added in v0.0.10
func WithDefaultGui() Option
func WithFooter ¶
func WithFooter() Option
func WithHeader ¶
func WithHeader() Option
type Screen ¶
type Screen interface { Name() string // ID is a unique identifyer for the screen // it is set to a UUID by default, but can be set via the WithID option (to get defined IDs) // defined IDs are necessary to fill back values when navigating back and forth between screens ID() string SetOptions(opts ...ScreenOption) }
func QuitScreen ¶
func QuitScreen() Screen
type ScreenOption ¶
type ScreenOption func(*screenConfig)
func WithCharLimit ¶ added in v0.0.7
func WithCharLimit(n int) ScreenOption
WithCharLimit sets the charlimit for an (input) screen
func WithID ¶ added in v0.0.7
func WithID(s string) ScreenOption
ID is a unique identifyer for the screen it is set to a UUID by default, but can be set via the WithID option (to get defined IDs) defined IDs are necessary to fill back values when navigating back and forth between screens
func WithName ¶ added in v0.0.7
func WithName(n string) ScreenOption
WithName sets the name of the screen
func WithPrefilled ¶ added in v0.0.7
func WithPrefilled(val interface{}) ScreenOption
WithPrefilled prefills the value of a screen
func WithValidator ¶ added in v0.0.7
func WithValidator(v Validator) ScreenOption
WithValidator sets a validator for a (input) screen
type Validator ¶
type Validator interface { // if the value is valid, nil is returned. otherwise we can use the error message Validate(v interface{}) error }
type ValidatorFunc ¶
type ValidatorFunc func(interface{}) error
var ( Any ValidatorFunc Int ValidatorFunc Float ValidatorFunc NonEmpty ValidatorFunc String ValidatorFunc )
func (ValidatorFunc) Validate ¶
func (fn ValidatorFunc) Validate(v interface{}) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.