monitor

package
v1.18.2 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: Apache-2.0 Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package monitor monitors service health

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotWatching = errors.New("not watching")
)

Functions

This section is empty.

Types

type Monitor

type Monitor interface {
	// Reap a service and stop monitoring
	Reap(service string) error
	// Check the status of the service now
	Check(service string) error
	// Status of the service
	Status(service string) (Status, error)
	// Watch starts watching the service
	Watch(service string) error
	// Run the monitor to watch all services
	Run() error
	// Stop monitoring
	Stop() error
}

Monitor monitors a service and reaps dead instances

func NewMonitor

func NewMonitor(opts ...Option) Monitor

NewMonitor returns a new monitor

type Option

type Option func(*Options)

func Client

func Client(c client.Client) Option

func Registry

func Registry(r registry.Registry) Option

type Options

type Options struct {
	Client   client.Client
	Registry registry.Registry
}

type Status

type Status struct {
	Code  StatusCode
	Info  string
	Error string
}

type StatusCode

type StatusCode int
const (
	StatusUnknown StatusCode = iota
	StatusRunning
	StatusFailed
)

Jump to

Keyboard shortcuts

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