Documentation
¶
Index ¶
Constants ¶
View Source
const ChannelEnvVar = "DCLI_AUTO_UPDATE_CHANNEL"
ChannelEnvVar selects which GitHub Releases channel the startup updater considers. stable (default): GitHub "latest" non-prerelease only. prerelease: newest semver among GitHub prereleases with a matching asset. beta / alpha: like prerelease but tag must contain "-beta" or "-alpha" (case-insensitive).
View Source
const DisableEnvVar = "DCLI_DISABLE_AUTO_UPDATE"
View Source
const TimeoutEnvVar = "DCLI_AUTO_UPDATE_TIMEOUT"
Variables ¶
View Source
var ErrReleaseNotFound = errors.New("latest release not found")
Functions ¶
This section is empty.
Types ¶
type GitHubClient ¶
func NewGitHubClient ¶
func NewGitHubClient() *GitHubClient
func (*GitHubClient) LatestRelease ¶
func (c *GitHubClient) LatestRelease(ctx context.Context, repository Repository, channel ReleaseChannel) (*Release, error)
type ReleaseChannel ¶
type ReleaseChannel string
ReleaseChannel controls which GitHub releases auto-update may install.
const ( ChannelStable ReleaseChannel = "stable" ChannelPrerelease ReleaseChannel = "prerelease" ChannelBeta ReleaseChannel = "beta" ChannelAlpha ReleaseChannel = "alpha" )
type Repository ¶
type Runner ¶
type Runner struct {
Client Client
Repository Repository
ReleaseChannel ReleaseChannel
DisableEnvVar string
Timeout time.Duration
Executable func() (string, error)
Environment func() []string
Restart func(exe string, args []string, env []string) error
}
func NewRunner ¶
func NewRunner(repository Repository) *Runner
Click to show internal directories.
Click to hide internal directories.