health

package
v0.0.0-...-fecfafd Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database interface {
	ListContainers() ([]database.ContainerInfo, error)
}

type DockerClient

type DockerClient interface {
	HealthCheck(ctx context.Context, containerID string) (types.ContainerState, error)
	StartContainer(ctx context.Context, containerID string) error
	RestartContainer(ctx context.Context, containerID string, timeout *int) error
}

TODO add a count to stop trying to restart a container

type HealthChecker

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

func NewHealthChecker

func NewHealthChecker(dockerClient DockerClient, db Database, interval time.Duration, logger Logger) *HealthChecker

func (*HealthChecker) Start

func (hc *HealthChecker) Start(ctx context.Context)

type Logger

type Logger interface {
	Info(format string, args ...interface{})
	Warn(format string, args ...interface{})
	Error(format string, args ...interface{})
}

Jump to

Keyboard shortcuts

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