key

package
Version: v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const CodeESC = 27 // \x1b = \d27= ESC

Variables

This section is empty.

Functions

This section is empty.

Types

type TKey

type TKey struct {
	KeyDefault      string  // The key to be returned if time out occurs
	TTL             int     // The time wait user input in seconds
	DescriptorFile  uintptr // For os.Stdout.Fd dependency injection
	ForceDefault    bool    // If true it will return the default key (for testing)
	DurationDefault int     // The default time wait user input in seconds
}

func New

func New() *TKey

New returns a new TKey instance pointer with default settings.

func (*TKey) Get

func (k *TKey) Get(keyDefault string, ttl int) (result string, err error)

Get returns the key from the user input.

Source Files

Jump to

Keyboard shortcuts

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