healthchecks

package
v0.0.0-...-213e13b Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2016 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 FakeHealthCheckGetter

type FakeHealthCheckGetter struct {
	DefaultHealthCheck *compute.HttpHealthCheck
}

FakeHealthCheckGetter implements the healthCheckGetter interface for tests.

func (*FakeHealthCheckGetter) HealthCheck

func (h *FakeHealthCheckGetter) HealthCheck(port int64) (*compute.HttpHealthCheck, error)

HealthCheck returns the health check for the given port. If a health check isn't stored under the DefaultHealthCheck member, it constructs one.

type FakeHealthChecks

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

FakeHealthChecks fakes out health checks.

func NewFakeHealthChecks

func NewFakeHealthChecks() *FakeHealthChecks

NewFakeHealthChecks returns a new FakeHealthChecks.

func (*FakeHealthChecks) CreateHttpHealthCheck

func (f *FakeHealthChecks) CreateHttpHealthCheck(hc *compute.HttpHealthCheck) error

CreateHttpHealthCheck fakes out http health check creation.

func (*FakeHealthChecks) DeleteHttpHealthCheck

func (f *FakeHealthChecks) DeleteHttpHealthCheck(name string) error

DeleteHttpHealthCheck fakes out deleting a http health check.

func (*FakeHealthChecks) GetHttpHealthCheck

func (f *FakeHealthChecks) GetHttpHealthCheck(name string) (*compute.HttpHealthCheck, error)

GetHttpHealthCheck fakes out getting a http health check from the cloud.

func (*FakeHealthChecks) UpdateHttpHealthCheck

func (f *FakeHealthChecks) UpdateHttpHealthCheck(hc *compute.HttpHealthCheck) error

UpdateHttpHealthCheck sends the given health check as an update.

type HealthChecker

type HealthChecker interface {
	Init(h healthCheckGetter)

	Add(port int64) error
	Delete(port int64) error
	Get(port int64) (*compute.HttpHealthCheck, error)
}

HealthChecker is an interface to manage cloud HTTPHealthChecks.

func NewHealthChecker

func NewHealthChecker(cloud SingleHealthCheck, defaultHealthCheckPath string, namer *utils.Namer) HealthChecker

NewHealthChecker creates a new health checker. cloud: the cloud object implementing SingleHealthCheck. defaultHealthCheckPath: is the HTTP path to use for health checks.

type HealthChecks

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

HealthChecks manages health checks.

func (*HealthChecks) Add

func (h *HealthChecks) Add(port int64) error

Add adds a healthcheck if one for the same port doesn't already exist.

func (*HealthChecks) Delete

func (h *HealthChecks) Delete(port int64) error

Delete deletes the health check by port.

func (*HealthChecks) Get

func (h *HealthChecks) Get(port int64) (*compute.HttpHealthCheck, error)

Get returns the given health check.

func (*HealthChecks) Init

func (h *HealthChecks) Init(r healthCheckGetter)

Init initializes the health checker.

type SingleHealthCheck

type SingleHealthCheck interface {
	CreateHttpHealthCheck(hc *compute.HttpHealthCheck) error
	UpdateHttpHealthCheck(hc *compute.HttpHealthCheck) error
	DeleteHttpHealthCheck(name string) error
	GetHttpHealthCheck(name string) (*compute.HttpHealthCheck, error)
}

SingleHealthCheck is an interface to manage a single GCE health check.

Jump to

Keyboard shortcuts

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