#protobuf #analytics #generated #noelware #client #server #protocols

yanked nwl-protobufs-rust

🧭📦 Rust crate for the generated protobufs for Noelware Analytics

0.1.0 May 16, 2022

#86 in #analytics

MIT license

16KB
200 lines

🧭📦 Noelware Analytics - Protocol Buffers for Rust

Rust crate for the generated protobufs for Noelware Analytics

Why?

The analytics server is built with Rust and actix, this is a package to generate the protobufs as a Rust crate.

License

Noelware Analytics - Protocol Buffers for Rust is released under the MIT License with love by Noelware. 💜 :3


lib.rs:

This is the Rust crate for using Noelware's Analytics API which includes a client implementation under the [protos/][protos] module.

This was meant to be in use with the analytics-server, but you can use the client to request to your instances.

Example

use nwl_protobufs_rust::protos::*;

fn main() -> Result<(), Box<dyn std::error::Error>> {
   // [::1]:50051 is the server that uses Noelware Analytics.
   // The server must implement a gRPC endpoint.
   //
   // Supported products: charted-server, Arisu
   // Using official instances will not work.
   let mut client = AnalyticsClient::connect("http://[::1]:50051").await?;

   let request = tonic::Request::new(ConnectionAckRequest {});
   let res = client.connection_ack(request).await?;

   Ok(())
}

Dependencies

~5.5–7.5MB
~130K SLoC