0.1.0 |
|
---|
#91 in #analytics
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
~129K SLoC