conf interface change
authorjaehoon.hyun <jaehoon.hyun@samsung.com>
Tue, 2 Apr 2019 06:23:28 +0000 (15:23 +0900)
committerjaehoon.hyun <jaehoon.hyun@samsung.com>
Tue, 2 Apr 2019 06:23:28 +0000 (15:23 +0900)
src/configuremgr/incubator/sconf_simple.go
src/configuremgr/incubator/simple.ini
src/configuremgr/mock/mysum/mysum.conf

index dfcb43f782bc520493f7f2a92a84d5f5f59019b0..a422c4c6e3aa36906783c60eeb5604ec511eee37 100644 (file)
@@ -11,26 +11,28 @@ func main() {
     Example()\r
 }\r
 \r
-func Example() {\r
-       var cfg = struct {\r
-               Version struct {\r
-                       ConfVersion string\r
-               }\r
-               ServiceInfo struct {\r
-                       ServiceName  string\r
-                       ExecFilePath string\r
-               }\r
-               ResourceType struct {\r
-                       IntervalTime int\r
-                       MaxCount     int\r
-               }\r
+type doc struct {\r
+       Version struct {\r
+               ConfVersion string\r
+       }\r
+       ServiceInfo struct {\r
+               ServiceName  string\r
+               ExecFilePath string\r
+       }\r
+       ScoringMethod struct {\r
+               LibFile      string\r
+               FuncName     string\r
+       }\r
+       ResourceType struct {\r
+               IntervalTimeMs int\r
+               MaxCount       int\r
+       }\r
+\r
+}\r
 \r
-               ScoringMethod struct {\r
-                       LibFile      string\r
-               }\r
-               \r
-       }{}\r
-       sconf.Must(&cfg).Read(ini.File("./src/configuremgr/incubator/simple.ini"))\r
+func Example() {\r
+       var cfg = new(doc)\r
+       sconf.Must(cfg).Read(ini.File("./src/configuremgr/incubator/simple.ini"))\r
        // fmt.Println(cfg.Version.ConfVersion)\r
        fmt.Println(cfg)\r
 \r
index 2fe43b0eb10fb85bb913486d39d8a447c846c9a1..ab1f4759713efad164dc15574542522cd0374d86 100644 (file)
@@ -6,9 +6,10 @@ ConfVersion=v0.0                                        ; Version of Configurati
 ServiceName={service_name}                              ; Name of distributed service\r
 ExecFilePath=/path/to/execute/file                      ; Exec file path\r
 \r
+[ScoringMethod]\r
+LibFile={scoringMethod}.so                               ; Library file name\r
+FuncName=add\r
+\r
 [ResourceType]\r
 IntervalTimeMs=1000                                     ; Interval time of get resource\r
 MaxCount=10                                             ; Number of times\r
-\r
-[ScoringMethod]\r
-LibFile={service_name}.so                               ; Library file name
\ No newline at end of file
index d60485f3a21cab6caff9efebed4d6cfd28411652..6a622a2dd0b4d0b855c202b109f8a13a5447848f 100644 (file)
@@ -1,13 +1,14 @@
-# Description of service that will be requested\r
-[Version]\r
-ConfVersion=v0.0                                        ; Version of Configuration file\r
-\r
-[ServiceInfo]\r
-ServiceName=HelloWorldService                              ; Name of distributed service\r
-\r
-[ResourceType]\r
-IntervalTimeMs=1000                                     ; Interval time of get resource\r
-MaxCount=10                                             ; Number of times\r
-\r
-[ScoringMethod]\r
-LibFile=./libmysum.so                               ; Library file name
\ No newline at end of file
+# Description of service that will be requested
+[Version]
+ConfVersion=v0.0                                        ; Version of Configuration file
+
+[ServiceInfo]
+ServiceName=HelloWorldService                              ; Name of distributed service
+
+[ScoringMethod]
+LibFile=./libmysum.so                               ; Library file name
+FunctionName=add
+
+[ResourceType]
+IntervalTimeMs=1000                                     ; Interval time of get resource
+MaxCount=10                                             ; Number of times