Private
Public Access
1
0

Retry auth automatically, remove tower dep

This commit is contained in:
2024-06-14 20:23:44 -07:00
parent 0dde0b9c53
commit cabd3b502a
8 changed files with 413 additions and 778 deletions

View File

@@ -1,17 +1,23 @@
use async_trait::async_trait;
pub use crate::model::Conversation;
use crate::model::JwtToken;
pub mod http_client;
pub use http_client::HTTPClient;
pub use http_client::HTTPAPIClient;
use self::http_client::Credentials;
#[async_trait]
pub trait APIInterface {
type Error;
// (GET) /version
async fn get_version(&self) -> Result<String, Self::Error>;
async fn get_version(&mut self) -> Result<String, Self::Error>;
// (GET) /conversations
async fn get_conversations(&self) -> Result<Vec<Conversation>, Self::Error>;
async fn get_conversations(&mut self) -> Result<Vec<Conversation>, Self::Error>;
// (POST) /authenticate
async fn authenticate(&mut self, credentials: Credentials) -> Result<JwtToken, Self::Error>;
}