monitor

package
Version: v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2019 License: Apache-2.0 Imports: 8 Imported by: 6

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
t or T : Toggle theme light dark auto
y or Y : Canonical URL