Documentation
¶
Overview ¶
Package sections is discovery the product defines: a service offers a section — a proto message of the product's under a name — and any service follows that name across the installation, without a registry of its own.
sections.Offer(root, "komeet.module", &modulev1.Manifest{Name: "media", ...})
modules := sections.Follow[*modulev1.Manifest](root, "komeet.module")
for service, m := range modules.Get() { ... }
The section goes into the service's manifest. Backplane publishes, by name, the sections of every serving service (its highest serving version) to Consul KV backplane/sections/<name>; Follow watches that key while the service runs. Without Consul nothing is known.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Live ¶ added in v0.6.45
Live is a section the service offers whose value changes while it runs, e.g. with its live configuration. It is immutable and safe for concurrent use; the zero Live sets nothing.
func OfferLive ¶ added in v0.6.45
OfferLive declares the service's section name as T, with a value the service sets while it runs (Live.Set). The manifest, shared by every instance of a version, holds T's empty message; each instance publishes its value with its state, and followers see the value of the service's highest serving version, from one of its instances. Until an instance sets it, followers see the empty message.
type Ref ¶
Ref follows one section name: the section of every serving service that offers it. Its methods are safe for concurrent use.
func Follow ¶
Follow follows section name, decoded as T (a pointer to a generated message). A service that offers name with another message is left out.
func (Ref[T]) Changes ¶
Changes signals after every change of the set until ctx ends; one pending signal at most.