Documentation
¶
Overview ¶
Package registry is a freeze-after-boot name registry: Register during initialization, Freeze exactly once when wiring is complete, Lookup forever after. Post-freeze registration panics — mis-ordered boot wiring is a programming error, not a runtime condition — and freezing makes the read path safe for concurrent lock-free use.
Authored in G++ and distributed as generated Go — consumers never need the gpp toolchain.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Registry ¶
type Registry[T any] struct { // contains filtered or unexported fields }
Registry maps names to values of T. The zero value is usable.
func (*Registry[T]) Freeze ¶
func (r *Registry[T]) Freeze()
Freeze seals the registry. Idempotent. After Freeze, Lookup reads the map without locking (no writer can exist).
func (*Registry[T]) Lookup ¶
Lookup returns the value registered under name; ok=false when absent. Lock-free once frozen; before Freeze it takes the mutex (boot-time reads are rare and must not race Register).