manager

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Overview

Package manager provides a server implementation of the ConfigurationManager service of the Network Service Platform (NSP) API.

Index

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 (s *Server) WatchAttractor(attractor *nspAPI.Attractor, watcher nspAPI.ConfigurationManager_WatchAttractorServer) error

func (*Server) WatchConduit

func (s *Server) WatchConduit(conduit *nspAPI.Conduit, watcher nspAPI.ConfigurationManager_WatchConduitServer) error

func (*Server) WatchFlow

func (s *Server) WatchFlow(flow *nspAPI.Flow, watcher nspAPI.ConfigurationManager_WatchFlowServer) error

func (*Server) WatchGateway

func (s *Server) WatchGateway(gateway *nspAPI.Gateway, watcher nspAPI.ConfigurationManager_WatchGatewayServer) error

func (*Server) WatchStream

func (s *Server) WatchStream(stream *nspAPI.Stream, watcher nspAPI.ConfigurationManager_WatchStreamServer) error

func (*Server) WatchTrench

func (s *Server) WatchTrench(trench *nspAPI.Trench, watcher nspAPI.ConfigurationManager_WatchTrenchServer) error

func (*Server) WatchVip

func (s *Server) WatchVip(vip *nspAPI.Vip, watcher nspAPI.ConfigurationManager_WatchVipServer) error

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{})
}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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