Documentation
¶
Overview ¶
Package commands holds the Cobra commands. Each command parses flags, calls the API client through the runtime, and renders; nothing here talks HTTP or the terminal directly.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( Version = "dev" Commit = "none" Date = "unknown" )
Build information, set by the linker (GoReleaser).
Functions ¶
Types ¶
type Deps ¶
type Deps struct {
In io.Reader
Out io.Writer
Err io.Writer
Getenv func(string) string
HTTP *http.Client
Store auth.Store
// OpenBrowser opens a URL; it returns an error when it can't.
OpenBrowser func(url string) error
Sleep func(context.Context, time.Duration) error
Now func() time.Time
NewKey func() string
// StdinTTY and StdoutTTY say whether the streams are terminals.
StdinTTY, StdoutTTY bool
// GitOrigin returns the `origin` remote URL of the current checkout, or "".
GitOrigin func() string
Hostname func() string
// PollInterval is how often --wait checks the session.
PollInterval time.Duration
// MakeRaw puts the terminal's input in raw mode for the interactive chat and returns the
// function that restores it. Nil: the chat reads plain lines.
MakeRaw func() (restore func(), err error)
// TermWidth is the terminal's width in columns; nil or 0 means 80.
TermWidth func() int
// RetryDelay overrides the API client's base retry delay when non-zero.
RetryDelay time.Duration
}
Deps is everything the commands need from the outside world, so tests can replace it.