app

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2025 License: MIT Imports: 7 Imported by: 0

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