check

package
v0.0.0-...-6f5a26a Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(name string, fn CheckFunc)

Types

type Check

type Check interface {
	Exec() result.Result
}

type CheckFunc

type CheckFunc func(Database, func(interface{}) error) (Check, error)

func Get

func Get(name string) (CheckFunc, error)

type Database

type Database interface {
	GetEvents() ([]result.Event, error)
	GetEventsByNode(name string) ([]result.Event, error)
}

type Registry

type Registry map[string]CheckFunc

func (Registry) Get

func (r Registry) Get(name string) (CheckFunc, error)

func (Registry) Register

func (r Registry) Register(name string, fn CheckFunc)

type Runner

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

func NewRunner

func NewRunner(node node.Info, id, description string, interval time.Duration, check Check) Runner

func (Runner) Run

func (r Runner) Run(ctx context.Context, wg *sync.WaitGroup, events chan<- result.Event) error

Jump to

Keyboard shortcuts

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