aboutsummaryrefslogtreecommitdiffstats
path: root/src/xchan.rs
Commit message (Collapse)AuthorAgeFilesLines
* Another reqrite...Harald Eilertsen2023-03-291-53/+1
| | | | | | | | | | | | | | | | | | Third time must be where it sits I hope. I felt the API was getting a bit too distracted by unnecessary constructs and abstractions, so I'm trying to simplify it by making it more straight forward. The idea now is to have one main API class (ZotApi), and all the various remote API's as public methods on this basic class. Iow, the ZotApi class is mainly based on the existing `Client` class, which is then being phased out. And instead of having each API tied to the data type they return, I'm just adding methods that will return the respective data types. This should reduce coupling between the returned data, and the API calls themselves.
* Fetch abook and xchan directly from api.Harald Eilertsen2023-03-261-28/+96
| | | | We don't really need the intermediate layer in the binary module.
* Update reqwest and make async.Harald Eilertsen2021-07-051-2/+2
| | | | | | | | This means adding the full tokio as a dependency. While there isn't much gain to going async in the current cli demo app, a full fledged app may have more to gain by it. First foray into async rust, so I might not do it right...
* xchan: update internal api and parse results into struct.Your Name2020-05-021-10/+50
|
* xchan: rename request object type to XChanRequest.Your Name2020-05-021-12/+12
| | | | We want to have the XChan type for actial XChan data.
* Cargo fmtHarald Eilertsen2020-01-031-4/+1
|
* Move Client out of the api objects.Harald Eilertsen2020-01-031-12/+10
| | | | Also make constructor functions in the zotapi namespace.
* Use Url crate and move paths to submodules.Harald Eilertsen2020-01-031-2/+2
|
* Cargo fmtHarald Eilertsen2020-01-021-5/+3
|
* Replace serde_urlencoded with serde_qs.Harald Eilertsen2020-01-011-14/+4
| | | | Simplifies serialization of various types quite a bit.
* Use rust edition 2018.Harald Eilertsen2019-06-091-2/+4
|
* Use enum instead of BTreeMap to select xchan.Harald Eilertsen2018-08-231-7/+26
| | | | | | | | | Since it only makes sence to fetch an xchan by one of the methods (address, hash or guid) we don't need a data type that can hold more than one value. Had to implement my own serializer for it, since serde_urlencoded don't know how to serialize enums by default.
* Add fetching xchans by guid and has too.Harald Eilertsen2018-08-231-0/+10
|
* Add support for fetching xchan data by address.Harald Eilertsen2018-08-211-0/+42
Not entirely happy with it, have updated the signature of Client::fetch_stream and Client::url to take args, which are left out if they're not serializable (or empty, I hope.) Should probably use an Option instead, or maybe even two entry points for the api.