idle

package
v0.0.0-...-006602b Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Display

type Display interface {
	Enable(bool)
	Run(context.Context, *flapper.Display)
	Reset()
	Name() string
}

type QuakeMon

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

QuakeMon is an earthquake monitor. It uses the USGS earthquake feed, as implemented in the usgsquake package.

func NewQuakeMon

func NewQuakeMon(startDelay time.Duration) *QuakeMon

NewQuakeMon returns a quake idler which will display the most recent largest quake from the past day.

func (*QuakeMon) Enable

func (q *QuakeMon) Enable(enable bool)

Enable is used to enable or disable the idler.

func (*QuakeMon) Name

func (q *QuakeMon) Name() string

Name returns the name of the idler.

func (*QuakeMon) Reset

func (q *QuakeMon) Reset()

Reset is called when something else is sent to the splitflap display. It resets the startDelay.

func (*QuakeMon) Run

func (q *QuakeMon) Run(ctx context.Context, display *flapper.Display)

Run is called when this is the active idler. It does nothing until the startDelay expires, then it will set the splitflap to display the latest quake. This routine can be cancelled using the passed in context.

Jump to

Keyboard shortcuts

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