# See the License for the specific language governing permissions and
# limitations under the License.
#
-log-level: debug
\ No newline at end of file
+log-level: debug
+onborder-url: "http://127.0.0.1:9191"
+mock-server: "127.0.0.1:9191"
\ No newline at end of file
# See the License for the specific language governing permissions and
# limitations under the License.
#
-log-level: debug
\ No newline at end of file
+log-level: debug
+onborder-url: "http://service-ricplt-xapp-onboarder-http.ricplt:8888/api/v1/onboard"
\ No newline at end of file
--- /dev/null
+//==================================================================================
+// Copyright (c) 2022 Samsung
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// This source code is part of the near-RT RIC (RAN Intelligent Controller)
+// platform project (RICP).
+//==================================================================================
+//
+
+package config
+
+import (
+ "fmt"
+ "io/ioutil"
+
+ "gopkg.in/yaml.v3"
+)
+
+type Conf struct {
+ LogLevel string `yaml:"log-level"`
+ OnboardURL string `yaml:"onborder-url"`
+ MockServer string `yaml:"mock-server"`
+}
+
+func ReadConfiguration(configFile string) (c *Conf, err error) {
+ yamlFile, err := ioutil.ReadFile(configFile)
+ if err != nil {
+ fmt.Printf("error in resolving config file : %+v\n", err)
+ return nil, err
+ }
+
+ err = yaml.Unmarshal(yamlFile, &c)
+ if err != nil {
+ fmt.Printf("Unmarshal error : %+v\n", err)
+ return nil, err
+ }
+
+ return c, err
+}
"os"
mdclog "gerrit.o-ran-sc.org/r/com/golog"
+ "gerrit.o-ran-sc.org/r/ric-plt/ricdms/pkg/config"
)
type ricdms struct {
}
var Logger *mdclog.MdcLogger
+var Config *config.Conf
func Init() {
var err error
if configFile != "" {
Logger.ParseFileContent(configFile)
+ Config, err = config.ReadConfiguration(configFile)
+ if err != nil {
+ Logger.Error("Error in parsing config file: %v", err)
+ }
Logger.Info("Logger is initialized with config file : %s", configFile)
} else {
Logger.LevelSet(mdclog.INFO)
- Logger.Info("Logger is initialized without config file.")
+ Logger.Info("Logger is initialized without config file(%s).", configFile)
}
}