registerer

package
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Registerer

type Registerer struct {
	EndPointURL string
	// contains filtered or unexported fields
}

A Registerer attempts to register the instance with the leader on a regular basis

func New

func New(endpointURL string, interval time.Duration, logger *slog.Logger) *Registerer

func (*Registerer) Collect

func (r *Registerer) Collect(metrics chan<- prometheus.Metric)

Collect implements the prometheus.Collector interface

func (*Registerer) Describe

func (r *Registerer) Describe(descs chan<- *prometheus.Desc)

Describe implements the prometheus.Collector interface

func (*Registerer) IsRegistered

func (r *Registerer) IsRegistered() bool

IsRegistered returns true if the endpoint is successfully registered with a broker

func (*Registerer) Run

func (r *Registerer) Run(ctx context.Context) error

Run implements the main loop of a Registerer. It registers with the leader on a regular basis, informing the leading broker of an instance to take into account, as well as acting as a keep-alive for the leading broker.

func (*Registerer) SetLeaderURL

func (r *Registerer) SetLeaderURL(leaderURL string)

SetLeaderURL sets the URL of the leader

func (*Registerer) SetRegistered

func (r *Registerer) SetRegistered(registered bool)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL