Documentation ¶
Overview ¶
Package manager provides a server implementation of the ConfigurationManager service of the Network Service Platform (NSP) API.
Index ¶
- func NewServer(watcherRegistry WatcherRegistry) nspAPI.ConfigurationManagerServer
- type ConfigurationRegistry
- type Server
- func (s *Server) WatchAttractor(attractor *nspAPI.Attractor, ...) error
- func (s *Server) WatchConduit(conduit *nspAPI.Conduit, ...) error
- func (s *Server) WatchFlow(flow *nspAPI.Flow, watcher nspAPI.ConfigurationManager_WatchFlowServer) error
- func (s *Server) WatchGateway(gateway *nspAPI.Gateway, ...) error
- func (s *Server) WatchStream(stream *nspAPI.Stream, watcher nspAPI.ConfigurationManager_WatchStreamServer) error
- func (s *Server) WatchTrench(trench *nspAPI.Trench, watcher nspAPI.ConfigurationManager_WatchTrenchServer) error
- func (s *Server) WatchVip(vip *nspAPI.Vip, watcher nspAPI.ConfigurationManager_WatchVipServer) error
- type WatcherNotifier
- type WatcherRegistry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewServer ¶
func NewServer(watcherRegistry WatcherRegistry) nspAPI.ConfigurationManagerServer
NewServer is the constructor of Server
Types ¶
type ConfigurationRegistry ¶
type ConfigurationRegistry interface { GetTrench(*nspAPI.Trench) *nspAPI.Trench GetConduits(*nspAPI.Conduit) []*nspAPI.Conduit GetStreams(*nspAPI.Stream) []*nspAPI.Stream GetFlows(*nspAPI.Flow) []*nspAPI.Flow GetVips(*nspAPI.Vip) []*nspAPI.Vip GetAttractors(*nspAPI.Attractor) []*nspAPI.Attractor GetGateways(*nspAPI.Gateway) []*nspAPI.Gateway }
type Server ¶
type Server struct { nspAPI.UnimplementedConfigurationManagerServer WatcherRegistry WatcherRegistry // contains filtered or unexported fields }
Server implements the ConfigurationManagerServer nsp service
func (*Server) WatchAttractor ¶
func (*Server) WatchConduit ¶
func (*Server) WatchGateway ¶
func (*Server) WatchStream ¶
func (*Server) WatchTrench ¶
type WatcherNotifier ¶
type WatcherNotifier struct { ConfigurationRegistry ConfigurationRegistry // contains filtered or unexported fields }
WatcherNotifier implements WatcherRegistry On any event from configurationEventChan, WatcherNotifier will send an event with the corresponding resources to every concerned watchers using the get functions from ConfigurationRegistry
func NewWatcherNotifier ¶
func NewWatcherNotifier(configurationRegistry ConfigurationRegistry, configurationEventChan <-chan *registry.ConfigurationEvent) *WatcherNotifier
NewServer is the constructor of WatcherNotifier
func (*WatcherNotifier) RegisterWatcher ¶
func (wn *WatcherNotifier) RegisterWatcher(toWatch interface{}, ch interface{}) error
RegisterWatcher registers a watcher toWatch is the resource to watch, it can be nil or should be a pointer to a resource struct from the nsp API. ch is a channel where the events will be send on any change in the configuration. ch should receive a single resource for the trench, and a list for the other resources. if toWatch, ch should receive the same type of resource as toWatch. list of resources: Trench, Conduit, Stream, Flow, Vip, Attractor, Gateway.
func (*WatcherNotifier) Start ¶
func (wn *WatcherNotifier) Start(context context.Context)
Start is receiving event fron the configurationEventChan channel and notifier the corresponding subscribers about the changes
func (*WatcherNotifier) UnregisterWatcher ¶
func (wn *WatcherNotifier) UnregisterWatcher(ch interface{})
UnregisterWatcher unregisters a watcher
type WatcherRegistry ¶
type WatcherRegistry interface { RegisterWatcher(toWatch interface{}, ch interface{}) error UnregisterWatcher(ch interface{}) }