Expand description
Self-update version check functionality.
This module provides functionality to check for newer versions of dcg by querying the GitHub Releases API. Results are cached to avoid API spam.
Structs§
- Backup
Entry - Backup entry metadata stored alongside the backup binary.
- Version
Check Result - Result of a version check operation.
Enums§
- Version
Check Error - Errors that can occur during version check or update.
Constants§
- CACHE_
DURATION - Cache duration for version checks (24 hours).
Functions§
- backup_
dir - Get the path to the backup directory.
- check_
for_ update - Check for updates, using cache if available.
- clear_
cache - Clear the version check cache.
- create_
backup - Create a backup of the current dcg binary before updating.
- current_
version - Get the current version of dcg from Cargo.toml.
- format_
backup_ list - Format backup list for display.
- format_
check_ result - Format the version check result for display.
- format_
check_ result_ json - Format version check result as JSON.
- get_
update_ notice - Get an update notice from the cache without blocking.
- is_
update_ check_ enabled - Check if update checking is enabled via environment variable.
- list_
backups - List all available backup versions, sorted by creation time (newest first).
- read_
cached_ check - Read a cached version check result if it is still fresh.
- rollback
- Rollback to a previous version.
- spawn_
background_ check - Spawn a background thread to check for updates.
- spawn_
update_ check_ if_ needed - Spawn a background update check to refresh the cache if needed.