monit

package
v2.52.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2017 License: Apache-2.0 Imports: 15 Imported by: 0

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