watchdog

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2025 License: MIT Imports: 9 Imported by: 0

README

flam-watchdog

flam-watchdog is a flam-in-go extension to provide process watchdog functionalities

Documentation

Index

Constants

View Source
const (
	LoggerCreatorGroup  = "flam.watchdog.loggers.creator"
	LoggerDriverDefault = "flam.watchdog.loggers.driver.default"
	ProcessGroup        = "flam.watchdog.process"

	PathDefaultLogger        = "flam.watchdog.defaults.logger"
	PathDefaultLogChannel    = "flam.watchdog.defaults.log.channel"
	PathDefaultLogStartLevel = "flam.watchdog.defaults.log.start.level"
	PathDefaultLogErrorLevel = "flam.watchdog.defaults.log.error.level"
	PathDefaultLogDoneLevel  = "flam.watchdog.defaults.log.done.level"
	PathRun                  = "flam.watchdog.run"
	PathLoggers              = "flam.watchdog.loggers"
	PathProcesses            = "flam.watchdog.processes"
)

Variables

View Source
var (
	DefaultLogger        = ""
	DefaultLogChannel    = "flam"
	DefaultLogStartLevel = log.Info
	DefaultLogErrorLevel = log.Error
	DefaultLogDoneLevel  = log.Info
)
View Source
var (
	ErrProcessNotFound     = errors.New("watchdog process not found")
	ErrProcessRunningError = errors.New("watchdog process running error")
)

Functions

func NewProvider

func NewProvider() flam.Provider

Types

type Facade

type Facade interface {
	HasLogger(id string) bool
	ListLoggers() []string
	GetLogger(id string) (Logger, error)
	AddLogger(id string, logger Logger) error

	HasProcess(id string) bool
	ListProcesses() []string
	GetProcess(id string) (Process, error)
	AddProcess(id string, active bool, logger string, process Process) error
}

type Logger

type Logger interface {
	LogStart(id string) error
	LogError(id string, e error) error
	LogDone(id string) error
}

type LoggerCreator

type LoggerCreator interface {
	Accept(config flam.Bag) bool
	Create(config flam.Bag) (Logger, error)
}

type Process

type Process interface {
	Id() string
	Run() error
	Terminate() error
}

Jump to

Keyboard shortcuts

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