Skip to content

Commit ff03ea9

Browse files
authored
feat: add lokipb (#57)
* feat: add core/consensus/protocols * feat: add corepb * fix: linting errors after generation * refactor: put compilation logic into a separate module * feat: add peerinfopb * feat: add lokipb * fix: remove deps.txt
1 parent 214a411 commit ff03ea9

8 files changed

Lines changed: 62 additions & 1 deletion

File tree

crates/charon/build.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,8 @@
55
use std::io::Result;
66

77
fn main() -> Result<()> {
8-
charon_build_proto::compile_protos("src/peerinfo/peerinfopb/v1")
8+
charon_build_proto::compile_protos("src/peerinfo/peerinfopb/v1")?;
9+
charon_build_proto::compile_protos("src/log/loki/lokipb/v1")?;
10+
11+
Ok(())
912
}

crates/charon/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@
66
77
/// Peerinfo.
88
pub mod peerinfo;
9+
10+
/// Log
11+
pub mod log;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/// V1
2+
pub mod v1;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/// Loki protobuf definitions.
2+
pub mod loki;
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
syntax = "proto3";
2+
3+
package loki;
4+
5+
import "google/protobuf/timestamp.proto";
6+
7+
message PushRequest {
8+
repeated Stream streams = 1;
9+
}
10+
11+
message Stream {
12+
string labels = 1;
13+
repeated Entry entries = 2;
14+
uint64 hash = 3;
15+
}
16+
17+
message Entry {
18+
google.protobuf.Timestamp timestamp = 1;
19+
string line = 2;
20+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// This file is @generated by prost-build.
2+
#![allow(dead_code)]
3+
#![allow(missing_docs)]
4+
#![allow(clippy::all)]
5+
#![allow(rustdoc::all)]
6+
7+
#[derive(Clone, PartialEq, ::prost::Message)]
8+
pub struct PushRequest {
9+
#[prost(message, repeated, tag = "1")]
10+
pub streams: ::prost::alloc::vec::Vec<Stream>,
11+
}
12+
#[derive(Clone, PartialEq, ::prost::Message)]
13+
pub struct Stream {
14+
#[prost(string, tag = "1")]
15+
pub labels: ::prost::alloc::string::String,
16+
#[prost(message, repeated, tag = "2")]
17+
pub entries: ::prost::alloc::vec::Vec<Entry>,
18+
#[prost(uint64, tag = "3")]
19+
pub hash: u64,
20+
}
21+
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
22+
pub struct Entry {
23+
#[prost(message, optional, tag = "1")]
24+
pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
25+
#[prost(string, tag = "2")]
26+
pub line: ::prost::alloc::string::String,
27+
}

crates/charon/src/log/loki/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/// Loki protobuf definitions.
2+
pub mod lokipb;

crates/charon/src/log/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/// Loki
2+
pub mod loki;

0 commit comments

Comments
 (0)