X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Fsbi%2Ftypes.go;h=d0a98abb65204d764f0c207f92260eb519fbaeb0;hb=refs%2Fchanges%2F55%2F1055%2F1;hp=f971ff59690d20836ddc2b5fe68c9e9bd06cc188;hpb=16d84d6f7d3489e65e0a83ba9c0d5d62c3914c7f;p=ric-plt%2Frtmgr.git diff --git a/pkg/sbi/types.go b/pkg/sbi/types.go index f971ff5..d0a98ab 100644 --- a/pkg/sbi/types.go +++ b/pkg/sbi/types.go @@ -18,33 +18,36 @@ */ /* Mnemonic: sbi/types.go - Abstract: Containes SBI (SouthBound Interface) specific types + Abstract: Contains SBI (SouthBound Interface) specific types Date: 16 March 2019 */ package sbi -import "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 +import "routing-manager/pkg/rtmgr" +type EngineConfig struct { + Name string + Version string + Protocol string + Instance Engine + IsAvailable bool +} -type SbiEngine struct { - Name string - Version string - Protocol string +type Engine interface { + Initialize(string) error + Terminate() error + DistributeAll(*[]string) error + AddEndpoint(*rtmgr.Endpoint) error + DeleteEndpoint(*rtmgr.Endpoint) error + UpdateEndpoints(*rtmgr.RicComponents) } -type SbiEngineConfig struct { - Engine SbiEngine - OpenSocket openSocket - CloseSocket closeSocket - CreateEndpointSocket createEndpointSocket - DestroyEndpointSocket destroyEndpointSocket - DistributeAll distributeAll - IsAvailable bool +type NngSocket interface { + Listen(string) error + Send([]byte) error + Close() error + DialOptions(string, map[string]interface{}) error } + +type CreateNewNngSocketHandler func() (NngSocket, error)