Documentation ¶
Index ¶
Constants ¶
const ( // DefaultHandlerCount is the default number of goroutines dedicated to // handling keepalive events. DefaultHandlerCount = 1000 // KeepaliveCheckName is the name of the check that is created when a // keepalive timeout occurs. KeepaliveCheckName = "keepalive" // KeepaliveHandlerName is the name of the handler that is executed when // a keepalive timeout occurs. KeepaliveHandlerName = "keepalive" // RegistrationCheckName is the name of the check that is created when an // entity sends a keepalive and the entity does not yet exist in the store. RegistrationCheckName = "registration" // RegistrationHandlerName is the name of the handler that is executed when // a registration event is passed to pipelined. RegistrationHandlerName = "registration" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Store store.Store EventStore store.EventStore Bus messaging.MessageBus LivenessFactory liveness.Factory DeregistrationHandler string RingPool *ringv2.Pool }
Config configures Keepalived.
type Deregisterer ¶
type Deregisterer interface { // Deregister an entity and return an error if there was any problem during the // deregistration process. Deregister(e *types.Entity) error }
A Deregisterer provides a mechanism for deregistering entities and notifying the rest of the backend when a deregistration occurs.
type Deregistration ¶
type Deregistration struct { EntityStore store.EntityStore EventStore store.EventStore MessageBus messaging.MessageBus }
Deregistration is an adapter for deregistering an entity from the store and publishing a deregistration event to WizardBus.
func (*Deregistration) Deregister ¶
func (d *Deregistration) Deregister(entity *types.Entity) error
Deregister an entity and all of its associated events.
type Keepalived ¶
type Keepalived struct {
// contains filtered or unexported fields
}
Keepalived is responsible for monitoring keepalive events and recording keepalives for entities.
func (*Keepalived) Err ¶
func (k *Keepalived) Err() <-chan error
Err returns a channel that the caller can use to listen for terminal errors indicating a premature shutdown of the Daemon.
func (*Keepalived) HandleError ¶
func (k *Keepalived) HandleError(err error)
HandleError logs an error
func (*Keepalived) Receiver ¶
func (k *Keepalived) Receiver() chan<- interface{}
Receiver returns the keepalive receiver channel.
func (*Keepalived) Start ¶
func (k *Keepalived) Start() error
Start starts the daemon, returning an error if preconditions for startup fail.
func (*Keepalived) Stop ¶
func (k *Keepalived) Stop() error
Stop stops the daemon, returning an error if one was encountered during shutdown.