server/lib/src/generated/holger.grow.v1.rs
// This file is @generated by prost-build.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GrowStartRequest {
/// Per-member target in 512-byte sectors; 0 = whatever every member comes
/// back larger at.
#[prost(uint64, tag = "1")]
pub target_sectors_per_member: u64,
/// The go-ahead JSON ({v, signer, target_sectors, nonce, issued_unix_ms,
/// signature}); `monetize` signed under the box's monetize key (metered), or
/// `operator` on this admin door.
#[prost(bytes = "vec", tag = "2")]
pub go_ahead: ::prost::alloc::vec::Vec<u8>,
/// 0 = the box's own ceilings (600 s drain, 3600 s members).
#[prost(uint32, tag = "3")]
pub drain_timeout_secs: u32,
#[prost(uint32, tag = "4")]
pub wait_members_timeout_secs: u32,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GrowStatusRequest {}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GrowResumeRequest {
#[prost(bool, tag = "1")]
pub give_up: bool,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GrowMember {
#[prost(uint32, tag = "1")]
pub index: u32,
#[prost(string, tag = "2")]
pub device: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub partition: ::prost::alloc::string::String,
#[prost(uint64, tag = "4")]
pub disk_bytes: u64,
#[prost(uint64, tag = "5")]
pub set_bytes: u64,
#[prost(uint64, tag = "6")]
pub offered_bytes: u64,
#[prost(bool, tag = "7")]
pub larger: bool,
}
/// The boot stack's grow journal (/serialdat/grow-journal), summarised.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GrowState {
#[prost(bool, tag = "1")]
pub engine_present: bool,
/// idle | in_progress | done | partial | aborted | failed
#[prost(string, tag = "2")]
pub phase: ::prost::alloc::string::String,
#[prost(uint64, tag = "3")]
pub epoch: u64,
#[prost(uint64, tag = "4")]
pub target_sectors: u64,
#[prost(string, repeated, tag = "5")]
pub steps: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(uint32, repeated, tag = "6")]
pub partial_members: ::prost::alloc::vec::Vec<u32>,
#[prost(string, tag = "7")]
pub detail: ::prost::alloc::string::String,
#[prost(string, tag = "8")]
pub journal_path: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GrowStatusReply {
/// idle | draining | unmounted | waiting-members | growing | mounting | done | failed
/// `unmounted` is said only once /data is unmounted AND the array stopped.
#[prost(string, tag = "1")]
pub phase: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub why: ::prost::alloc::string::String,
#[prost(uint64, tag = "3")]
pub epoch: u64,
#[prost(uint64, tag = "4")]
pub target_sectors_per_member: u64,
#[prost(message, repeated, tag = "5")]
pub members: ::prost::alloc::vec::Vec<GrowMember>,
#[prost(string, tag = "6")]
pub members_verdict: ::prost::alloc::string::String,
#[prost(message, optional, tag = "7")]
pub journal: ::core::option::Option<GrowState>,
#[prost(bool, tag = "8")]
pub engine_present: bool,
#[prost(bool, tag = "9")]
pub hotplug: bool,
/// /data is mounted and the stores are open — true ONLY then. monetize orders
/// a recharge on a failed run that reads `serving: false`.
#[prost(bool, tag = "10")]
pub serving: bool,
#[prost(bool, tag = "11")]
pub identity_in_ram: bool,
#[prost(uint64, tag = "12")]
pub in_flight: u64,
#[prost(int64, tag = "13")]
pub since_unix_ms: i64,
#[prost(int64, tag = "14")]
pub server_unix_ms: i64,
#[prost(string, tag = "15")]
pub detail: ::prost::alloc::string::String,
#[prost(string, tag = "16")]
pub go_ahead_signer: ::prost::alloc::string::String,
#[prost(string, tag = "17")]
pub set_uuid: ::prost::alloc::string::String,
#[prost(uint64, tag = "18")]
pub total_bytes: u64,
/// This box is a twin (it grows like main; its drain proves no standby).
#[prost(bool, tag = "19")]
pub twin: bool,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GrowFlushRequest {
#[prost(uint32, tag = "1")]
pub timeout_secs: u32,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GrowFlushReply {
#[prost(bool, tag = "1")]
pub caught_up: bool,
#[prost(uint64, tag = "2")]
pub in_flight: u64,
#[prost(uint64, tag = "3")]
pub pending: u64,
#[prost(uint64, tag = "4")]
pub bus_gaps: u64,
#[prost(bool, tag = "5")]
pub needs_full_resync: bool,
#[prost(int64, tag = "6")]
pub last_success_unix_ms: i64,
#[prost(int64, tag = "7")]
pub flushed_at_unix_ms: i64,
#[prost(uint64, tag = "8")]
pub waited_ms: u64,
#[prost(uint64, tag = "9")]
pub catalog_repos: u64,
#[prost(uint64, tag = "10")]
pub standbys: u64,
#[prost(string, tag = "11")]
pub verdict: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TwinReportRequest {
/// Who the twin is (its principal on the primary's roster).
#[prost(string, tag = "1")]
pub principal: ::prost::alloc::string::String,
/// Where the twin serves (for the operator; the primary never dials it).
#[prost(string, tag = "2")]
pub address: ::prost::alloc::string::String,
/// The primary boot the position below belongs to; a position from another
/// boot says nothing about this one.
#[prost(uint64, tag = "3")]
pub applied_boot: u64,
/// The primary's head at the START of the twin's last complete follow cycle.
#[prost(uint64, tag = "4")]
pub applied_seq: u64,
/// The twin's own data volume, statvfs.
#[prost(uint64, tag = "5")]
pub disk_total_bytes: u64,
#[prost(uint64, tag = "6")]
pub disk_used_bytes: u64,
/// WHAT the twin holds, as it proved it at the end of its last WHOLE follow
/// cycle (2026-09-28, the estate's read of its twin — gunnar's pattern: a twin
/// publishes no door outside, its PRIMARY keeps what the twin says of itself,
/// and the front carries the primary's door): the root of the primary's estate
/// manifest the twin pulled and holds blake3-identical
/// (`estate_wire::manifest_root`), empty until one whole cycle;
#[prost(string, tag = "7")]
pub estate_root: ::prost::alloc::string::String,
/// how many files that manifest named;
#[prost(uint64, tag = "8")]
pub estate_files: u64,
/// the artifacts the twin wrote most recently, with the sha256 of the bytes it
/// wrote (a bounded ring, oldest first).
#[prost(message, repeated, tag = "9")]
pub held: ::prost::alloc::vec::Vec<HeldArtifact>,
}
/// One artifact a twin wrote into its own repository.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct HeldArtifact {
#[prost(string, tag = "1")]
pub repository: ::prost::alloc::string::String,
/// The mirror coordinate (`namespace/name@version`).
#[prost(string, tag = "2")]
pub coordinate: ::prost::alloc::string::String,
/// Lowercase hex sha256 of the bytes the twin wrote.
#[prost(string, tag = "3")]
pub sha256: ::prost::alloc::string::String,
#[prost(uint64, tag = "4")]
pub size: u64,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct TwinReportReply {
#[prost(uint64, tag = "1")]
pub boot: u64,
#[prost(uint64, tag = "2")]
pub head_seq: u64,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct TwinsRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TwinRow {
#[prost(string, tag = "1")]
pub principal: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub address: ::prost::alloc::string::String,
/// ok | behind | stalled | silent — stalled: still reporting, the applied
/// position unchanged with the head ahead for longer than TWIN_STALLED_AFTER_MS
#[prost(string, tag = "3")]
pub state: ::prost::alloc::string::String,
#[prost(int64, tag = "4")]
pub last_seen_unix_ms: i64,
#[prost(uint64, tag = "5")]
pub lag_entries: u64,
#[prost(uint64, tag = "6")]
pub disk_total_bytes: u64,
#[prost(uint64, tag = "7")]
pub disk_used_bytes: u64,
#[prost(uint32, tag = "8")]
pub fill_permille: u32,
/// The twin's applied position and this primary's head — `lag_entries` is
/// computed from them (applied 0: a position from another boot, or none).
#[prost(uint64, tag = "9")]
pub applied_seq: u64,
#[prost(uint64, tag = "10")]
pub head_seq: u64,
#[prost(uint64, tag = "11")]
pub seen_ago_ms: u64,
/// What the twin last said it holds (TwinReportRequest 7-9).
#[prost(string, tag = "12")]
pub estate_root: ::prost::alloc::string::String,
#[prost(uint64, tag = "13")]
pub estate_files: u64,
#[prost(message, repeated, tag = "14")]
pub held: ::prost::alloc::vec::Vec<HeldArtifact>,
/// Today's pulls (UTC day, since this process started) and the last one —
/// DownstreamRow 10/12's words: a twin reports once at the end of each whole
/// follow cycle, so each report is one pull. The last synced point is
/// applied_seq above, judged by the one follow_point rule.
#[prost(uint64, tag = "15")]
pub pulls_today: u64,
#[prost(int64, tag = "16")]
pub last_pull_unix: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TwinsReply {
#[prost(message, repeated, tag = "1")]
pub twins: ::prost::alloc::vec::Vec<TwinRow>,
}
/// One paired repository's sync point, as the downstream says it.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownstreamPoint {
/// The repository on THIS (the upstream) box — the pairing's name for it.
#[prost(string, tag = "1")]
pub repository: ::prost::alloc::string::String,
/// The upstream boot the position below belongs to (TwinReportRequest 3).
#[prost(uint64, tag = "2")]
pub applied_boot: u64,
/// The upstream's head at the START of the downstream's last complete cycle
/// of this repository (TwinReportRequest 4); 0 = none yet.
#[prost(uint64, tag = "3")]
pub applied_seq: u64,
/// When that cycle completed; 0 = never.
#[prost(int64, tag = "4")]
pub last_complete_unix_ms: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DownstreamReportRequest {
#[prost(message, repeated, tag = "1")]
pub points: ::prost::alloc::vec::Vec<DownstreamPoint>,
/// The downstream's declared cycle (`ron_every_secs`): the upstream reads
/// `silent` after 3 of them and `stalled` after 5 (the twin's rule). 0 = the
/// mirror default.
#[prost(uint32, tag = "2")]
pub every_secs: u32,
/// What the downstream is, from its own RON (HOL-FLOW-SMART): the upstream's flow
/// unfolds it to this. Absent from an older downstream. NOT in the text the report's
/// proof signs (that text is the same in every holger version, HOL-SYNC-SKEW): a sync
/// downstream proves it with `summary_proof`, a paired one by its certificate.
#[prost(message, optional, tag = "3")]
pub summary: ::core::option::Option<DownstreamSummary>,
/// The summary's own proof (HOL-SYNC-SKEW): base64 of the signed envelope over the
/// summary's text, which holds the report's text too, so it belongs to this report only.
/// An older upstream does not know this field and skips it, with the summary.
#[prost(string, tag = "4")]
pub summary_proof: ::prost::alloc::string::String,
/// The proof of the summary's `console_url` (HOL-FLOW-FRONT): base64 of the signed envelope
/// over its own text (the report's text and the address), so an upstream that checks the
/// summary as `summary_proof` signs it (holger 3.1.0) still opens it, and a newer upstream
/// keeps the address only when this proof holds.
#[prost(string, tag = "5")]
pub console_proof: ::prost::alloc::string::String,
}
/// ★ **A downstream's own RON, summarised** (HOL-FLOW-SMART): names, words and folders,
/// never a key, token or secret.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownstreamSummary {
/// `OneWay` or `Fetch`.
#[prost(string, tag = "1")]
pub boundary: ::prost::alloc::string::String,
/// Its repositories, by name.
#[prost(string, repeated, tag = "2")]
pub repositories: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Its one-way inbox folder; empty when it fetches.
#[prost(string, tag = "3")]
pub inbox: ::prost::alloc::string::String,
/// Who allows a vendor's first import (`admin`).
#[prost(string, tag = "4")]
pub first_import: ::prost::alloc::string::String,
/// Its security domain; empty when it declares none.
#[prost(string, tag = "5")]
pub domain: ::prost::alloc::string::String,
/// How many downstreams it declares itself (it is upstream of N).
#[prost(uint32, tag = "6")]
pub downstreams: u32,
/// Its console's address (an https URL: the site's www name), as its own front reported it
/// (HOL-FLOW-FRONT): the upstream's flow links the downstream's box to that server's own
/// flow. Empty when it knows none. Not in `summary_proof`'s text: `console_proof` proves it.
#[prost(string, tag = "7")]
pub console_url: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownstreamsRequest {}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownstreamRepoRow {
#[prost(string, tag = "1")]
pub repository: ::prost::alloc::string::String,
/// ok | behind | stalled | silent — TwinRow.state's words and rule.
#[prost(string, tag = "2")]
pub state: ::prost::alloc::string::String,
/// Writes this upstream admitted since the reported point (head − applied; the
/// whole head for a point from another boot). The upstream's sequence counts
/// every write, so this is an upper bound for one repository.
#[prost(uint64, tag = "3")]
pub lag_entries: u64,
#[prost(uint64, tag = "4")]
pub applied_seq: u64,
#[prost(uint64, tag = "5")]
pub head_seq: u64,
#[prost(int64, tag = "6")]
pub last_complete_unix_ms: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DownstreamRow {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// `sha256:<64 hex>` of the paired client certificate.
#[prost(string, tag = "2")]
pub fingerprint: ::prost::alloc::string::String,
/// The worst repository's state; `silent` when never heard.
#[prost(string, tag = "3")]
pub state: ::prost::alloc::string::String,
#[prost(bool, tag = "4")]
pub stalled: bool,
/// The largest repository lag.
#[prost(uint64, tag = "5")]
pub lag_entries: u64,
#[prost(int64, tag = "6")]
pub last_seen_unix_ms: i64,
#[prost(uint64, tag = "7")]
pub seen_ago_ms: u64,
#[prost(uint32, tag = "8")]
pub every_secs: u32,
#[prost(message, repeated, tag = "9")]
pub repositories: ::prost::alloc::vec::Vec<DownstreamRepoRow>,
/// Today's pulls (UTC day, since this process started) and the last one.
#[prost(uint64, tag = "10")]
pub requests_today: u64,
#[prost(uint64, tag = "11")]
pub bytes_today: u64,
#[prost(int64, tag = "12")]
pub last_pull_unix: i64,
/// **Packages this downstream has fetched, ever** (lane A13, 2026-10-23): one
/// per artifact delivered to its paired certificate, and their bytes. Kept in
/// its durable sync record (`holger-peers/sync-<name>.ron`), so a restart
/// keeps the count; pulls in the last minute before a crash may be lost.
#[prost(uint64, tag = "13")]
pub fetched_total: u64,
#[prost(uint64, tag = "14")]
pub bytes_total: u64,
/// Artifacts delivered to it today (UTC day, since this process started).
#[prost(uint64, tag = "15")]
pub fetched_today: u64,
/// What it said of its own RON in its last report (HOL-FLOW-SMART); absent when it
/// said nothing.
#[prost(message, optional, tag = "16")]
pub summary: ::core::option::Option<DownstreamSummary>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DownstreamsReply {
#[prost(message, repeated, tag = "1")]
pub downstreams: ::prost::alloc::vec::Vec<DownstreamRow>,
#[prost(uint64, tag = "2")]
pub boot: u64,
#[prost(uint64, tag = "3")]
pub head_seq: u64,
}
/// Generated client implementations.
pub mod grow_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct GrowServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl GrowServiceClient<tonic::transport::Channel> {
/// 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: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> GrowServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> GrowServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
GrowServiceClient::new(InterceptedService::new(inner, interceptor))
}
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
/// Drain, unmount, wait for the members. ADMIN (on a twin too: a twin grows
/// exactly like main). Answers the status AFTER the call, never when the
/// growth has finished.
pub async fn start(
&mut self,
request: impl tonic::IntoRequest<super::GrowStartRequest>,
) -> std::result::Result<
tonic::Response<super::GrowStatusReply>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/holger.grow.v1.GrowService/Start",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("holger.grow.v1.GrowService", "Start"));
self.inner.unary(req, path, codec).await
}
/// The phase, NO CREDENTIAL: the actor outside the box that owns the volumes
/// must read `waiting-members` / `failed` with nothing to sign with, while the
/// stores are closed — gunnar's Bootstrap.GrowStatus, one door here.
pub async fn status(
&mut self,
request: impl tonic::IntoRequest<super::GrowStatusRequest>,
) -> std::result::Result<
tonic::Response<super::GrowStatusReply>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/holger.grow.v1.GrowService/Status",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("holger.grow.v1.GrowService", "Status"));
self.inner.unary(req, path, codec).await
}
/// While `waiting-members`: look again now (`give_up`: serve what is there).
/// On a growth that is already `done` it answers the status. ADMIN.
pub async fn resume(
&mut self,
request: impl tonic::IntoRequest<super::GrowResumeRequest>,
) -> std::result::Result<
tonic::Response<super::GrowStatusReply>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/holger.grow.v1.GrowService/Resume",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("holger.grow.v1.GrowService", "Resume"));
self.inner.unary(req, path, codec).await
}
/// The watermark (T11): wait up to `timeout_secs` for every enrolled twin to
/// have applied this box's head. ADMIN.
pub async fn flush(
&mut self,
request: impl tonic::IntoRequest<super::GrowFlushRequest>,
) -> std::result::Result<tonic::Response<super::GrowFlushReply>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/holger.grow.v1.GrowService/Flush",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("holger.grow.v1.GrowService", "Flush"));
self.inner.unary(req, path, codec).await
}
/// A TWIN's word to its primary, each follow cycle: how far into the primary's
/// sequence it has applied, and how full its own disk is. The primary answers
/// its current position. ADMIN-READ (the twin's follow bearer).
pub async fn twin_report(
&mut self,
request: impl tonic::IntoRequest<super::TwinReportRequest>,
) -> std::result::Result<
tonic::Response<super::TwinReportReply>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/holger.grow.v1.GrowService/TwinReport",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("holger.grow.v1.GrowService", "TwinReport"));
self.inner.unary(req, path, codec).await
}
/// Every enrolled twin as this primary last heard from it — monetize's twin
/// sizing reads the fill. ADMIN-READ.
pub async fn twins(
&mut self,
request: impl tonic::IntoRequest<super::TwinsRequest>,
) -> std::result::Result<tonic::Response<super::TwinsReply>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/holger.grow.v1.GrowService/Twins",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("holger.grow.v1.GrowService", "Twins"));
self.inner.unary(req, path, codec).await
}
/// A paired DOWNSTREAM holger's word to this upstream after each completed
/// mirror cycle — the twin's TwinReport, per paired repository: how far into
/// this box's sequence it has applied. Authenticated by the paired mTLS
/// certificate ALONE (the pinned fingerprint of `holger-peers/downstream-*`);
/// an unpaired caller is refused by name (holger-peer-4), a repository the
/// pairing does not list by holger-peer-2. The answer is this box's position,
/// which the downstream's next cycle starts from.
pub async fn downstream_report(
&mut self,
request: impl tonic::IntoRequest<super::DownstreamReportRequest>,
) -> std::result::Result<
tonic::Response<super::TwinReportReply>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/holger.grow.v1.GrowService/DownstreamReport",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("holger.grow.v1.GrowService", "DownstreamReport"),
);
self.inner.unary(req, path, codec).await
}
/// Every paired downstream as this upstream last heard from it (kept under the
/// data root, so a restart keeps the last word). ADMIN-READ.
pub async fn downstreams(
&mut self,
request: impl tonic::IntoRequest<super::DownstreamsRequest>,
) -> std::result::Result<
tonic::Response<super::DownstreamsReply>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/holger.grow.v1.GrowService/Downstreams",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("holger.grow.v1.GrowService", "Downstreams"));
self.inner.unary(req, path, codec).await
}
}
}
/// Generated server implementations.
pub mod grow_service_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
/// Generated trait containing gRPC methods that should be implemented for use with GrowServiceServer.
#[async_trait]
pub trait GrowService: std::marker::Send + std::marker::Sync + 'static {
/// Drain, unmount, wait for the members. ADMIN (on a twin too: a twin grows
/// exactly like main). Answers the status AFTER the call, never when the
/// growth has finished.
async fn start(
&self,
request: tonic::Request<super::GrowStartRequest>,
) -> std::result::Result<tonic::Response<super::GrowStatusReply>, tonic::Status>;
/// The phase, NO CREDENTIAL: the actor outside the box that owns the volumes
/// must read `waiting-members` / `failed` with nothing to sign with, while the
/// stores are closed — gunnar's Bootstrap.GrowStatus, one door here.
async fn status(
&self,
request: tonic::Request<super::GrowStatusRequest>,
) -> std::result::Result<tonic::Response<super::GrowStatusReply>, tonic::Status>;
/// While `waiting-members`: look again now (`give_up`: serve what is there).
/// On a growth that is already `done` it answers the status. ADMIN.
async fn resume(
&self,
request: tonic::Request<super::GrowResumeRequest>,
) -> std::result::Result<tonic::Response<super::GrowStatusReply>, tonic::Status>;
/// The watermark (T11): wait up to `timeout_secs` for every enrolled twin to
/// have applied this box's head. ADMIN.
async fn flush(
&self,
request: tonic::Request<super::GrowFlushRequest>,
) -> std::result::Result<tonic::Response<super::GrowFlushReply>, tonic::Status>;
/// A TWIN's word to its primary, each follow cycle: how far into the primary's
/// sequence it has applied, and how full its own disk is. The primary answers
/// its current position. ADMIN-READ (the twin's follow bearer).
async fn twin_report(
&self,
request: tonic::Request<super::TwinReportRequest>,
) -> std::result::Result<tonic::Response<super::TwinReportReply>, tonic::Status>;
/// Every enrolled twin as this primary last heard from it — monetize's twin
/// sizing reads the fill. ADMIN-READ.
async fn twins(
&self,
request: tonic::Request<super::TwinsRequest>,
) -> std::result::Result<tonic::Response<super::TwinsReply>, tonic::Status>;
/// A paired DOWNSTREAM holger's word to this upstream after each completed
/// mirror cycle — the twin's TwinReport, per paired repository: how far into
/// this box's sequence it has applied. Authenticated by the paired mTLS
/// certificate ALONE (the pinned fingerprint of `holger-peers/downstream-*`);
/// an unpaired caller is refused by name (holger-peer-4), a repository the
/// pairing does not list by holger-peer-2. The answer is this box's position,
/// which the downstream's next cycle starts from.
async fn downstream_report(
&self,
request: tonic::Request<super::DownstreamReportRequest>,
) -> std::result::Result<tonic::Response<super::TwinReportReply>, tonic::Status>;
/// Every paired downstream as this upstream last heard from it (kept under the
/// data root, so a restart keeps the last word). ADMIN-READ.
async fn downstreams(
&self,
request: tonic::Request<super::DownstreamsRequest>,
) -> std::result::Result<
tonic::Response<super::DownstreamsReply>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct GrowServiceServer<T> {
inner: Arc<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
impl<T> GrowServiceServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
/// Enable decompressing requests with the given encoding.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
/// Compress responses with the given encoding, if the client supports it.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for GrowServiceServer<T>
where
T: GrowService,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::Body>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
match req.uri().path() {
"/holger.grow.v1.GrowService/Start" => {
#[allow(non_camel_case_types)]
struct StartSvc<T: GrowService>(pub Arc<T>);
impl<
T: GrowService,
> tonic::server::UnaryService<super::GrowStartRequest>
for StartSvc<T> {
type Response = super::GrowStatusReply;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GrowStartRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as GrowService>::start(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = StartSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/holger.grow.v1.GrowService/Status" => {
#[allow(non_camel_case_types)]
struct StatusSvc<T: GrowService>(pub Arc<T>);
impl<
T: GrowService,
> tonic::server::UnaryService<super::GrowStatusRequest>
for StatusSvc<T> {
type Response = super::GrowStatusReply;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GrowStatusRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as GrowService>::status(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = StatusSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/holger.grow.v1.GrowService/Resume" => {
#[allow(non_camel_case_types)]
struct ResumeSvc<T: GrowService>(pub Arc<T>);
impl<
T: GrowService,
> tonic::server::UnaryService<super::GrowResumeRequest>
for ResumeSvc<T> {
type Response = super::GrowStatusReply;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GrowResumeRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as GrowService>::resume(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ResumeSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/holger.grow.v1.GrowService/Flush" => {
#[allow(non_camel_case_types)]
struct FlushSvc<T: GrowService>(pub Arc<T>);
impl<
T: GrowService,
> tonic::server::UnaryService<super::GrowFlushRequest>
for FlushSvc<T> {
type Response = super::GrowFlushReply;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GrowFlushRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as GrowService>::flush(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = FlushSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/holger.grow.v1.GrowService/TwinReport" => {
#[allow(non_camel_case_types)]
struct TwinReportSvc<T: GrowService>(pub Arc<T>);
impl<
T: GrowService,
> tonic::server::UnaryService<super::TwinReportRequest>
for TwinReportSvc<T> {
type Response = super::TwinReportReply;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::TwinReportRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as GrowService>::twin_report(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = TwinReportSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/holger.grow.v1.GrowService/Twins" => {
#[allow(non_camel_case_types)]
struct TwinsSvc<T: GrowService>(pub Arc<T>);
impl<T: GrowService> tonic::server::UnaryService<super::TwinsRequest>
for TwinsSvc<T> {
type Response = super::TwinsReply;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::TwinsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as GrowService>::twins(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = TwinsSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/holger.grow.v1.GrowService/DownstreamReport" => {
#[allow(non_camel_case_types)]
struct DownstreamReportSvc<T: GrowService>(pub Arc<T>);
impl<
T: GrowService,
> tonic::server::UnaryService<super::DownstreamReportRequest>
for DownstreamReportSvc<T> {
type Response = super::TwinReportReply;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DownstreamReportRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as GrowService>::downstream_report(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = DownstreamReportSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/holger.grow.v1.GrowService/Downstreams" => {
#[allow(non_camel_case_types)]
struct DownstreamsSvc<T: GrowService>(pub Arc<T>);
impl<
T: GrowService,
> tonic::server::UnaryService<super::DownstreamsRequest>
for DownstreamsSvc<T> {
type Response = super::DownstreamsReply;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DownstreamsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as GrowService>::downstreams(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = DownstreamsSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
let mut response = http::Response::new(
tonic::body::Body::default(),
);
let headers = response.headers_mut();
headers
.insert(
tonic::Status::GRPC_STATUS,
(tonic::Code::Unimplemented as i32).into(),
);
headers
.insert(
http::header::CONTENT_TYPE,
tonic::metadata::GRPC_CONTENT_TYPE,
);
Ok(response)
})
}
}
}
}
impl<T> Clone for GrowServiceServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
/// Generated gRPC service name
pub const SERVICE_NAME: &str = "holger.grow.v1.GrowService";
impl<T> tonic::server::NamedService for GrowServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}