watchdog

package
v0.0.0-...-cdc42b6 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DisabledHeartbeat = math.MinInt64

Variables

This section is empty.

Functions

func Beat

func Beat(ctx context.Context)

func Call

func Call(ctx context.Context, frameName string, fn func(context.Context))

func DoneOf

func DoneOf(ctx context.Context) <-chan struct{}

func ForcedBeat

func ForcedBeat(ctx context.Context, forced bool)

func WithFactory

func WithFactory(ctx context.Context, name string, factory HeartbeatGeneratorFactory) context.Context

func WithFrame

func WithFrame(ctx context.Context, frameName string) context.Context

func WithoutFactory

func WithoutFactory(ctx context.Context) context.Context

Types

type Heartbeat

type Heartbeat struct {
	From             HeartbeatID
	PreviousUnixTime int64
	UpdateUnixTime   int64
}

func (Heartbeat) IsCancelled

func (h Heartbeat) IsCancelled() bool

func (Heartbeat) IsFirst

func (h Heartbeat) IsFirst() bool

type HeartbeatGenerator

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

func NewHeartbeatGenerator

func NewHeartbeatGenerator(id HeartbeatID, heartbeatPeriod time.Duration, out chan<- Heartbeat) HeartbeatGenerator

func NewHeartbeatGeneratorWithRetries

func NewHeartbeatGeneratorWithRetries(id HeartbeatID, heartbeatPeriod time.Duration, retryCount uint8, out chan<- Heartbeat) HeartbeatGenerator

func (*HeartbeatGenerator) Cancel

func (g *HeartbeatGenerator) Cancel()

func (*HeartbeatGenerator) Disable

func (g *HeartbeatGenerator) Disable()

func (*HeartbeatGenerator) ForcedHeartbeat

func (g *HeartbeatGenerator) ForcedHeartbeat(forced bool)

func (*HeartbeatGenerator) Heartbeat

func (g *HeartbeatGenerator) Heartbeat()

func (*HeartbeatGenerator) IsEnabled

func (g *HeartbeatGenerator) IsEnabled() bool

type HeartbeatGeneratorFactory

type HeartbeatGeneratorFactory interface {
	CreateGenerator(name string) *HeartbeatGenerator
}

type HeartbeatID

type HeartbeatID uint32

Jump to

Keyboard shortcuts

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