relnotify/lib.rs
1//! # gh-release-update-notifier
2//!
3//! A library for checking GitHub releases and notifying about updates.
4//!
5//! ## Example
6//!
7//! ```no_run
8//! use relnotify::{ReleaseNotifier, ReleaseNotifierConfig};
9//!
10//! #[tokio::main]
11//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
12//! let config = ReleaseNotifierConfig::new("owner/repo")
13//! .check_interval(3600000) // 1 hour
14//! .cache_file_path("/tmp/release-cache.json");
15//!
16//! let notifier = ReleaseNotifier::new(config)?;
17//!
18//! // Get the latest stable release
19//! if let Some(release) = notifier.get_latest_release(false).await? {
20//! println!("Latest release: {}", release.tag_name);
21//! }
22//!
23//! // Check if an update is available
24//! let result = notifier.check_version("1.0.0", false).await?;
25//! if result.update_available {
26//! if let Some(latest) = result.latest_release {
27//! println!("Update available: {}", latest.tag_name);
28//! }
29//! }
30//!
31//! Ok(())
32//! }
33//! ```
34
35mod error;
36mod notifier;
37mod types;
38
39pub use error::{ReleaseNotifierError, Result};
40pub use notifier::ReleaseNotifier;
41pub use types::{Release, ReleaseNotifierConfig, VersionCheckResult};