env_ui

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatColorOptionsErr added in v0.1.7

func FormatColorOptionsErr(
	env Env,
	printOptions options_print.Options,
) (o string_format_writer.ColorOptions)

FormatColorOptionsErr decides whether stderr should be coloured.

func FormatColorOptionsOut added in v0.1.7

func FormatColorOptionsOut(
	env Env,
	printOptions options_print.Options,
) (o string_format_writer.ColorOptions)

FormatColorOptionsOut decides whether stdout should be coloured based on the env's TTY state and the caller's print options.

func FormatOutputOptions added in v0.1.7

func FormatOutputOptions(
	env Env,
	printOptions options_print.Options,
) (o string_format_writer.OutputOptions)

FormatOutputOptions wraps FormatColorOptionsOut + Err for the common Both-streams case.

func Make

func Make(
	context errors.Context,
	cliConfig mad_domain_interfaces.CLIConfigProvider,
	debugOptions debug.Options,
	options Options,
) *env

func MakeDefault

func MakeDefault(ctx errors.Context) *env

func StringFormatWriterFields added in v0.1.7

StringFormatWriterFields builds dodder's box-formatted column writer with the truncation + color settings supplied. Free function (was previously a method) — has no env state of its own beyond the args.

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() mad_domain_interfaces.CLIConfigProvider

	Confirm(title, description string) (success bool)
	Retry(header, retry string, err error) (tryAgain bool)
}

TODO explore storing buffered writer and reader

type Options

type Options = mad_env_ui.Options

Options is aliased to madder's env_ui.Options so dodder env_ui.Env values structurally satisfy madder's env_ui.Env interface (whose GetOptions returns madder's Options; without the alias the return-type mismatch breaks satisfaction even though the structs are byte-identical). Required for #151 bucket B Stage A — env_repo hands a dodder env_local through to madder's blob_store_env.MakeBlobStoreEnv, which expects madder's env_local.

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