Retry auth automatically, remove tower dep
This commit is contained in:
@@ -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>;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user