Code Monkey home page Code Monkey logo

aiven-rs's Introduction

aiven-rs

An async rust-sdk for Aiven

rust aiven

Linux Crates.io Docs.rs codecov


Resources

Getting Started

// tokio = "1.0"
// aiven_rs = "0.4.0"

use aiven_rs::{cloud::types::ResClouds, AivenClient};

#[tokio::main]
async fn main() {
  env_logger::init();
  // use std::env;
  //
  // let token = env::var("AIVEN_TOKEN").expect("Please set env variable to read AIVEN_TOKEN");
  // let client = AivenClient::from_token("https://api.aiven.io", "v1", &token);

  let client = AivenClient::new("https://api.aiven.io", "v1");
  let cloud_api = client.cloud();
  let output: ResClouds = cloud_api.list_all().await.unwrap();
  for cloud in &output.clouds {
    println!("{:?}", cloud.cloud_name);
  }
}

Running the examples:

RUST_LOG=aiven_rs=debug cargo run --example clouds

License

This project is licensed under

aiven-rs's People

Contributors

ansrivas avatar dependabot-preview[bot] avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

aiven-rs's Issues

AivenClient requires all parameters to have same type

AivenClient's new and from_token methods require all parameters to have type T when T: Into<String>. This restricts all parameters to use the same type. In the examples they are all &str. However, while version is likely to be &str, the other parameters may be String or similar types, depending on how they are obtained. To support different concrete types for these parameters, they should each have a different named generic type.

pub fn from_token<T, U, V>(base_url: U, version: V, token: T) -> AivenClient
	where
		T: Into<String>,
		U: Into<String>,
		V: Into<String>,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.