Documentation
¶
Index ¶
- Constants
- type Asset
- type Manager
- func (m *Manager) CheckForUpdates(includePrerelease bool) (*UpdateInfo, error)
- func (m *Manager) DownloadUpdate(downloadURL string, progressFn func(downloaded, total int64)) (string, error)
- func (m *Manager) GetCurrentVersion() string
- func (m *Manager) InstallUpdate(archivePath string) error
- func (m *Manager) ListAvailableVersions() ([]string, error)
- func (m *Manager) Rollback() error
- type Release
- type UpdateInfo
Constants ¶
View Source
const ReleasesURL = "https://api.github.com/repos/apimgr/search/releases"
ReleasesURL is the URL to check for releases
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Asset ¶
type Asset struct {
Name string `json:"name"`
Size int64 `json:"size"`
DownloadURL string `json:"browser_download_url"`
ContentType string `json:"content_type"`
}
Asset represents a release asset
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles update operations
func (*Manager) CheckForUpdates ¶
func (m *Manager) CheckForUpdates(includePrerelease bool) (*UpdateInfo, error)
CheckForUpdates checks if a new version is available
func (*Manager) DownloadUpdate ¶
func (m *Manager) DownloadUpdate(downloadURL string, progressFn func(downloaded, total int64)) (string, error)
DownloadUpdate downloads the update to a temporary location
func (*Manager) GetCurrentVersion ¶
GetCurrentVersion returns the current version
func (*Manager) InstallUpdate ¶
InstallUpdate installs an update from a downloaded archive
func (*Manager) ListAvailableVersions ¶
ListAvailableVersions returns a list of available versions
type Release ¶
type Release 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 []Asset `json:"assets"`
}
Release represents a GitHub release
type UpdateInfo ¶
type UpdateInfo struct {
Available bool `json:"available"`
CurrentVersion string `json:"current_version"`
LatestVersion string `json:"latest_version"`
ReleaseNotes string `json:"release_notes"`
DownloadURL string `json:"download_url"`
AssetSize int64 `json:"asset_size"`
PublishedAt time.Time `json:"published_at"`
IsPrerelease bool `json:"is_prerelease"`
}
UpdateInfo contains information about an available update
Click to show internal directories.
Click to hide internal directories.