Refactor to use an object-oriented pattern for Sbot #2

Merged
glyph merged 5 commits from sbot_object into main 2021-11-05 10:45:05 +00:00
4 changed files with 407 additions and 329 deletions
Showing only changes of commit c2cff416d0 - Show all commits

View File

@ -5,12 +5,21 @@ Rust wrapper around the Go `sbotcli` ScuttleButt tool ([cryptoscope/ssb](https:/
## Example
```rust
let id = "@p13zSAiOpguI9nsawkGijsnMfWmFd5rlUNpzekEE+vI=.ed25519";
use peach_sbotcli::{Sbot, SbotCliError};
let follow_ref = peach_sbotcli::follow(id)?;
let block_ref = peach_sbotcli::block(id)?;
fn example() -> Result<(), SbotCliError> {
// uses default paths for `sbotcli` and `go-sbot` working directory
let sbot = Sbot::init(None, None)?;
let invite_code = peach_sbotcli::create_invite()?;
let id = "@p13zSAiOpguI9nsawkGijsnMfWmFd5rlUNpzekEE+vI=.ed25519";
let follow_ref = sbot.follow(id)?;
let block_ref = sbot.block(id)?;
let invite_code = sbot.create_invite()?;
Ok(())
}
```
## Documentation