Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Switcher ¶
type Switcher struct { Registerer *registerer.Registerer // contains filtered or unexported fields }
Switcher implements the ledswitcher logic. It contains:
- a Leader that will determine the next LED to switch on, based on the registered endpoints
- a Registerer that will continuously attempt to register the endpoint with the Leader
- a Server that will listen for incoming requests, be it registration requests from other endpoints (if leading), or requests from the Leader to switch the LED on/off.
Each Switcher contains all three components. the Configuration's Leader field determines if the switcher is the Leader.
func New ¶
func New(cfg configuration.Configuration, logger *slog.Logger) (*Switcher, error)
New creates a new Switcher
func (*Switcher) Collect ¶
func (s *Switcher) Collect(ch chan<- prometheus.Metric)
Collect implements the prometheus.Collector interface
func (*Switcher) Describe ¶
func (s *Switcher) Describe(ch chan<- *prometheus.Desc)
Describe implements the prometheus.Collector interface
Click to show internal directories.
Click to hide internal directories.