smbcloud_gresiq_sdk/smbcloud_gresiq_sdk.rs
1//! Rust client for the smbCloud GresIQ REST gateway.
2//!
3//! GresIQ is a managed-database layer inside smbCloud. It sits in front of
4//! a PostgreSQL database, adds API-key auth, and exposes a simple REST
5//! interface for inserting and querying rows.
6//!
7//! This crate handles the HTTP transport and auth headers. Schema knowledge
8//! (which tables exist, what the rows look like) lives in the caller.
9//!
10//! # Quick start
11//!
12//! ```no_run
13//! use smbcloud_gresiq_sdk::{Environment, GresiqClient, GresiqCredentials};
14//! use serde::Serialize;
15//!
16//! #[derive(Serialize)]
17//! struct Hit { path: String, status: u16 }
18//!
19//! #[tokio::main]
20//! async fn main() -> anyhow::Result<()> {
21//! let client = GresiqClient::from_credentials(
22//! Environment::Dev,
23//! GresiqCredentials {
24//! api_key: "your-key",
25//! api_secret: "your-secret",
26//! },
27//! );
28//!
29//! client.insert("hits", &Hit {
30//! path: "/api/chat".into(),
31//! status: 200,
32//! }).await?;
33//!
34//! Ok(())
35//! }
36//! ```
37
38mod client;
39mod client_credentials;
40mod error;
41mod onde_apps;
42
43pub use client::GresiqClient;
44pub use client_credentials::{base_url, GresiqCredentials};
45pub use error::GresiqError;
46pub use onde_apps::{
47 assign_model, create_app, list_apps, list_models, rename_app, OndeApp, OndeModel,
48};
49pub use smbcloud_network::environment::Environment;