Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Check ¶
func Check(ctx context.Context, currentVersion string, cliVersioner Versioner) (current, latest semver.Version, shouldUpdate bool, err error)
Check if the CLI can be updated.
func CheckAsync ¶
func CheckAsync(ctx context.Context, file config.File, configFilePath string, currentVersion string, cliVersioner Versioner) (printResults func(io.Writer))
CheckAsync is a helper function for Check. If the app config's LastChecked time has past the specified TTL, launch a goroutine to perform the Check using the provided context. Return a function that will print an informative message to the writer if there is a newer version available.
Callers should invoke CheckAsync via
f := CheckAsync(...) defer f()
Types ¶
type GitHub ¶
type GitHub struct {
// contains filtered or unexported fields
}
GitHub is a versioner that uses GitHub releases.
func (GitHub) LatestVersion ¶
LatestVersion implements the Versioner interface.
func (*GitHub) RenameLocalBinary ¶ added in v0.27.0
RenameLocalBinary will rename the downloaded binary.
NOTE: this exists so that we can, for example, rename a binary such as 'viceroy' to something less ambiguous like 'fastly-localtesting'.
type RootCommand ¶
RootCommand is the parent command for all subcommands in this package. It should be installed under the primary root command.
func NewRootCommand ¶
func NewRootCommand(parent common.Registerer, configFilePath string, cliVersioner Versioner, client api.HTTPClient, globals *config.Data) *RootCommand
NewRootCommand returns a new command registered in the parent.