aboutsummaryrefslogtreecommitdiffstats
path: root/src/group.rs
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2019-06-09 22:51:27 +0200
committerHarald Eilertsen <haraldei@anduin.net>2019-06-09 22:51:27 +0200
commitc9ac54435649973c1aa0543434cc344e66cf33f8 (patch)
tree6209b40117a60896c0d018b09a68d3e3a3690c46 /src/group.rs
parent051e884f55162498bae05e796b431e9122313c11 (diff)
downloadrust-zotapi-c9ac54435649973c1aa0543434cc344e66cf33f8.tar.gz
rust-zotapi-c9ac54435649973c1aa0543434cc344e66cf33f8.tar.bz2
rust-zotapi-c9ac54435649973c1aa0543434cc344e66cf33f8.zip
Fetch privacy groups.
Diffstat (limited to 'src/group.rs')
-rw-r--r--src/group.rs34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/group.rs b/src/group.rs
new file mode 100644
index 0000000..64a6847
--- /dev/null
+++ b/src/group.rs
@@ -0,0 +1,34 @@
+// zotapi - Rust wrapper for Sot API as implemented by Hubzilla
+// Copyright (C) 2018 Harald Eilertsen <haraldei@anduin.net>
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+use crate::{
+ client::{self, Client},
+ error::Error,
+};
+
+pub struct GroupFetcher<'a> {
+ client: &'a Client,
+}
+
+impl<'a> GroupFetcher<'a> {
+ pub fn new(client: &'a Client) -> GroupFetcher<'a> {
+ GroupFetcher { client }
+ }
+
+ pub fn fetch(&self) -> Result<String, Error> {
+ self.client.fetch_stream(client::ZOTAPI_GROUP_PATH, &())
+ }
+}