app

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Client   *vers.Client
	IO       Output
	Prompter prompts.Prompter
	Runner   runrt.Runner
	Clock    Clock
	Env      Env
	Timeouts Timeouts
	BaseURL  *url.URL
	Verbose  bool
}

App is the dependency container for command handlers.

func New

func New(
	client *vers.Client,
	in io.Reader, out io.Writer, err io.Writer,
	prompter prompts.Prompter,
	runner runrt.Runner,
	baseURL *url.URL,
	verbose bool,
	timeouts Timeouts,
	env Env,
	clock Clock,
) *App

New constructs an App.

type Clock

type Clock interface{ Now() time.Time }

Clock provides time for testability.

type Env

type Env interface{ Get(key string) string }

Env abstracts environment variable access for testability.

type OSEnv

type OSEnv struct{}

OSEnv implements Env via os.Getenv.

func (OSEnv) Get

func (OSEnv) Get(key string) string

type Output

type Output struct {
	In  io.Reader
	Out io.Writer
	Err io.Writer
}

Output bundles standard IO streams.

type RealClock

type RealClock struct{}

RealClock implements Clock using time.Now.

func (RealClock) Now

func (RealClock) Now() time.Time

type Timeouts

type Timeouts struct {
	APIShort    time.Duration
	APIMedium   time.Duration
	APILong     time.Duration
	BuildUpload time.Duration
	SSHConnect  time.Duration
}

Timeouts centralize operation time budgets.

func DefaultTimeouts

func DefaultTimeouts() Timeouts

DefaultTimeouts returns conservative defaults aligning with current code.

Jump to

Keyboard shortcuts

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