Skip to content
5 changes: 4 additions & 1 deletion crates/charon/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@
use std::io::Result;

fn main() -> Result<()> {
charon_build_proto::compile_protos("src/peerinfo/peerinfopb/v1")
charon_build_proto::compile_protos("src/peerinfo/peerinfopb/v1")?;
charon_build_proto::compile_protos("src/log/loki/lokipb/v1")?;

Ok(())
}
3 changes: 3 additions & 0 deletions crates/charon/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@

/// Peerinfo.
pub mod peerinfo;

/// Log
pub mod log;
2 changes: 2 additions & 0 deletions crates/charon/src/log/loki/lokipb/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/// V1
pub mod v1;
2 changes: 2 additions & 0 deletions crates/charon/src/log/loki/lokipb/v1.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/// Loki protobuf definitions.
pub mod loki;
20 changes: 20 additions & 0 deletions crates/charon/src/log/loki/lokipb/v1/loki.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
syntax = "proto3";

package loki;

import "google/protobuf/timestamp.proto";

message PushRequest {
repeated Stream streams = 1;
}

message Stream {
string labels = 1;
repeated Entry entries = 2;
uint64 hash = 3;
}

message Entry {
google.protobuf.Timestamp timestamp = 1;
string line = 2;
}
27 changes: 27 additions & 0 deletions crates/charon/src/log/loki/lokipb/v1/loki.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// This file is @generated by prost-build.
#![allow(dead_code)]
#![allow(missing_docs)]
#![allow(clippy::all)]
#![allow(rustdoc::all)]

#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PushRequest {
#[prost(message, repeated, tag = "1")]
pub streams: ::prost::alloc::vec::Vec<Stream>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Stream {
#[prost(string, tag = "1")]
pub labels: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub entries: ::prost::alloc::vec::Vec<Entry>,
#[prost(uint64, tag = "3")]
pub hash: u64,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Entry {
#[prost(message, optional, tag = "1")]
pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "2")]
pub line: ::prost::alloc::string::String,
}
2 changes: 2 additions & 0 deletions crates/charon/src/log/loki/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/// Loki protobuf definitions.
pub mod lokipb;
2 changes: 2 additions & 0 deletions crates/charon/src/log/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/// Loki
pub mod loki;