feature/ci-ruby-gems
claude/smbcloud-github-app-k9641p
development
feature/apps
feature/build-release
feature/ci-docs
feature/ci-ruby-gems
feature/cicd
feature/completion
feature/dist-nuget
feature/fix-ci-sdk-pypi-rubygem
feature/fix-clippy-on-stable-channel
feature/fix-deployment-script
feature/github-email
feature/gresiq-v1
feature/project-new-structure
feature/rsync-deploy
feature/ruby-runner
feature/sdk-npm
feature/sdk-workflows
feature/smbcloud-cli-release-npm
feature/smbcloud-deploy
feature/wasm
main
release/v0.7.4
| 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 | |
| 38 | mod client; |
| 39 | mod client_credentials; |
| 40 | mod error; |
| 41 | mod onde_apps; |
| 42 | |
| 43 | pub use client::GresiqClient; |
| 44 | pub use client_credentials::{base_url, GresiqCredentials}; |
| 45 | pub use error::GresiqError; |
| 46 | pub use onde_apps::{ |
| 47 | assign_model, create_app, list_apps, list_models, rename_app, OndeApp, OndeModel, |
| 48 | }; |
| 49 | pub use smbcloud_network::environment::Environment; |