Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HealthChecker ¶
type HealthChecker interface { // Start will start the health checker, and returns a notification channel. // if the checker thinks the slave is unhealthy, it will send the timestamp // via the channel. Start() <-chan time.Time // Pause will pause the slave health checker. Pause() // Continue will continue the slave health checker with a new slave upid. Continue(slaveUPID *upid.UPID) // Stop will stop the health checker. it should be called only once during // the life span of the checker. Stop() }
HealthChecker defines the interface of a health checker.
type MockedHealthChecker ¶
func NewMockedHealthChecker ¶
func NewMockedHealthChecker() *MockedHealthChecker
NewMockedHealthChecker returns a new mocked health checker.
func (*MockedHealthChecker) Continue ¶
func (m *MockedHealthChecker) Continue(slaveUPID *upid.UPID)
Continue will continue the slave health checker with a new slave upid.
func (*MockedHealthChecker) Pause ¶
func (m *MockedHealthChecker) Pause()
Pause will pause the slave health checker.
func (*MockedHealthChecker) Start ¶
func (m *MockedHealthChecker) Start() <-chan time.Time
Start will start the checker and returns the notification channel.
func (*MockedHealthChecker) TriggerUnhealthyEvent ¶
func (m *MockedHealthChecker) TriggerUnhealthyEvent()
type SlaveHealthChecker ¶
SlaveHealthChecker is for checking the slave's health.
func NewSlaveHealthChecker ¶
func NewSlaveHealthChecker(slaveUPID *upid.UPID, threshold int, checkDuration time.Duration, timeout time.Duration) *SlaveHealthChecker
NewSlaveHealthChecker creates a slave health checker and return a notification channel. Each time the checker thinks the slave is unhealthy, it will send a notification through the channel.
func (*SlaveHealthChecker) Continue ¶
func (s *SlaveHealthChecker) Continue(slaveUPID *upid.UPID)
Continue will continue the slave health checker with a new slave upid.
func (*SlaveHealthChecker) Pause ¶
func (s *SlaveHealthChecker) Pause()
Pause will pause the slave health checker.
func (*SlaveHealthChecker) Start ¶
func (s *SlaveHealthChecker) Start() <-chan time.Time
Start will start the health checker and returns the notification channel.
func (*SlaveHealthChecker) Stop ¶
func (s *SlaveHealthChecker) Stop()
Stop will stop the slave health checker. It should be called only once during the life span of the checker.