Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeviceResolver ¶
type DeviceResolver interface { // Resolve resolves a device Resolve(id libcontroller.ID) (topodevice.ID, error) }
DeviceResolver resolves a device from a type ID
type LeadershipActivator ¶
type LeadershipActivator struct { Store leadershipstore.Store // contains filtered or unexported fields }
LeadershipActivator is an Activator for activating a controller on leadership The LeadershipActivator listens for leadership changes in the leadership store. When the local node becomes the leader, the controller is activated. If the local node loses leadership, the controller is deactivated. This can ensure only a single controller processes requests in a cluster.
func (*LeadershipActivator) Start ¶
func (a *LeadershipActivator) Start(ch chan<- bool) error
Start starts the activator
type MastershipFilter ¶
type MastershipFilter struct { Store mastershipstore.Store Resolver DeviceResolver // contains filtered or unexported fields }
MastershipFilter activates a controller on acquiring mastership The MastershipFilter requires a DeviceResolver to extract a device ID from each request. Given a device ID, the MastershipFilter rejects any requests for which the local node is not the master for the device.
func (*MastershipFilter) Accept ¶
func (f *MastershipFilter) Accept(id libcontroller.ID) bool
Accept accepts the given ID if the local node is the master
type RegexpDeviceResolver ¶
RegexpDeviceResolver is a DeviceResolver that reads a device ID from a regexp
func (*RegexpDeviceResolver) Resolve ¶
func (r *RegexpDeviceResolver) Resolve(id libcontroller.ID) (topodevice.ID, error)
Resolve resolves a device ID from the configured regexp