Skip to content

Commit

Permalink
Merge branch 'main' into chore/clean
Browse files Browse the repository at this point in the history
  • Loading branch information
abcpro1 authored Sep 19, 2023
2 parents 9ecba92 + 770be3d commit fcaeb29
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 3 deletions.
5 changes: 5 additions & 0 deletions dozer-types/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,15 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
.protoc_arg("--experimental_allow_proto3_optional")
.file_descriptor_set_path(out_dir.join("live.bin"))
.compile(&["protos/live.proto"], &["protos"])?;
tonic_build::configure()
.protoc_arg("--experimental_allow_proto3_optional")
.file_descriptor_set_path(out_dir.join("telemetry.bin"))
.compile(&["protos/telemetry.proto"], &["protos"])?;
tonic_build::configure()
.protoc_arg("--experimental_allow_proto3_optional")
.file_descriptor_set_path(out_dir.join("api_explorer.bin"))
.compile(&["protos/api_explorer.proto"], &["protos"])?;

// Sample service generated for tests and development
let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
tonic_build::configure()
Expand Down
12 changes: 12 additions & 0 deletions dozer-types/protos/cloud.proto
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,23 @@ service DozerCloud {
rpc get_resources(GetResourcesRequest) returns (ResourcesResponse);

rpc Subscribe(google.protobuf.Empty) returns (stream Notification);

rpc list_notifications(ListNotificationsRequest) returns (ListNotificationsResponse);
}

service DozerPublic {
rpc company_metadata(CompanyRequest) returns (CompanyResponse);
}
message ListNotificationsRequest {
string app_id = 1;
optional uint32 limit = 2;
optional uint32 offset = 3;
}

message ListNotificationsResponse {
repeated Notification notifications = 1;
Pagination pagination = 2;
}
message CreateAppRequest {
repeated File files = 3;
}
Expand Down
9 changes: 6 additions & 3 deletions dozer-types/protos/cloud_notification.proto
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
syntax = "proto3";
package dozer.cloud;
import "google/protobuf/timestamp.proto";

message Notification {
string namespace = 1;
Level level = 2;
string id = 1;
google.protobuf.Timestamp created_at = 2;
string namespace = 3;
Level level = 4;
oneof kind {
PodNotification pod = 3;
PodNotification pod = 5;
}
}

Expand Down
22 changes: 22 additions & 0 deletions dozer-types/protos/telemetry.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
syntax = "proto3";
package dozer.telemetry;

service TelemetryService {
rpc get_metrics(MetricsRequest) returns (MetricsResponse);
}

enum QueryType {
QUERY = 0;
RANGE = 1;
}

message MetricsRequest {
string app_id = 1;
QueryType query_type = 2;
string query = 3;
optional uint64 start = 4;
optional uint64 end = 5;
optional uint32 step = 6;
}

message MetricsResponse { string content = 1; }
6 changes: 6 additions & 0 deletions dozer-types/src/grpc_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ pub mod live {
pub const FILE_DESCRIPTOR_SET: &[u8] = tonic::include_file_descriptor_set!("live");
}

pub mod telemetry {
#![allow(clippy::derive_partial_eq_without_eq)]
tonic::include_proto!("dozer.telemetry");
pub const FILE_DESCRIPTOR_SET: &[u8] = tonic::include_file_descriptor_set!("telemetry");
}

pub mod api_explorer {
#![allow(clippy::derive_partial_eq_without_eq)]
tonic::include_proto!("dozer.api_explorer");
Expand Down

0 comments on commit fcaeb29

Please sign in to comment.