core

package module
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: MIT Imports: 8 Imported by: 8

README

Go Reference GitHub go.mod Go version GitHub release (latest by date) Go Report Card Actions Status

HomeDashboard Core Comonents

This repository/packge contains central components and interfaces for theHomeDashboad project.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataSource added in v1.0.1

type DataSource string
const (
	DATASOURCE_BILLINGREPORT DataSource = "billingreport"
	DATASOURCE_WEATHER       DataSource = "weather"
	DATASOURCE_INDOORCLIMATE DataSource = "indoorclimate"
	DATASOURCE_EXCHANGERATE  DataSource = "exchangerate"
	DATASOURCE_STRAVA        DataSource = "strava"
)

type Minion

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

Minion is a worker which observes execution of a child and OS signals for graceful shutdowns.

func NewMinion

func NewMinion(child Runable) *Minion

NewMinion returns a new runable minion with given child.

func (*Minion) Run

func (minion *Minion) Run(ctx context.Context) error

Run calls run on currentchild and observe os signals and manual stop.

func (*Minion) Stop

func (minion *Minion) Stop()

Stop can be called to manual stop execution of a minion.

type Runable

type Runable interface {

	// Run is used as an entry point to execute desired busines logic.
	// Should confirm wait group on exit.
	Run(context.Context, *sync.WaitGroup) error
}

Interface used for executables. Should listen to context cancel if graceful shutdown is desired.

Jump to

Keyboard shortcuts

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