Documentation ¶
Overview ¶
Package server contains internal server-side functionality used by the public facing xds package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewListenerWrapper ¶
func NewListenerWrapper(params ListenerWrapperParams) net.Listener
NewListenerWrapper creates a new listenerWrapper with params. It returns a net.Listener. It starts in state not serving, which triggers Accept() + Close() on any incoming connections.
Only TCP listeners are supported.
Types ¶
type ListenerWrapperParams ¶
type ListenerWrapperParams struct { // Listener is the net.Listener passed by the user that is to be wrapped. Listener net.Listener // ListenerResourceName is the xDS Listener resource to request. ListenerResourceName string // XDSClient provides the functionality from the XDSClient required here. XDSClient XDSClient // ModeCallback is the callback to invoke when the serving mode changes. ModeCallback ServingModeCallback }
ListenerWrapperParams wraps parameters required to create a listenerWrapper.
type ServingModeCallback ¶
type ServingModeCallback func(addr net.Addr, mode connectivity.ServingMode, err error)
ServingModeCallback is the callback that users can register to get notified about the server's serving mode changes. The callback is invoked with the address of the listener and its new mode. The err parameter is set to a non-nil error if the server has transitioned into not-serving mode.
type XDSClient ¶
type XDSClient interface { WatchResource(rType xdsresource.Type, resourceName string, watcher xdsresource.ResourceWatcher) (cancel func()) BootstrapConfig() *bootstrap.Config }
XDSClient wraps the methods on the XDSClient which are required by the listenerWrapper.