heartbeat

package
v0.68.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package heartbeat provides functionality for managing heartbeats in external monitoring systems. Supported systems include Cronitor.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrMonitorNotFound is returned when a monitor does not exist in Cronitor.
	ErrMonitorNotFound = errors.New("monitor not found")
)

Functions

This section is empty.

Types

type CronitorHeartbeatRepository

type CronitorHeartbeatRepository struct {
	// contains filtered or unexported fields
}

CronitorHeartbeatRepository is a repository for managing heartbeats in Cronitor.

func (*CronitorHeartbeatRepository) CreateOrUpdate

func (r *CronitorHeartbeatRepository) CreateOrUpdate(ctx context.Context) error

func (*CronitorHeartbeatRepository) Delete

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPClient is an interface for making HTTP requests, allowing for easier testing.

type HeartbeatRepository

type HeartbeatRepository interface {
	// CreateOrUpdate creates or updates the heartbeat for the management cluster.
	CreateOrUpdate(ctx context.Context) error

	// Delete deletes the heartbeat for the management cluster.
	Delete(ctx context.Context) error
}

HeartbeatRepository is the interface for the heartbeat repository. It provides methods to create or update and delete a heartbeat. The heartbeat is used by the monitoring system to detect if the management cluster is alive. The current implementation relies on Cronitor.io but other implementations can be added in the future.

func NewCronitorHeartbeatRepository

func NewCronitorHeartbeatRepository(cfg config.Config, httpClient HTTPClient) HeartbeatRepository

NewCronitorHeartbeatRepository creates a new CronitorHeartbeatRepository.

Jump to

Keyboard shortcuts

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