livepeer-rs

Crates.iolivepeer-rs
lib.rslivepeer-rs
version0.0.1
sourcesrc
created_at2022-12-14 21:24:23.825813
updated_at2022-12-14 21:24:23.825813
descriptionLens Protocol API client
homepage
repositoryhttps://github.com/gioelecerati/livepeer-rs
max_upload_size
id736972
size52,545
(gioelecerati)

documentation

README

livepeer-rs

0.0.1

Crate to interact with the Livepeer Studio API

Documentation

$ cargo doc
$ cd ./target/doc
$ python3 -m http.server 8080

http://localhost:8080/livepeer_client

Example usage

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);
        }
    };
}

Docs

https://docs.rs/crate/livepeer-rs/latest

Commit count: 0

cargo fmt