io

package
v0.0.32 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSrcTooLarge = fmt.Errorf("source is too large")

Functions

func ConfirmInput

func ConfirmInput(title string, def bool) bool

ConfirmInput renders a confirm console input

func ReadInput

func ReadInput(title string, args *InputReaderArgs) (string, error)

ReadInput starts a prompt to collect single line input

Types

type ConfirmInputReader

type ConfirmInputReader func(title string, def bool) bool

ConfirmInputReader describes a function for reading user confirmation

type InputReader

type InputReader func(title string, args *InputReaderArgs) (string, error)

InputReader describes a function for reading input from stdin

type InputReaderArgs

type InputReaderArgs struct {
	Password bool
	Before   func()
	After    func(input string)
}

type ReadSeekerCloser

type ReadSeekerCloser interface {
	io.ReadSeeker
	io.Closer
}

func LimitedReadToTmpFile

func LimitedReadToTmpFile(src io.Reader, limit int64) (ReadSeekerCloser, error)

LimitedReadToTmpFile copies n bytes from src into a temporary file. It returns ErrSizeTooLarge if the reader contains more than maxSize and EOF is src has contains less bytes than maxSize. The caller is responsible for closing the returned reader.

Jump to

Keyboard shortcuts

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