update code example

This commit is contained in:
glyph 2021-11-04 16:58:12 +02:00
parent 42a43189fc
commit c2cff416d0
1 changed files with 13 additions and 4 deletions

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