Add new packages to the container
[ric-plt/rtmgr.git] / pkg / nbi / types.go
index e02c30d..049fe45 100644 (file)
 */
 /*
   Mnemonic:    nbi.go
-  Abstract:    Containes NBI (NorthBound Interface) specific types
+  Abstract:    Contains NBI (NorthBound Interface) specific types
   Date:                12 March 2019
 */
 
 package nbi
 
-import "rtmgr"
-
-type batchFetch func(url string) (*[]rtmgr.XApp, error)
-
-type NbiEngine struct {
-       Name     string
-       Version  string
-       Protocol string
+import (
+       "routing-manager/pkg/models"
+       "routing-manager/pkg/rpe"
+       "routing-manager/pkg/rtmgr"
+       "routing-manager/pkg/sdl"
+)
+
+type FetchAllXAppsHandler func(string) (*[]rtmgr.XApp, error)
+type RecvXappCallbackDataHandler func(<-chan *models.XappCallbackData) (*[]rtmgr.XApp, error)
+type LaunchRestHandler func(*string, chan<- *models.XappCallbackData, chan<- *models.XappSubscriptionData, chan<- *models.XappSubscriptionData)
+type ProvideXappHandleHandlerImpl func(chan<- *models.XappCallbackData, *models.XappCallbackData) error
+type RetrieveStartupDataHandler func(string, string, string, string, sdl.Engine) error
+
+type EngineConfig struct {
+       Name        string
+       Version     string
+       Protocol    string
+       Instance    Engine
+       IsAvailable bool
 }
 
-type NbiEngineConfig struct {
-       Engine      NbiEngine
-       BatchFetch  batchFetch
-       IsAvailable bool
+type Engine interface {
+       Initialize(string, string, string, string, sdl.Engine, rpe.Engine, chan<- bool) error
+       Terminate() error
 }