daemon

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package daemon contains daemon types and functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All

func All(this *Instance) map[string]Info

All returns info on all running daemons

func LoadConfig

func LoadConfig[T any](path string) (*T, error)

LoadConfig loads a Daemon Config which is expected to follow the required structure. This checks if any Interval values are 0 (invalid).

func Run

func Run[A any](this *Instance, app *A, name string, task func(*A), interval int, timeScale time.Duration)

Run runs a task every given interval, where TimeScale = time.Hour, time.Minute, time.Second

Types

type Info

type Info struct {
	Start    string
	Last     string
	Duration string
}

type Instance

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

func NewInstance

func NewInstance() *Instance

NewInstance creates a new Daemon Instance

Jump to

Keyboard shortcuts

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