ghost_io_api/lib.rs
1//! # ghost-io-api
2//!
3//! A strongly-typed, async Rust client for the [Ghost CMS](https://ghost.org/) Content API.
4//!
5//! ## Modules
6//!
7//! - [`auth`] — API key types and validation
8//! - [`client`] — HTTP clients for each Ghost API
9//! - [`error`] — [`GhostError`](error::GhostError) enum and [`Result`](error::Result) alias
10//! - [`models`] — serde-annotated structs for every Ghost resource
11//! - [`params`] — fluent query-parameter builders
12//!
13//! ## Quick start
14//!
15//! ```no_run
16//! use ghost_io_api::auth::content::ContentApiKey;
17//! use ghost_io_api::client::content::{BrowsePostsParams, GhostContentClient};
18//! use ghost_io_api::error::Result;
19//!
20//! #[tokio::main]
21//! async fn main() -> Result<()> {
22//! let key = ContentApiKey::new("22444f78447824223cefc48062")?;
23//! let client = GhostContentClient::new("https://demo.ghost.io", key)?;
24//!
25//! let response = client.browse_posts(BrowsePostsParams::default()).await?;
26//! for post in &response.posts {
27//! println!("{} — {}", post.title, post.slug);
28//! }
29//! Ok(())
30//! }
31//! ```
32
33#![warn(missing_docs)]
34
35pub mod auth;
36pub mod client;
37pub mod error;
38pub mod models;
39pub mod params;