goiam/
lib.rs

1//! # GoIAM Rust SDK
2//!
3//! A lightweight Rust SDK for integrating with Go IAM server.
4//! Provides methods for authentication, user management, and resource creation.
5//!
6//! ## Quick Start
7//!
8//! ```rust,no_run
9//! use goiam::{new_service, Resource, Service};
10//!
11//! #[tokio::main]
12//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
13//!     let service = new_service(
14//!         "https://go-iam.example.com".to_string(),
15//!         "your-client-id".to_string(),
16//!         "your-secret".to_string(),
17//!     );
18//!     
19//!     // Verify authentication code
20//!     let token = service.verify("auth-code").await?;
21//!     
22//!     // Get user information
23//!     let user = service.me(&token).await?;
24//!     println!("User: {} ({})", user.name, user.email);
25//!     
26//!     // Create a resource
27//!     let resource = Resource::new("Resource Name".to_string(), "A sample resource".to_string(), "resource-key".to_string());
28//!     service.create_resource(&resource, &token).await?;
29//!     
30//!     Ok(())
31//! }
32//! ```
33
34pub mod error;
35pub mod service;
36pub mod service_impl;
37pub mod types;
38
39pub use error::{GoIamError, Result};
40pub use service::Service;
41pub use service_impl::{new_service, ServiceImpl};
42pub use types::{Resource, User, UserResource, UserRole};