service_health

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2020 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerServiceHealthProvider

type DockerServiceHealthProvider struct {
	// contains filtered or unexported fields
}

DockerServiceHealthProvider provides service health for docker containers through docker's API.

func NewDockerServiceHealthProvider

func NewDockerServiceHealthProvider() (*DockerServiceHealthProvider, error)

NewDockerServiceHealthProvider creates a new DockerServiceHealthProvider with an initialized docker client.

func (*DockerServiceHealthProvider) GetUnhealthyServices

func (d *DockerServiceHealthProvider) GetUnhealthyServices() ([]string, error)

GetUnhealthyServices returns all docker services failing their health checks.

func (*DockerServiceHealthProvider) Restart

func (d *DockerServiceHealthProvider) Restart(service string) error

Restart restarts the service provided

func (*DockerServiceHealthProvider) Stop

func (d *DockerServiceHealthProvider) Stop(service string) error

Stop stops the service provided

type ServiceHealth

type ServiceHealth interface {
	// GetUnhealthyServices return a list of services found to be in an
	// unhealthy state.
	GetUnhealthyServices() ([]string, error)

	// Restart restarts the provided service.
	Restart(service string) error

	// Stop stops the provided service.
	Stop(service string) error
}

ServiceHealth defines an interface to fetch unhealthy services and enable functionality necessary for promotion/demotions of the gateway.

Jump to

Keyboard shortcuts

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