Documentation
¶
Index ¶
- func FormatColorOptionsErr(env Env, printOptions options_print.Options) (o string_format_writer.ColorOptions)
- func FormatColorOptionsOut(env Env, printOptions options_print.Options) (o string_format_writer.ColorOptions)
- func FormatOutputOptions(env Env, printOptions options_print.Options) (o string_format_writer.OutputOptions)
- func Make(context errors.Context, cliConfig mad_domain_interfaces.CLIConfigProvider, ...) *env
- func MakeDefault(ctx errors.Context) *env
- func StringFormatWriterFields(truncate string_format_writer.CliFormatTruncation, ...) interfaces.StringEncoderTo[string_format_writer.Box]
- type Env
- type Options
- type OptionsGetter
- type ProgressWriter
- type Remote
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 StringFormatWriterFields ¶ added in v0.1.7
func StringFormatWriterFields( truncate string_format_writer.CliFormatTruncation, co string_format_writer.ColorOptions, ) interfaces.StringEncoderTo[string_format_writer.Box]
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 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{}
Source Files
¶
- confirm.go
- format_components.go
- main.go
- options.go
- progress_writer.go
- remote.go
- retry.go