Release of Routing Manager v0.3.0
[ric-plt/rtmgr.git] / pkg / sbi / types.go
index f971ff5..357d87c 100644 (file)
 
 package sbi
 
-import "rtmgr"
+import "routing-manager/pkg/rtmgr"
 
-type distributeAll func(*[]string) error
-type openSocket func(string) error
-type closeSocket func() error
-type createEndpointSocket func(*rtmgr.Endpoint) error
-type destroyEndpointSocket func(*rtmgr.Endpoint) error
-
-
-type SbiEngine struct {
+type SbiEngineConfig struct {
        Name     string
        Version  string
-       Protocol string
+  Protocol string
+  Instance SbiEngine
+  IsAvailable bool
 }
 
-type SbiEngineConfig struct {
-       Engine        SbiEngine
-       OpenSocket    openSocket
-       CloseSocket   closeSocket
-       CreateEndpointSocket createEndpointSocket
-       DestroyEndpointSocket destroyEndpointSocket
-       DistributeAll distributeAll
-       IsAvailable   bool
+type SbiEngine interface {
+  Initialize(string) error
+  Terminate() error
+  DistributeAll(*[]string) error
+  AddEndpoint(*rtmgr.Endpoint) error
+  DeleteEndpoint(*rtmgr.Endpoint) error
+  UpdateEndpoints(*rtmgr.RicComponents)
 }
+
+type NngSocket interface {
+       Listen(string) error
+       Send([]byte) error
+  Close() error
+  DialOptions(string, map[string]interface{}) error
+}
+
+type CreateNewNngSocketHandler func() (NngSocket,error)