handler_ctrl

package
v2.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: Apache-2.0 Imports: 52 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectHandler

type ConnectHandler struct {
	// contains filtered or unexported fields
}

func NewConnectHandler

func NewConnectHandler(identity identity.Identity, network *network.Network, signingCertRoots []*x509.Certificate) *ConnectHandler

NewConnectHandler returns a ConnectHandler that admits routers whose leaf certificate chains either to the controller's own CA bundle or to signingCertRoots, the edge enrollment signing CA bundle. signingCertRoots may be empty, in which case only the controller's bundle is trusted.

func (*ConnectHandler) HandleConnection

func (self *ConnectHandler) HandleConnection(hello *channel.Hello, certificates []*x509.Certificate) error

func (*ConnectHandler) SetSeparatelyValidatedChannelTypes added in v2.0.2

func (self *ConnectHandler) SetSeparatelyValidatedChannelTypes(types map[string]struct{})

SetSeparatelyValidatedChannelTypes records the control-channel type headers that are dispatched to a separate, self-validating acceptor (e.g. the raft mesh). Connections carrying one of these types are skipped by HandleConnection; everything else - router control channel types, unrecognized types, and legacy (no type header) connections, all of which the dispatcher routes to the router control acceptor - is validated here. This must be populated before the listener begins accepting.

type CtrlAccepter

type CtrlAccepter struct {
	// contains filtered or unexported fields
}

func NewCtrlAccepter

func NewCtrlAccepter(network *network.Network,
	xctrls []xctrl.Xctrl,
	options *channel.Options,
	heartbeatOptions *channel.HeartbeatOptions,
	traceHandler *channel.TraceHandler) *CtrlAccepter

func (*CtrlAccepter) AcceptUnderlay

func (self *CtrlAccepter) AcceptUnderlay(underlay channel.Underlay) error

AcceptUnderlay handles incoming ungrouped connections from routers that don't support multi-underlay control channels (backward compatibility).

func (*CtrlAccepter) Bind

func (self *CtrlAccepter) Bind(binding channel.Binding) error

func (*CtrlAccepter) HandleGroupedUnderlay

func (self *CtrlAccepter) HandleGroupedUnderlay(underlay channel.Underlay, closeCallback func()) (channel.MultiChannel, error)

HandleGroupedUnderlay handles incoming grouped connections from routers that support multi-underlay control channels. It creates a MultiChannel with ListenerCtrlChannel.

func (*CtrlAccepter) NewMultiListener

func (self *CtrlAccepter) NewMultiListener() channel.UnderlayAcceptor

NewMultiListener returns an acceptor that handles both grouped (multi-underlay) and ungrouped (single underlay) connections from routers.

type CtrlDialer

type CtrlDialer struct {
	// contains filtered or unexported fields
}

CtrlDialer manages outbound ctrl channel connections to routers that advertise ctrl channel listener addresses. It runs a single-threaded event loop that tracks per-router dial state and dispatches dial attempts to a worker pool with exponential backoff on failure.

func NewCtrlDialer

func NewCtrlDialer(
	config *config.CtrlDialerConfig,
	network *network.Network,
	ctrlAccepter *CtrlAccepter,
	ctrlId *identity.TokenId,
	headers map[int32][]byte,
	closeNotify <-chan struct{},
	metricsRegistry metrics.Registry,
) *CtrlDialer

NewCtrlDialer creates a new CtrlDialer. Call Run to start the event loop.

func (*CtrlDialer) Inspect

func (self *CtrlDialer) Inspect(name string) (bool, *string, error)

Inspect handles inspection requests for the ctrl dialer, returning current dial state as JSON.

func (*CtrlDialer) RouterConnected

func (self *CtrlDialer) RouterConnected(r *model.Router)

RouterConnected notifies the dialer that a router has connected (e.g. via inbound accept).

func (*CtrlDialer) RouterCreated

func (self *CtrlDialer) RouterCreated(id string)

RouterCreated notifies the dialer that a new router has been created.

func (*CtrlDialer) RouterDeleted

func (self *CtrlDialer) RouterDeleted(id string)

RouterDeleted notifies the dialer that a router has been deleted.

func (*CtrlDialer) RouterDisconnected

func (self *CtrlDialer) RouterDisconnected(r *model.Router)

RouterDisconnected notifies the dialer that a router's ctrl channel has been lost.

func (*CtrlDialer) RouterUpdated

func (self *CtrlDialer) RouterUpdated(id string)

RouterUpdated notifies the dialer that a router's configuration has changed.

func (*CtrlDialer) Run

func (self *CtrlDialer) Run()

Run starts the dialer event loop. It blocks until closeNotify is closed.

func (*CtrlDialer) Validate

func (self *CtrlDialer) Validate() ([]*mgmt_pb.ControllerDialerDetails, error)

Validate cross-references dial states against the router store and returns per-router diagnostic details.

Jump to

Keyboard shortcuts

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