Crates.io | livepeer-rs |
lib.rs | livepeer-rs |
version | 0.0.1 |
source | src |
created_at | 2022-12-14 21:24:23.825813 |
updated_at | 2022-12-14 21:24:23.825813 |
description | Lens Protocol API client |
homepage | |
repository | https://github.com/gioelecerati/livepeer-rs |
max_upload_size | |
id | 736972 |
size | 52,545 |
0.0.1
Crate to interact with the Livepeer Studio
API
$ cargo doc
$ cd ./target/doc
$ python3 -m http.server 8080
http://localhost:8080/livepeer_client
use livepeer_rs::{vod::Vod, Livepeer, LivepeerEnv};
fn main() {
let _env = LivepeerEnv::Prod;
// Set up your Client
let lp_client = Livepeer::new(String::from("$YOUR_API_TOKEN"), Some(_env));
// Retrieve JSON of VOD assets
match lp_client.asset.list_assets() {
Ok(assets) => {
println!("Assets: {}", serde_json::to_string(&assets).unwrap());
}
Err(err) => {
println!("Error retrieving VOD assets: {:?}", err);
}
};
// Retrieve JSON of Livepeer Streams
match lp_client.stream.list_streams() {
Ok(streams) => {
println!("Streams: {}", serde_json::to_string(&streams).unwrap());
}
Err(err) => {
println!("Error retrieving streams: {:?}", err);
}
};
}