Categorygithub.com/tanema/gluey
modulepackage
0.0.3
Repository: https://github.com/tanema/gluey.git
Documentation: pkg.go.dev

# README

Gluey

Go Reference

Graphical Line User Experience Yes

Gluey is an opinionated graphic input library for CLI applications. It aims to have a simple cross platform interface over configuability. It is meant to be a port of CLI::UI for Go.

Example

A simple example of how easy it is to use

ctx := gluey.New()
// required text input
username, err := ctx.Ask("Username")
// Hidden output
passwd, err := ctx.Password("Password")
// confirm with default to true
agree, err := ctx.ConfirmDefault("Do you agree to our terms", true)
// Select Single
id, hardness, err := ctx.Select(
  "How hard is it to use this library?",
  []string{"Easy", "Medium", "Hard", "WTF"},
)
// Select Many
ids, editors, err := ctx.SelectMultiple(
  "Which Text Editors do you use",
  []string{"Vim", "Emacs", "Sublime", "VSCode", "Atom", "other"},
)

# Packages

No description provided by the author
No description provided by the author

# Functions

Fmt will format a string template with color and icons.
New builds a new UI context that every element will be based on.

# Structs

Bar is a single progress bar.
Ctx allows use to keep a root object for all elements.
Frame is a box around output that can be nested.
GroupError will combine errors for a group of concurrent jobs and make them act as a single error but with the ability to still access the errors.
ProgressGroup tracks a group of progress bars.
Select represents a list of items used to enable selections, they can be used as search engines, menus or as a list of items in a cli based prompt.
SpinGroup keeps a group of spinners and their statuses.
Spinner is a single spinning status indicator.

# Type aliases

FrameFunc is the function call that is called inside the frame.