cronitor

package
v1.0.82 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Monitor

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

Monitor represents a Cronitor job monitor.

A Monitor with an empty URL behaves as a "no-op Monitor" and does not make HTTP requests.

func New

func New(url string) *Monitor

New creates a new Monitor with the given Cronitor telemetry URL. Panics if "net/url".Parse fails.

Passing the empty string will create a "no-op Monitor" that does not make any HTTP requests.

func (*Monitor) Monitor added in v1.0.72

func (c *Monitor) Monitor(f func() error) error

Monitor invokes f and communicates its state to Cronitor.

Monitor propagates errors related to setting the state, but in case f fails and setting the state fails, the state error is lost.

Jump to

Keyboard shortcuts

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