event

package
v0.13.6 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const AnyNetworkPlugin = ""

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler interface {
	// Init is called once on startup to let the handler initialize any state it needs.
	Init() error

	// GetName returns the name of the event handler
	GetName() string

	// GetNetworkPlugin returns the kubernetes network plugin that this handler supports.
	GetNetworkPlugins() []string

	// Stop is called once during shutdown to let the handler perform any cleanup. The uninstall flag indicates
	// whether or not Submariner is being completely uninstalled from the system.
	Stop(uninstall bool) error

	// TransitionToNonGateway is called once for each transition of the local node from Gateway to a non-Gateway.
	TransitionToNonGateway() error

	// TransitionToGateway is called once for each transition of the local node from non-Gateway to a Gateway.
	TransitionToGateway() error

	// LocalEndpointCreated is called when an endpoint for the local cluster is created.
	LocalEndpointCreated(endpoint *submV1.Endpoint) error

	// LocalEndpointUpdated is called when an endpoint for the local cluster is updated.
	LocalEndpointUpdated(endpoint *submV1.Endpoint) error

	// LocalEndpointRemoved is called when an endpoint for the local cluster is removed.
	LocalEndpointRemoved(endpoint *submV1.Endpoint) error

	// RemoteEndpointCreated is called when an endpoint associated with a remote cluster is created.
	RemoteEndpointCreated(endpoint *submV1.Endpoint) error

	// RemoteEndpointUpdated is called when an endpoint associated with a remote cluster is updated.
	RemoteEndpointUpdated(endpoint *submV1.Endpoint) error

	// RemoteEndpointRemoved is called when an endpoint associated with a remote cluster is removed
	RemoteEndpointRemoved(endpoint *submV1.Endpoint) error

	// NodeCreated indicates when a node has been added to the cluster
	NodeCreated(node *k8sV1.Node) error

	// NodeUpdated indicates when a node has been updated in the cluster
	NodeUpdated(node *k8sV1.Node) error

	// NodeRemoved indicates when a node has been removed from the cluster
	NodeRemoved(node *k8sV1.Node) error
}

type HandlerBase

type HandlerBase struct{}

Base structure for event handlers that stubs out methods considered to be optional.

func (*HandlerBase) Init

func (ev *HandlerBase) Init() error

func (*HandlerBase) LocalEndpointCreated

func (ev *HandlerBase) LocalEndpointCreated(endpoint *submV1.Endpoint) error

func (*HandlerBase) LocalEndpointRemoved

func (ev *HandlerBase) LocalEndpointRemoved(endpoint *submV1.Endpoint) error

func (*HandlerBase) LocalEndpointUpdated

func (ev *HandlerBase) LocalEndpointUpdated(endpoint *submV1.Endpoint) error

func (*HandlerBase) NodeCreated

func (ev *HandlerBase) NodeCreated(node *k8sV1.Node) error

func (*HandlerBase) NodeRemoved

func (ev *HandlerBase) NodeRemoved(node *k8sV1.Node) error

func (*HandlerBase) NodeUpdated

func (ev *HandlerBase) NodeUpdated(node *k8sV1.Node) error

func (*HandlerBase) RemoteEndpointCreated

func (ev *HandlerBase) RemoteEndpointCreated(endpoint *submV1.Endpoint) error

func (*HandlerBase) RemoteEndpointRemoved

func (ev *HandlerBase) RemoteEndpointRemoved(endpoint *submV1.Endpoint) error

func (*HandlerBase) RemoteEndpointUpdated

func (ev *HandlerBase) RemoteEndpointUpdated(endpoint *submV1.Endpoint) error

func (*HandlerBase) Stop

func (ev *HandlerBase) Stop(uninstall bool) error

func (*HandlerBase) TransitionToGateway

func (ev *HandlerBase) TransitionToGateway() error

func (*HandlerBase) TransitionToNonGateway

func (ev *HandlerBase) TransitionToNonGateway() error

type Registry

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

func NewRegistry

func NewRegistry(name, networkPlugin string) *Registry

NewRegistry creates a new registry with the given name, typically referencing the owner, to manage event Handlers that match the given networkPlugin name.

func (*Registry) AddHandlers

func (er *Registry) AddHandlers(eventHandlers ...Handler) error

AddHandlers adds the given event Handlers whose associated network plugin matches the network plugin associated with this registry. Non-matching Handlers are ignored. Handlers will be called in registration order.

func (*Registry) GetName

func (er *Registry) GetName() string

GetName returns the name of the registry.

func (*Registry) LocalEndpointCreated

func (er *Registry) LocalEndpointCreated(endpoint *submV1.Endpoint) error

func (*Registry) LocalEndpointRemoved

func (er *Registry) LocalEndpointRemoved(endpoint *submV1.Endpoint) error

func (*Registry) LocalEndpointUpdated

func (er *Registry) LocalEndpointUpdated(endpoint *submV1.Endpoint) error

func (*Registry) NodeCreated

func (er *Registry) NodeCreated(node *k8sV1.Node) error

func (*Registry) NodeRemoved

func (er *Registry) NodeRemoved(node *k8sV1.Node) error

func (*Registry) NodeUpdated

func (er *Registry) NodeUpdated(node *k8sV1.Node) error

func (*Registry) RemoteEndpointCreated

func (er *Registry) RemoteEndpointCreated(endpoint *submV1.Endpoint) error

func (*Registry) RemoteEndpointRemoved

func (er *Registry) RemoteEndpointRemoved(endpoint *submV1.Endpoint) error

func (*Registry) RemoteEndpointUpdated

func (er *Registry) RemoteEndpointUpdated(endpoint *submV1.Endpoint) error

func (*Registry) StopHandlers

func (er *Registry) StopHandlers(uninstall bool) error

func (*Registry) TransitionToGateway

func (er *Registry) TransitionToGateway() error

func (*Registry) TransitionToNonGateway

func (er *Registry) TransitionToNonGateway() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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