env_ui

package
v0.0.0-...-791c77c Latest Latest
Warning

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

Go to latest
Published: May 11, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Make

func Make(
	context errors.Context,
	kCli config_mutable_cli.Config,
	options Options,
) *env

func MakeDefault

func MakeDefault() *env

Types

type Env

type Env interface {
	// TODO remove and keep separate
	errors.Context

	GetOptions() Options
	GetIn() fd.Std
	GetInFile() io.Reader
	GetUI() fd.Std
	GetUIFile() interfaces.WriterAndStringWriter
	GetOut() fd.Std
	GetOutFile() interfaces.WriterAndStringWriter
	GetErr() fd.Std
	GetErrFile() interfaces.WriterAndStringWriter
	GetCLIConfig() config_mutable_cli.Config

	Confirm(message string) (success bool)
	Retry(header, retry string, err error) (tryAgain bool)

	FormatOutputOptions() (o string_format_writer.OutputOptions)
	FormatColorOptionsOut() (o string_format_writer.ColorOptions)
	FormatColorOptionsErr() (o string_format_writer.ColorOptions)
	StringFormatWriterFields(
		truncate string_format_writer.CliFormatTruncation,
		co string_format_writer.ColorOptions,
	) interfaces.StringEncoderTo[string_format_writer.Box]
}

type Options

type Options struct {
	UIFileIsStderr bool
	IgnoreTtyState bool
}

type OptionsGetter

type OptionsGetter interface {
	GetEnvOptions() Options
}

type ProgressWriter

type ProgressWriter struct {
	// contains filtered or unexported fields
}

func (*ProgressWriter) GetWritten

func (writer *ProgressWriter) GetWritten() int64

func (*ProgressWriter) GetWrittenHumanString

func (writer *ProgressWriter) GetWrittenHumanString() string

func (*ProgressWriter) Reset

func (writer *ProgressWriter) Reset()

func (*ProgressWriter) Write

func (writer *ProgressWriter) Write(p []byte) (n int, err error)

type Remote

type Remote struct {
}

Jump to

Keyboard shortcuts

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