Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GitHubRelease ¶
type GitHubRelease struct {
TagName string `json:"tag_name"`
Name string `json:"name"`
Body string `json:"body"`
Draft bool `json:"draft"`
Prerelease bool `json:"prerelease"`
CreatedAt time.Time `json:"created_at"`
PublishedAt time.Time `json:"published_at"`
Assets []struct {
Name string `json:"name"`
BrowserDownloadURL string `json:"browser_download_url"`
Size int64 `json:"size"`
ContentType string `json:"content_type"`
} `json:"assets"`
}
GitHubRelease represents a GitHub release response
type UpdateInfo ¶
type UpdateInfo struct {
Version string `json:"version"`
DownloadURL string `json:"download_url"`
Checksum string `json:"checksum"`
ReleaseDate time.Time `json:"release_date"`
Changelog string `json:"changelog"`
Critical bool `json:"critical"`
AssetName string `json:"asset_name"`
AssetSize int64 `json:"asset_size"`
PreRelease bool `json:"pre_release"`
}
UpdateInfo represents information about an available update
type Updater ¶
type Updater struct {
// contains filtered or unexported fields
}
Updater handles application updates
func NewUpdater ¶
func NewUpdater(cfg *config.Config, logger *logger.Logger, currentVersion string, updaterConfig UpdaterConfig) *Updater
NewUpdater creates a new updater instance
func (*Updater) CheckForUpdate ¶
func (u *Updater) CheckForUpdate(ctx context.Context) (*UpdateInfo, error)
CheckForUpdate checks if a new version is available
func (*Updater) GetCurrentVersion ¶
GetCurrentVersion returns the current version
func (*Updater) SetGithubToken ¶
SetGithubToken sets the GitHub token for private repositories
Click to show internal directories.
Click to hide internal directories.