Documentation ¶
Index ¶
- Constants
- type DefaultHandlerState
- type Handler
- type HandlerBase
- func (ev *HandlerBase) Init() error
- func (ev *HandlerBase) LocalEndpointCreated(_ *submV1.Endpoint) error
- func (ev *HandlerBase) LocalEndpointRemoved(_ *submV1.Endpoint) error
- func (ev *HandlerBase) LocalEndpointUpdated(_ *submV1.Endpoint) error
- func (ev *HandlerBase) NodeCreated(_ *k8sV1.Node) error
- func (ev *HandlerBase) NodeRemoved(_ *k8sV1.Node) error
- func (ev *HandlerBase) NodeUpdated(_ *k8sV1.Node) error
- func (ev *HandlerBase) RemoteEndpointCreated(_ *submV1.Endpoint) error
- func (ev *HandlerBase) RemoteEndpointRemoved(_ *submV1.Endpoint) error
- func (ev *HandlerBase) RemoteEndpointUpdated(_ *submV1.Endpoint) error
- func (ev *HandlerBase) SetState(handlerState HandlerState)
- func (ev *HandlerBase) State() HandlerState
- func (ev *HandlerBase) Stop() error
- func (ev *HandlerBase) TransitionToGateway() error
- func (ev *HandlerBase) TransitionToNonGateway() error
- func (ev *HandlerBase) Uninstall() error
- type HandlerState
- type Registry
- func (er *Registry) GetName() string
- func (er *Registry) LocalEndpointCreated(endpoint *submV1.Endpoint) error
- func (er *Registry) LocalEndpointRemoved(endpoint *submV1.Endpoint) error
- func (er *Registry) LocalEndpointUpdated(endpoint *submV1.Endpoint) error
- func (er *Registry) NodeCreated(node *k8sV1.Node) error
- func (er *Registry) NodeRemoved(node *k8sV1.Node) error
- func (er *Registry) NodeUpdated(node *k8sV1.Node) error
- func (er *Registry) RemoteEndpointCreated(endpoint *submV1.Endpoint) error
- func (er *Registry) RemoteEndpointRemoved(endpoint *submV1.Endpoint) error
- func (er *Registry) RemoteEndpointUpdated(endpoint *submV1.Endpoint) error
- func (er *Registry) SetHandlerState(handlerState HandlerState)
- func (er *Registry) StopHandlers() error
- func (er *Registry) TransitionToGateway() error
- func (er *Registry) TransitionToNonGateway() error
- func (er *Registry) Uninstall() error
Constants ¶
View Source
const AnyNetworkPlugin = ""
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultHandlerState ¶ added in v0.17.0
type DefaultHandlerState struct{}
func (*DefaultHandlerState) GetRemoteEndpoints ¶ added in v0.17.0
func (c *DefaultHandlerState) GetRemoteEndpoints() []submV1.Endpoint
func (*DefaultHandlerState) IsOnGateway ¶ added in v0.17.0
func (c *DefaultHandlerState) IsOnGateway() bool
type Handler ¶
type Handler interface { // Init is called once on startup to let the handler initialize any state it needs. Init() error // SetHandlerState is called once on startup after Init with the HandlerState that can be used to access global data from event callbacks. SetState(handlerCtx HandlerState) // 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. Stop() error // Uninstall is called once after shutdown to let the handler process a Submariner uninstallation. Uninstall() 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 {
// contains filtered or unexported fields
}
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(_ *submV1.Endpoint) error
func (*HandlerBase) LocalEndpointRemoved ¶
func (ev *HandlerBase) LocalEndpointRemoved(_ *submV1.Endpoint) error
func (*HandlerBase) LocalEndpointUpdated ¶
func (ev *HandlerBase) LocalEndpointUpdated(_ *submV1.Endpoint) error
func (*HandlerBase) NodeCreated ¶
func (ev *HandlerBase) NodeCreated(_ *k8sV1.Node) error
func (*HandlerBase) NodeRemoved ¶
func (ev *HandlerBase) NodeRemoved(_ *k8sV1.Node) error
func (*HandlerBase) NodeUpdated ¶
func (ev *HandlerBase) NodeUpdated(_ *k8sV1.Node) error
func (*HandlerBase) RemoteEndpointCreated ¶
func (ev *HandlerBase) RemoteEndpointCreated(_ *submV1.Endpoint) error
func (*HandlerBase) RemoteEndpointRemoved ¶
func (ev *HandlerBase) RemoteEndpointRemoved(_ *submV1.Endpoint) error
func (*HandlerBase) RemoteEndpointUpdated ¶
func (ev *HandlerBase) RemoteEndpointUpdated(_ *submV1.Endpoint) error
func (*HandlerBase) SetState ¶ added in v0.17.0
func (ev *HandlerBase) SetState(handlerState HandlerState)
func (*HandlerBase) State ¶ added in v0.17.0
func (ev *HandlerBase) State() HandlerState
func (*HandlerBase) Stop ¶
func (ev *HandlerBase) Stop() error
func (*HandlerBase) TransitionToGateway ¶
func (ev *HandlerBase) TransitionToGateway() error
func (*HandlerBase) TransitionToNonGateway ¶
func (ev *HandlerBase) TransitionToNonGateway() error
func (*HandlerBase) Uninstall ¶ added in v0.17.0
func (ev *HandlerBase) Uninstall() error
type HandlerState ¶ added in v0.17.0
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
NewRegistry creates a new registry with the given name, typically referencing the owner, to manage event Handlers that match the given networkPlugin name. The given event Handlers whose associated network plugin matches the given networkPlugin name are added. Non-matching Handlers are ignored. Handlers will be called in registration order.
func (*Registry) LocalEndpointCreated ¶
func (*Registry) LocalEndpointRemoved ¶
func (*Registry) LocalEndpointUpdated ¶
func (*Registry) RemoteEndpointCreated ¶
func (*Registry) RemoteEndpointRemoved ¶
func (*Registry) RemoteEndpointUpdated ¶
func (*Registry) SetHandlerState ¶ added in v0.17.0
func (er *Registry) SetHandlerState(handlerState HandlerState)
func (*Registry) StopHandlers ¶
func (*Registry) TransitionToGateway ¶
func (*Registry) TransitionToNonGateway ¶
Click to show internal directories.
Click to hide internal directories.