monit

package
v2.930.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 15 Imported by: 1 module, 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

Index

Constants

View Source
const (
	StatusUnknown  = "unknown"
	StatusStarting = "starting"
	StatusRunning  = "running"
	StatusFailing  = "failing"
)

Variables

This section is empty.

Functions

func NewMonitRetryClient

func NewMonitRetryClient(
	delegate HTTPClient,
	maxUnavailableAttempts uint,
	maxOtherAttempts uint,
	retryDelay time.Duration,
	logger boshlog.Logger,
) httpclient.Client

func NewMonitRetryStrategy

func NewMonitRetryStrategy(
	retryable RequestRetryable,
	maxUnavailableAttempts uint,
	maxOtherAttempts uint,
	delay time.Duration,
	timeService clock.Clock,
) boshretry.RetryStrategy

Types

type Client

type Client interface {
	ServicesInGroup(name string) (services []string, err error)
	StartService(name string) (err error)
	StopService(name string) (err error)
	UnmonitorService(name string) (err error)
	Status() (status Status, err error)
}

func NewHTTPClient

func NewHTTPClient(
	host, username, password string,
	shortClient HTTPClient,
	longClient HTTPClient,
	logger boshlog.Logger,
) Client

NewHTTPClient creates a new monit client

status & start use the shortClient unmonitor & stop use the longClient

type ClientProvider

type ClientProvider interface {
	Get() (Client, error)
}

func NewProvider

func NewProvider(platform boshplatform.Platform, logger boshlog.Logger) ClientProvider

type HTTPClient

type HTTPClient interface {
	Do(request *http.Request) (*http.Response, error)
}

type RequestRetryable

type RequestRetryable interface {
	Attempt() (bool, error)
	Response() *http.Response
}

type Service

type Service struct {
	Name                 string
	Monitored            bool
	Errored              bool
	Pending              bool
	Status               string
	StatusMessage        string
	Uptime               int
	MemoryPercentTotal   float64
	MemoryKilobytesTotal int
	CPUPercentTotal      float64
}

type Status

type Status interface {
	GetIncarnation() (int, error)
	ServicesInGroup(name string) (services []Service)
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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