healthcheck

package
v0.0.0-...-014b5c3 Latest Latest
Warning

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

Go to latest
Published: May 6, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckFunc

type CheckFunc func(core.Target, config.HealthcheckConfig, chan<- CheckResult)

*

  • Health Check function
  • Returns channel in which only one check result will be delivered

type CheckResult

type CheckResult struct {

	/* Check target */
	Target core.Target

	/* Check live status */
	Live bool
}

*

  • Check result
  • Handles target and it's live status

type Healthcheck

type Healthcheck struct {

	/* Input channel to accept targets */
	In chan []core.Target

	/* Output channel to send check results for individual target */
	Out chan CheckResult
	// contains filtered or unexported fields
}

*

  • Healthcheck

func New

func New(strategy string, cfg config.HealthcheckConfig) *Healthcheck

*

  • Create new Discovery based on strategy

func (*Healthcheck) Start

func (this *Healthcheck) Start()

*

  • Start healthcheck

func (*Healthcheck) Stop

func (this *Healthcheck) Stop()

*

  • Stop healthcheck

func (*Healthcheck) UpdateWorkers

func (this *Healthcheck) UpdateWorkers(targets []core.Target)

*

  • Sync current workers to represent healtcheck on targets
  • Will remove not needed workers, and add needed

type Worker

type Worker struct {

	/* Last confirmed check result */
	LastResult CheckResult
	// contains filtered or unexported fields
}

*

  • Healthcheck Worker
  • Handles all periodic healthcheck logic
  • and yields results on change

func (*Worker) Start

func (this *Worker) Start()

*

  • Start worker

func (*Worker) Stop

func (this *Worker) Stop()

*

  • Stop worker

Jump to

Keyboard shortcuts

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