Expand description
v2 broker protocol module.
Houses the prost-generated types for the running_process.broker.v2
package — currently the ServiceDefinition envelope and the
HttpServerCapability optional sub-message introduced in #483.
v2 runs in parallel with v1 (super::protocol) through the broker
v2 rollout; v1’s types are FROZEN FOREVER (#228) so all new
capability fields land here instead.
Modules§
- backend_
handle - v2 backend-handle namespace (slice 23-B of zccache#782).
- client_
compat - v1-client compatibility surface under the v2 namespace (slice 25-A of zccache#782).
Structs§
- Backend
Http Ready - Notification frame sent from a daemon to its broker once the daemon’s
HTTP server has bound a port.
portisu16in Rust; proto’s narrowest integer isuint32so the wire type isuint32and the broker validates the range on receipt. - Cache
Manifest - v2 cache manifest envelope.
- Cache
Manifest Builder - Builder for
CacheManifest. Mirrors v1’ssuper::super::builders::CacheManifestBuilderAPI verbatim so the consumer-side migration is a literal s/v1::/v2::/ swap. - Cache
Root - One cache root the daemon exposes. v2 mirrors v1’s shape so the CacheManifestBuilder API is identical at the call site.
- GetBroker
Http Endpoint Request - CLI→broker request for the broker’s own HTTP endpoint. Empty marker — no fields are necessary; the broker fronts exactly one HTTP server.
- GetBroker
Http Endpoint Response - Broker→CLI response carrying the resolved HTTP endpoint.
portis the port the broker is currently bound on (after env-override / config resolution per #483 §3);pidis the broker’s process id, included so a mid-restart consumer can distinguish a stale answer from a live one without needing a separate liveness probe. - Http
Server Capability - Optional per-backend HTTP server capability.
- Service
Definition - v2 service definition envelope.
- Service
Definition Builder - Builder for
ServiceDefinition. - Service
Definition Loader - Loader rooted at one v2 service-definition directory.
- Service
Definition Scan Entry - Result of scanning one v2 service-definition entry.
Enums§
- Broker
Isolation - Broker isolation mode for a service.
- Cache
Root Kind - Logical role classification for cache roots. Wire values mirror v1’s
broker_v1.CacheRootKindEXACTLY (seebroker_v1_manifest.proto). Keeping the integer values aligned avoids subtle bugs when consumers mix the two generations (e.g. viaas i32casts in test fixtures or in code that bridges between v1 and v2). New kinds land in the reserved range; v1’s enum is FROZEN so anything past 9 is v2-only.
Constants§
- BROKER_
ENVELOPE_ VERSION_ V2 - Constant carried in every v2 manifest’s
CacheManifest::broker_envelope_versionfield. Pins the schema generation from the proto side independently of the file name. - CENTRAL_
MANIFEST_ EXTENSION_ V2 - v2 file extension used for entries in the central manifest registry.
Mirrors v1’s
pbextension with av2.pbdistinguisher. - ROOT_
MANIFEST_ FILE_ V2 - v2 file name written inside
<cache_root>/. Distinct from v1’s.running-process-manifest.pbso a v1 broker never decodes a v2 file by accident (and vice versa). - SERVICE_
DEF_ V2_ EXTENSION - v2 service-definition file extension. Distinct from v1’s
servicedefso a v1 broker never accidentally tries to decode a v2 file (and vice versa).
Functions§
- central_
manifest_ path_ v2 - Compute the v2 central-registry file path for one (service, version)
pair. Mirrors v1’s
central_manifest_pathwith the.v2.pbsuffix. - central_
registry_ dir_ v2 - Return the platform central-registry directory (same path as v1).
- service_
definition_ dir_ v2 - Return the v2 service-definition directory.
- service_
definition_ path_ v2 - Compute the v2 file path for one service definition.
- write_
service_ definition_ v2 - Validate and write one
.servicedef.v2file intoroot. - write_
to_ central_ in_ dir_ v2 - Testable variant of
write_to_central_v2with an explicit registry directory (tests, custom layouts). - write_
to_ central_ v2 - Write
<central_registry>/{service}-{version}.v2.pbatomically. - write_
to_ root_ v2 - Write
<cache_root>/.running-process-manifest.v2.pbatomically.