Protocol Buffers definitions shared by the Proxelo control plane
(proxelo) and the proxy
(proxelo-proxy).
The two processes exchange nothing but the messages defined here. The control
plane compiles user configuration into a Snapshot and pushes it over the
DistributionService stream. The proxy loads it, swaps it in atomically and
acknowledges the revision.
| Path | Contents |
|---|---|
proto/proxelo/snapshot/v1 |
Snapshot: the resolved configuration a proxy serves |
proto/proxelo/distrib/v1 |
DistributionService: snapshot push, ACME challenges, acknowledgements, traffic counters |
proto/proxelo/sim/v1 |
Framing of the proxelo-proxy sim helper the control plane uses for dry-loads and request simulation |
proto/proxelo/expr/v1 |
Request: the variable route CEL expressions see, type-checked by the control plane and evaluated by the proxy |
gen/go |
Generated Go code (committed) |
rust |
Rust crate, generated at build time |
Snapshot. The control plane resolves everything a proxy would otherwise work out per request: references between resources, policy inheritance, defaults, and the order in which sites and routes are matched. Objects refer to each other by index into the snapshot's lists, never by name. A proxy validates a snapshot completely and builds its runtime form before it swaps it in, so a snapshot is accepted or rejected as a whole.
Distribution stream. The proxy dials the control plane over a Unix socket
and opens Sync:
- Proxy sends
Hellowith its node ID, version and the revision it serves. - Control plane sends the newest snapshot as
snapshot_data(serialized bytes, so the proxy can check the SHA-256 hash recorded in them and store exactly those bytes as its last-known-good snapshot), then a new one after every apply or rollback. - Proxy answers each snapshot with
Ack(applied, or rejected with a reason) and sendsStatsevery few seconds: counters since start, from which the control plane derives error rates while a revision awaits confirmation. - ACME challenges arrive as
Challenges, replacing the previous set. They are not part of a snapshot and are never persisted.
When the stream ends the proxy keeps serving and dials again with backoff.
Simulator. proxelo-proxy sim reads length-delimited SimRequest
messages on stdin and writes SimResponse messages on stdout. It runs the
serving engine without sockets, so validation and the request simulator in
the control plane give the same answers as a live proxy.
Go:
go get github.com/null-variable/proxelo-api@latestimport snapshotv1 "github.com/null-variable/proxelo-api/gen/go/proxelo/snapshot/v1"Rust (Cargo.toml):
[dependencies]
proxelo-api = { git = "https://github.com/null-variable/proxelo-api", tag = "v0.9.0" }use proxelo_api::snapshot::v1::Snapshot;Requires buf and a Rust toolchain.
buf lint
buf generate # regenerates gen/go
cd rust && cargo build- Releases follow semantic versioning. A
vX.Y.Ztag releases both the Go module and the Rust crate;rust/Cargo.tomlcarries the same version, and the release workflow checks it, runsbuf breakingagainst the previous tag and publishes a GitHub release. - Adding fields or messages is a minor release. Removing or renumbering fields is not allowed within a package; incompatible changes go into a new package version (
v2). - CI runs
buf breakingagainst the default branch on every pull request.
Licensed under the Apache License, Version 2.0. See NOTICE.