#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Empty {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Event {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub source: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub specversion: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub r#type: ::prost::alloc::string::String,
#[prost(map = "string, string", tag = "5")]
pub optattrs: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
#[prost(bytes = "vec", tag = "6")]
pub data: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamPublishRequest {
#[prost(message, repeated, tag = "1")]
pub batch: ::prost::alloc::vec::Vec<Event>,
#[prost(bool, tag = "2")]
pub fsync: bool,
#[prost(enumeration = "WriteAck", tag = "3")]
pub ack: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamPublishResponse {
#[prost(uint64, tag = "1")]
pub offset: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamSubscribeRequest {
#[prost(oneof = "stream_subscribe_request::Action", tags = "1, 2, 3")]
pub action: ::core::option::Option<stream_subscribe_request::Action>,
}
pub mod stream_subscribe_request {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Action {
#[prost(message, tag = "1")]
Setup(super::StreamSubscribeSetup),
#[prost(message, tag = "2")]
Ack(super::Empty),
#[prost(string, tag = "3")]
Nack(::prost::alloc::string::String),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamSubscribeSetup {
#[prost(string, tag = "1")]
pub group_name: ::prost::alloc::string::String,
#[prost(bool, tag = "2")]
pub durable: bool,
#[prost(uint32, tag = "3")]
pub max_batch_size: u32,
#[prost(oneof = "stream_subscribe_setup::StartingPoint", tags = "10, 11, 12")]
pub starting_point: ::core::option::Option<stream_subscribe_setup::StartingPoint>,
}
pub mod stream_subscribe_setup {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum StartingPoint {
#[prost(message, tag = "10")]
Beginning(super::Empty),
#[prost(message, tag = "11")]
Latest(super::Empty),
#[prost(uint64, tag = "12")]
Offset(u64),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamSubscribeResponse {
#[prost(message, repeated, tag = "1")]
pub batch: ::prost::alloc::vec::Vec<Event>,
#[prost(uint64, tag = "2")]
pub last_included_offset: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PipelineSubscribeRequest {
#[prost(string, tag = "1")]
pub pipeline: ::prost::alloc::string::String,
#[prost(oneof = "pipeline_subscribe_request::Action", tags = "10, 11, 12")]
pub action: ::core::option::Option<pipeline_subscribe_request::Action>,
}
pub mod pipeline_subscribe_request {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Action {
#[prost(string, tag = "10")]
StageName(::prost::alloc::string::String),
#[prost(message, tag = "11")]
Ack(super::PipelineStageOutput),
#[prost(string, tag = "12")]
Nack(::prost::alloc::string::String),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PipelineSubscribeResponse {
#[prost(string, tag = "1")]
pub stage: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub root_event: ::core::option::Option<Event>,
#[prost(map = "string, message", tag = "3")]
pub inputs: ::std::collections::HashMap<::prost::alloc::string::String, Event>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PipelineStageOutput {
#[prost(message, optional, tag = "1")]
pub output: ::core::option::Option<Event>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MetadataRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MetadataResponse {
#[prost(message, repeated, tag = "1")]
pub partitions: ::prost::alloc::vec::Vec<StreamPartition>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamPartition {
#[prost(uint32, tag = "1")]
pub partition: u32,
#[prost(string, tag = "2")]
pub internal: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub external: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum WriteAck {
All = 0,
Majority = 1,
None = 2,
}
#[doc = r" Generated client implementations."]
pub mod stream_controller_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[doc = " The Hadron stream controller interface."]
#[derive(Debug, Clone)]
pub struct StreamControllerClient<T> {
inner: tonic::client::Grpc<T>,
}
impl StreamControllerClient<tonic::transport::Channel> {
#[doc = r" Attempt to create a new client by connecting to a given endpoint."]
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> StreamControllerClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::ResponseBody: Body + Send + Sync + 'static,
T::Error: Into<StdError>,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_interceptor<F>(inner: T, interceptor: F) -> StreamControllerClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody>,
>,
<T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error: Into<StdError> + Send + Sync,
{
StreamControllerClient::new(InterceptedService::new(inner, interceptor))
}
#[doc = r" Compress requests with `gzip`."]
#[doc = r""]
#[doc = r" This requires the server to support it otherwise it might respond with an"]
#[doc = r" error."]
pub fn send_gzip(mut self) -> Self {
self.inner = self.inner.send_gzip();
self
}
#[doc = r" Enable decompressing responses with `gzip`."]
pub fn accept_gzip(mut self) -> Self {
self.inner = self.inner.accept_gzip();
self
}
#[doc = " Open a metadata stream."]
pub async fn metadata(
&mut self, request: impl tonic::IntoRequest<super::MetadataRequest>,
) -> Result<tonic::Response<tonic::codec::Streaming<super::MetadataResponse>>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| tonic::Status::new(tonic::Code::Unknown, format!("Service was not ready: {}", e.into())))?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/stream.StreamController/Metadata");
self.inner.server_streaming(request.into_request(), path, codec).await
}
#[doc = " Open a stream publisher channel."]
pub async fn stream_publish(
&mut self, request: impl tonic::IntoRequest<super::StreamPublishRequest>,
) -> Result<tonic::Response<super::StreamPublishResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| tonic::Status::new(tonic::Code::Unknown, format!("Service was not ready: {}", e.into())))?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/stream.StreamController/StreamPublish");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Open a stream subscriber channel."]
pub async fn stream_subscribe(
&mut self, request: impl tonic::IntoStreamingRequest<Message = super::StreamSubscribeRequest>,
) -> Result<tonic::Response<tonic::codec::Streaming<super::StreamSubscribeResponse>>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| tonic::Status::new(tonic::Code::Unknown, format!("Service was not ready: {}", e.into())))?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/stream.StreamController/StreamSubscribe");
self.inner.streaming(request.into_streaming_request(), path, codec).await
}
#[doc = " Open a pipeline subscriber channel."]
pub async fn pipeline_subscribe(
&mut self, request: impl tonic::IntoStreamingRequest<Message = super::PipelineSubscribeRequest>,
) -> Result<tonic::Response<tonic::codec::Streaming<super::PipelineSubscribeResponse>>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| tonic::Status::new(tonic::Code::Unknown, format!("Service was not ready: {}", e.into())))?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/stream.StreamController/PipelineSubscribe");
self.inner.streaming(request.into_streaming_request(), path, codec).await
}
}
}