Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

orb-relay protos for dataxchg messages #5

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

59 changes: 59 additions & 0 deletions proto/dataxchg/dataxchg.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
syntax = "proto3";

package dataxchg;

import "google/protobuf/timestamp.proto";

// Indirect references to specific data sources
enum DataSource {
DATA_SOURCE_UNDEFINED = 0;
LATEST_SCAN_IMAGE = 1;
ORB_CONFIG = 2;
}

// binary format of source data
enum DataFormat {
DATA_FORMAT_UNDEFINED = 0;
JSON = 1;
CSV = 2;
PNG = 3;
JPEG = 4;
TEXT = 5;
RAW = 6;
}

// Reference to data source to be exchanged
message DataReference {
oneof source {
DataSource data_source = 1;
string file_path = 2;
}
}

// Metadata for data source
message DataSourceMetadata {
DataSource source = 1;
string file_path = 2;
DataFormat format = 3;
google.protobuf.Timestamp last_modified = 4;
uint32 size = 5;
}

//
// Data exchange messages
//

// Request to pull metadata for a data source
message OrbRelayDataMetadataPull { DataReference reference = 1; }

// Request to pull full data from a data source
message OrbRelayDataExchangePull { DataReference reference = 1; }

// Provide metadata for a data source
message OrbRelayDataMetadataPush { DataSourceMetadata source_metadata = 1; }

// Provide full data from a data source
message OrbRelayDataExchangePush {
DataSourceMetadata metadata = 1;
bytes data = 2; // bytes will be encoded in the format specified in metadata.format
}
7 changes: 7 additions & 0 deletions proto/relay.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package relay;

import "config/backend.proto";
import "config/orb.proto";
import "dataxchg/dataxchg.proto";
import "self_serve/app.proto";
import "self_serve/orb.proto";

Expand Down Expand Up @@ -54,6 +55,7 @@ message OrbCommand {
oneof command {
selfserve.OrbStartSelfServeSignupCommand orb_start_self_serve_signup_command = 1;
config.OrbReceiveConfigUpdate orb_receive_config_update = 2;
dataxchg.OrbRelayDataExchangePull orb_relay_data_exchange_pull = 3;
}
}

Expand All @@ -63,6 +65,7 @@ message OrbEvent {
selfserve.OrbSelfServeSessionStartedEvent orb_self_serve_session_started_event = 2;
selfserve.OrbSignupStartedEvent orb_signup_started_event = 3;
selfserve.OrbSignupCompletedEvent orb_signup_completed_event = 4;
dataxchg.OrbRelayDataExchangePush orb_relay_data_exchange_push = 5;
}
}

Expand All @@ -73,6 +76,7 @@ message AppCommand {
selfserve.NotifyAppSignupStartedCommand notify_app_signup_started_command = 3;
selfserve.AppReceiveSignupResultCommand app_receive_signup_result_command = 4;
selfserve.AppShowStartSignupButtonCommand app_show_start_signup_button_command = 5;
dataxchg.OrbRelayDataExchangePull orb_relay_data_exchange_pull = 6;
}
}

Expand All @@ -81,17 +85,20 @@ message AppEvent {
AppConnectRequestEvent app_connect_request_event = 1;
selfserve.AppRequestStartSelfServeFlowEvent app_request_start_self_serve_flow_event = 2;
selfserve.AppRequestStartSignupEvent app_request_start_signup_event = 3;
dataxchg.OrbRelayDataExchangePush orb_relay_data_exchange_push = 4;
}
}

message BackendEvent {
oneof event {
config.OrbUpdateConfigRequest orb_update_config_request = 1;
dataxchg.OrbRelayDataExchangePull orb_relay_data_exchange_pull = 2;
}
}

message BackendCommand {
oneof command {
config.OrbUpdateConfigResponse orb_update_config_response = 1;
dataxchg.OrbRelayDataExchangePush orb_relay_data_exchange_push = 2;
}
}
1 change: 1 addition & 0 deletions rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ server = []

[dependencies]
prost = "0.12.6"
prost-types = "0.12.6"
tonic = "0.11.0"

[build-dependencies]
Expand Down
1 change: 1 addition & 0 deletions rust/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ fn main() {
"../proto/self_serve/orb.proto",
"../proto/config/backend.proto",
"../proto/config/orb.proto",
"../proto/dataxchg/dataxchg.proto",
],
&["../proto"],
)
Expand Down
4 changes: 4 additions & 0 deletions rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ pub mod selfserve {
pub mod config {
tonic::include_proto!("config");
}

pub mod dataxchg {
tonic::include_proto!("dataxchg");
}
Loading