go-micro: github.com/micro/go-micro/monitor Index | Files

package monitor

import "github.com/micro/go-micro/monitor"

Package monitor monitors service health

Index

Package Files

default.go monitor.go options.go

Variables

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

type Monitor Uses

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 Uses

func NewMonitor(opts ...Option) Monitor

NewMonitor returns a new monitor

type Option Uses

type Option func(*Options)

func Client Uses

func Client(c client.Client) Option

func Registry Uses

func Registry(r registry.Registry) Option

type Options Uses

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

type Status Uses

type Status struct {
    Code  StatusCode
    Info  string
    Error string
}

type StatusCode Uses

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

Package monitor imports 8 packages (graph) and is imported by 4 packages. Updated 2020-02-06. Refresh now. Tools for package owners.