heartbeat

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package heartbeat implements a remove heartbeat pulse.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Heartbeat

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

Heartbeat can be used to send a request to a URL at a regular interval.

func New

func New(cfg cfgmodel.HeartbeatConfig, logger *slog.Logger) *Heartbeat

New creates a new heartbeat with the given configuration and logger.

func (*Heartbeat) Start

func (h *Heartbeat) Start(ctx context.Context)

Start the heartbeat. It will send a request to the configured URL every interval. This function will block until the context is cancelled.

Jump to

Keyboard shortcuts

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