output

package
v0.6.7 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OutColorStrings

func OutColorStrings(num int, inStrings string) (str string)

OutColorStrings return color code

func PushInput

func PushInput(isExit <-chan bool, output []io.WriteCloser, input io.Reader)

PushInput is Reader([io.PipeReader, os.Stdin]) to []io.WriteCloser.

Types

type Output

type Output struct {
	// Template variable value (in unimplemented).
	//     - ${COUNT}  ... Count value(int)
	//     - ${SERVER} ... Server Name
	//     - ${ADDR}   ... Address
	//     - ${USER}   ... User Name
	//     - ${PORT}   ... Port
	//     - ${DATE}   ... Date(YYYY/mm/dd)
	//     - ${YEAR}   ... Year(YYYY)
	//     - ${MONTH}  ... Month(mm)
	//     - ${DAY}    ... Day(dd)
	//     - ${TIME}   ... Time(HH:MM:SS)
	//     - ${HOUR}   ... Hour(HH)
	//     - ${MINUTE} ... Minute(MM)
	//     - ${SECOND} ... Second(SS)
	Templete string

	// prompt is Output prompt.
	Prompt string

	// target server name. ${SERVER}
	Server string

	// Count value. ${COUNT}
	Count int

	// Selected Server list
	ServerList []string

	// ServerConfig
	Conf conf.ServerConfig

	// Progress bar
	Progress   *mpb.Progress
	ProgressWG *sync.WaitGroup

	// Enable/Disable print header
	EnableHeader  bool
	DisableHeader bool

	// Auto Colorize flag
	// TODO(blacknon): colormodeに応じて、パイプ経由だった場合は色分けしないなどの対応ができるように条件分岐する(v0.6.2)
	AutoColor bool
}

Output struct. command execute and lssh-shell mode output data.

func (*Output) Create

func (o *Output) Create(server string)

Create template, set variable value.

func (*Output) GetPrompt

func (o *Output) GetPrompt() (p string)

GetPrompt update variable value

func (*Output) NewWriter

func (o *Output) NewWriter() (writer *io.PipeWriter)

NewWriter return io.WriteCloser at Output printer.

func (*Output) Printer

func (o *Output) Printer(reader io.ReadCloser)

Printer output stdout from reader.

func (*Output) ProgressPrinter

func (o *Output) ProgressPrinter(size int64, reader io.Reader, path string)

ProgressPrinter return print out progress bar

Jump to

Keyboard shortcuts

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