aboutsummaryrefslogtreecommitdiffstats
path: root/src/client.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/client.rs')
-rw-r--r--src/client.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/client.rs b/src/client.rs
index 098c0ac..f181e65 100644
--- a/src/client.rs
+++ b/src/client.rs
@@ -24,8 +24,10 @@ use reqwest::{
use serde::Serialize;
use serde_urlencoded;
use std::io::Read;
+use abook::AbookFetcher;
use xchan::XChanFetcher;
+pub const ZOTAPI_ABOOK_PATH : &str = "/api/z/1.0/abook";
pub const ZOTAPI_CHANNEL_STREAM_PATH : &str = "/api/z/1.0/channel/stream";
pub const ZOTAPI_NETWORK_STREAM_PATH : &str = "/api/z/1.0/network/stream";
pub const ZOTAPI_ITEM_UPDATE_PATH : &str = "/api/z/1.0/item/update";
@@ -48,6 +50,10 @@ impl Client {
}
}
+ pub fn abook(&self) -> AbookFetcher {
+ AbookFetcher::new(self)
+ }
+
pub fn channel_stream(&self) -> Result<String, Error> {
self.fetch_stream(ZOTAPI_CHANNEL_STREAM_PATH, &())
}