services

package
v0.0.0-...-609bd80 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanUp

func CleanUp()

CleanUp deletes all worker statuses that have not been updated in the last 24 hours.

func DeactivateHosts

func DeactivateHosts(hosts []string, until time.Time) error

func OnStop

func OnStop(name string)

OnStop reports that a worker has stopped. It should be called in a defer statement for every worker.

func PeriodicWorker

func PeriodicWorker(ctx context.Context, name string, work func() error, interval time.Duration)

PeriodicWorker is a wrapper for a worker main function and calls it as often as the interval. It will never call a main function more than once at a time, so it might be slower than the interval if the main function takes longer than the interval to run. It is meant to run asynchronously.

func ReportUp

func ReportUp(name string)

ReportUp reports that a worker is up.

func Worker

func Worker(ctx context.Context, name string, work func(context.Context) error)

Worker is a wrapper for a worker main function and reports the workers status every second. It is meant to run asynchronously.

Types

This section is empty.

Jump to

Keyboard shortcuts

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