stdio

package
v2.7.5 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 9 Imported by: 5

Documentation

Index

Constants

View Source
const MinPasswordLen = 0

Disable password length checking to let influxdb handle it

Variables

View Source
var TerminalStdio = newTerminalStdio(os.Stdin, os.Stdout, os.Stderr)

TerminalStdio interacts with users over stdin/stdout/stderr.

Functions

This section is empty.

Types

type StdIO

type StdIO interface {
	// Write prints some bytes to stdout.
	Write(p []byte) (n int, err error)
	// WriteErr prints some bytes to stderr.
	WriteErr(p []byte) (n int, err error)
	// Banner displays informational text to the user.
	Banner(message string) error
	// Error displays an error message to the user.
	Error(message string) error
	// IsInteractive signals whether interactive I/O is supported.
	IsInteractive() bool
	// GetStringInput prompts the user for arbitrary input.
	GetStringInput(prompt, defaultValue string) (string, error)
	// GetSecret prompts the user for a secret.
	GetSecret(prompt string, minLen int) (string, error)
	// GetPassword prompts the user for a secret twice, and inputs must match.
	// Uses stdio.MinPasswordLen as the minimum input length
	GetPassword(prompt string) (string, error)
	// GetConfirm asks the user for a y/n answer to a prompt.
	GetConfirm(prompt string) bool
}

Jump to

Keyboard shortcuts

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