X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Fxapp%2Ftypes.go;h=6ae981a9af48e968fbf4301bbd4b3ec23821a47c;hb=79f0680fd7bbf1c8a8c6e2a842cb18020e387a47;hp=2e1eb09934aaad703400904e74996941bc072bf3;hpb=f49009aad3b16524cb53ae954a0711c17ec4f82a;p=ric-plt%2Fxapp-frame.git diff --git a/pkg/xapp/types.go b/pkg/xapp/types.go old mode 100644 new mode 100755 index 2e1eb09..6ae981a --- a/pkg/xapp/types.go +++ b/pkg/xapp/types.go @@ -23,20 +23,18 @@ import ( "unsafe" ) -// To be removed ... -type RMRStatistics struct{} - type RMRClient struct { - protPort string - numWorkers int - context unsafe.Pointer - ready int - wg sync.WaitGroup - mux sync.Mutex - stat map[string]Counter - consumers []MessageConsumer - readyCb ReadyCB - readyCbParams interface{} + contextMux sync.Mutex + context unsafe.Pointer + ready int + wg sync.WaitGroup + mux sync.Mutex + statc map[string]Counter + statg map[string]Gauge + consumers []MessageConsumer + readyCb ReadyCB + readyCbParams interface{} + maxRetryOnFailure int } type RMRMeid struct { @@ -45,6 +43,60 @@ type RMRMeid struct { RanName string } +func (meid *RMRMeid) String() string { + str := "meid(" + pad := "" + if len(meid.PlmnID) > 0 { + str += pad + "PlmnID=" + meid.PlmnID + pad = " " + } + if len(meid.EnbID) > 0 { + str += pad + "EnbID=" + meid.EnbID + pad = " " + } + if len(meid.RanName) > 0 { + str += pad + "RanName=" + meid.RanName + pad = " " + } + str += ")" + return str +} + +type MessageConsumerFunc func(*RMRParams) error + +func (fn MessageConsumerFunc) Consume(params *RMRParams) error { + return fn(params) +} + type MessageConsumer interface { Consume(params *RMRParams) error } + +type PortData struct { + Name string + Port int + MaxSize int + ThreadType int + LowLatency bool + FastAck bool + Policies []int + MaxRetryOnFailure int +} + +type SymptomDataParams struct { + Timeout uint64 + FromTime uint64 + ToTime uint64 + importantOnly bool +} + +// @todo: read these from config or somewhere else +const ( + SERVICE_HTTP = "SERVICE_%s_%s_HTTP_PORT" + SERVICE_RMR = "SERVICE_%s_%s_RMR_PORT" + CONFIG_PATH = "/ric/v1/config" + REGISTER_PATH = "http://service-%s-appmgr-http.%s:8080/ric/v1/register" + DEREGISTER_PATH = "http://service-%s-appmgr-http.%s:8080/ric/v1/deregister" + DEFAULT_PLT_NS = "ricplt" + DEFAULT_XAPP_NS = "ricxapp" +)