zuul

A client library to interface with https://zuul-ci.org

1 unstable release

0.1.0 Nov 7, 2021

#1403 in Encoding

Apache-2.0

24KB
325 lines

A rust client for zuul-ci.org

crates.io

Use this library to query and decode zuul-web API.

Features

  • serde decoder for API endpoints.
  • reqwest client wrapper.
  • tokio async-stream for builds result.

Usage

Please read the documentation here. Additional learning resources: rust-cookbook.

How to use with Cargo:

[dependencies]
zuul = "0.1.0"

How to use in your crate:

use zuul;

How to run the zuul-builds stream utility:

$ cargo run --example zuul-build -- --url https://zuul.opendev.org/api/tenant/openstack

If you experience any difficulties, please don't hesistate to raise an issue.


lib.rs:

This library provides a client to interface with zuul-ci.

Installation

Add this to your Cargo.toml:

[dependencies]
zuul = "0.1"

Example

#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
    // Create the client
    let client = zuul::create_client("https://zuul.example.org/api/tenant/name")
            .expect("Invalid url");

    // Print the last 20 builds
    let builds = client.builds(0, 20).await?;
    println!("{:?}", builds);
}

Checkout the zuul-build.rs example for a complete async-stream usage.

Dependencies

~8–20MB
~283K SLoC