console

package module
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: MIT Imports: 14 Imported by: 1

README

console

golang console ui

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ask

func Ask(prompt string) (string, error)

Ask asks the user something

func AskBool

func AskBool(prompt string, target *bool, current bool) error

AskBool asks for a boolean value

func AskInt added in v0.0.4

func AskInt(prompt string, target *int, current int) error

AskInt asks for an integer value

func AskOptions

func AskOptions(prompt string, def string, required bool, mask bool) (string, error)

AskOptions ...

func AskPassword

func AskPassword(prompt string) (string, error)

AskPassword asks a password

func AskString

func AskString(prompt string, target *string, current string) error

AskString if current is empty, asks for prompt, stores the answer in target

func AskStringArray

func AskStringArray(prompt string, def []string, required bool) ([]string, error)

AskStringArray convert string array to string and asks

func WriteTable

func WriteTable(obj interface{}, header ...string)

WriteTable render the provided object as a table, object can be map, struct or array of struct(s)

func WriteTableTo

func WriteTableTo(w io.Writer, obj interface{}, header ...string)

WriteTableTo render the provided object to writer as a table, object can be map, struct or array of struct(s)

Types

This section is empty.

Jump to

Keyboard shortcuts

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