controller

package
v0.7.28 Latest Latest
Warning

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

Go to latest
Published: May 21, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

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

func (*LeadershipActivator) Stop

func (a *LeadershipActivator) Stop()

Stop stops 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

type RegexpDeviceResolver struct {
	Regexp regexp.Regexp
}

RegexpDeviceResolver is a DeviceResolver that reads a device ID from a regexp

func (*RegexpDeviceResolver) Resolve

Resolve resolves a device ID from the configured regexp

Directories

Path Synopsis
change
snapshot

Jump to

Keyboard shortcuts

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