Documentation
¶
Overview ¶
Package app holds Deps, the dependencies every command receives.
Index ¶
Constants ¶
const LevelTrace = slog.LevelDebug - 4
LevelTrace is the level enabled by -vvv.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Deps ¶
type Deps struct {
Stdin io.Reader
Stdout io.Writer
Stderr io.Writer
Env Env
Clock func() time.Time
Getwd func() (string, error)
// HTTPTransport carries every outgoing request; nil means the network. Tests set a cassette.
HTTPTransport http.RoundTripper
// Logger is set by the root command before any RunE runs.
Logger *slog.Logger
// Config is nil until a command loads it.
Config *config.Result
}
Deps carries everything a command needs from the outside world.
type Env ¶
type Env []string
Env is an injected environment, in os.Environ "KEY=value" form.
type LogFormat ¶
type LogFormat string
LogFormat selects the slog handler.
func ParseLogFormat ¶
ParseLogFormat validates a --log-format value.