Help us shape the future of Go! Take the 2026 Go Developer Survey

heartbeats

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2015 License: MIT Imports: 2 Imported by: 0

README

Sentinel Heartbeats

  • Cron

  • Serf events

Documentation

Index

Constants

View Source
const DEFAULT_INTERVAL string = "@every 1h"

Variables

View Source
var Plugins = map[string]Creator{}

Functions

func Add

func Add(name string, creator Creator)

Types

type Clock

type Clock struct {
	Interval string
	// contains filtered or unexported fields
}

func (Clock) Schedule

func (c Clock) Schedule(name string, job_ Job)

func (Clock) Stop

func (c Clock) Stop()

type Creator

type Creator func(map[string]string) (Plugin, error)

NOTE map[string]interface{} for better type support after casting ?

type Job

type Job interface {
	//Run() error
	Run()
}

type Plugin

type Plugin interface {
	Schedule(string, Job)
	Stop()
}

Plugin is the interface to implement report triggers. Those run in their own gorountines, registering sensor plugins and waiting for signals to execute them.

Jump to

Keyboard shortcuts

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