services

package
v0.0.0-...-1f08fcd Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2025 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Factories = map[string]Factory{
	"ping":     Ping,
	"tcp_dial": TCPDial,
}

Functions

This section is empty.

Types

type Check

type Check func() Status

func Ping

func Ping(msg json.RawMessage) (Check, error)

func TCPDial

func TCPDial(msg json.RawMessage) (Check, error)

type Factory

type Factory func(msg json.RawMessage) (Check, error)

type Service

type Service struct {
	Name     string
	Interval time.Duration
	Check    Check
	// contains filtered or unexported fields
}

func NewService

func NewService(msg json.RawMessage) (*Service, error)

func (*Service) Start

func (s *Service) Start(stop chan bool)

func (*Service) Status

func (s *Service) Status() (Status, time.Time)

type Status

type Status int
const (
	StatusUnknown Status = 0
	StatusUp      Status = 1
	StatusDown    Status = 2
)

Jump to

Keyboard shortcuts

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