Documentation
¶
Overview ¶
Command candaws is the CandaWS fleet: five parody cloud services, five engines, five generated widgets, and one binary.
Monolithic microservices, taken literally ¶
A continuous-delivery pipeline, a message queue, an object store, a function-as-a-service runtime and a metrics service. In a real cloud those are five products, five control planes and five bills. Here they are five packages in one process, and what separates any two of them is what separates two goroutines: nothing but the scheduler. There is no per-service port, no per-widget connection, and no inter-service call that is not a channel send.
Running it ¶
go run ./examples/widget/candaws # http://127.0.0.1:8081 go run ./examples/widget/candaws -addr :9000 go run ./examples/widget/candaws -seed 7 # a different fleet, reproducibly go run ./examples/widget/candaws -pace 0.25 # everything four times faster go run ./examples/widget/candaws -trouble 0 # nothing fails anywhere go run ./examples/widget/candaws -goroutines 5s # report the scheduler's own census
-pace multiplies every interval in the fleet and -trouble sets every probability, so the two flags between them cover the pacing knobs each engine exposes without asking anybody to remember five names for one idea. The per-service knobs are still there, in each package's Config.
Both flags answer for themselves at their edges. -pace is accepted in [0.001, 1000] and refused by name outside it, rather than passed on to become an engine reporting an interval it never chose. -trouble reads a negative value as zero — the fleet where nothing goes wrong — and the banner prints the value the fleet is actually running at.
What is generated and what is not ¶
Nothing on the page was hand-written. The five widget documents in docs/ are turned into examples/widget/candaws/<service>/{view.templ,widget.gen.go} by pkg/widget/gen.sh — the state, the reducers, the bindings, the labels, the SVG scenes, the motion and every word on every card. This file registers them, resolves the six sources their declared streams name against the five engines, hands the registry the four security decisions a library may not make for a host, and serves the result.
Yakshave declares two streams, which is why there are six sources and not five: one for its runs and one for its minutes, because the two tickers behind them are two.
Two commands the host acts on ¶
Queuecumber's redrive button and Coldstart's prewarm button emit events that change no widget state at all. The registry routes them to their widgets, whose reducers do nothing with them; this host wraps the registry's reducer and schedules an effect of its own, which is where a redrive and a prewarm actually happen. That is the same seam a stream's source name is: the document declares that the event exists, and the host decides what it means.
Security posture ¶
live.Anonymous, live.AllowAll[live.AnonymousIdentity] and live.NoCSRFCheck, each because a single-page demo has no accounts to check against. Origins is a real allowlist derived from the listen address rather than live.AnyOrigin.
templ: version: v0.3.1020
Directories
¶
| Path | Synopsis |
|---|---|
|
Package blobfish is the generated Blobfish widget.
|
Package blobfish is the generated Blobfish widget. |
|
Package coldstart is the generated Coldstart widget.
|
Package coldstart is the generated Coldstart widget. |
|
Package dashbored is the generated Dashbored widget.
|
Package dashbored is the generated Dashbored widget. |
|
Package fleet is the part of every CandaWS engine that is the same part.
|
Package fleet is the part of every CandaWS engine that is the same part. |
|
Package queuecumber is the generated Queuecumber widget.
|
Package queuecumber is the generated Queuecumber widget. |
|
Package yakshave is the generated Yakshave widget.
|
Package yakshave is the generated Yakshave widget. |