Documentation
¶
Index ¶
- type BrowserOpener
- type State
- func (s *State) AccountID() (string, error)
- func (s *State) Client(ctx context.Context) (*qcloudapi.Client, error)
- func (s *State) OpenBrowser(url string) error
- func (s *State) SetBrowserOpener(fn BrowserOpener)
- func (s *State) SetClient(c *qcloudapi.Client)
- func (s *State) SetUpdater(u Updater)
- func (s *State) Updater() (Updater, error)
- type Updater
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BrowserOpener ¶ added in v0.25.0
BrowserOpener opens a URL in the user's default browser.
type State ¶
type State struct {
Version string
Config *config.Config
Logger *slog.Logger
// contains filtered or unexported fields
}
State holds shared dependencies for all commands.
func (*State) OpenBrowser ¶ added in v0.25.0
OpenBrowser opens the given URL in the user's default browser.
func (*State) SetBrowserOpener ¶ added in v0.25.0
func (s *State) SetBrowserOpener(fn BrowserOpener)
SetBrowserOpener injects a browser opener, bypassing the default. For testing.
func (*State) SetUpdater ¶ added in v0.5.0
SetUpdater injects an Updater implementation.
type Updater ¶ added in v0.5.0
type Updater interface {
DetectLatest(ctx context.Context) (*selfupgrade.ReleaseInfo, bool, error)
UpdateSelf(ctx context.Context, currentVersion string) (*selfupgrade.ReleaseInfo, error)
}
Updater checks for and applies CLI updates.
Click to show internal directories.
Click to hide internal directories.