From: jaehoon.hyun Date: Tue, 2 Apr 2019 06:23:28 +0000 (+0900) Subject: conf interface change X-Git-Tag: submit/tizen/20190409.085658~6^2~20 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=70a619f94dd5a84fd18a4531fc4b88ef8dea6d9b;p=platform%2Fcore%2Fsystem%2Fedge-orchestration.git conf interface change --- diff --git a/src/configuremgr/incubator/sconf_simple.go b/src/configuremgr/incubator/sconf_simple.go index dfcb43f..a422c4c 100644 --- a/src/configuremgr/incubator/sconf_simple.go +++ b/src/configuremgr/incubator/sconf_simple.go @@ -11,26 +11,28 @@ func main() { Example() } -func Example() { - var cfg = struct { - Version struct { - ConfVersion string - } - ServiceInfo struct { - ServiceName string - ExecFilePath string - } - ResourceType struct { - IntervalTime int - MaxCount int - } +type doc struct { + Version struct { + ConfVersion string + } + ServiceInfo struct { + ServiceName string + ExecFilePath string + } + ScoringMethod struct { + LibFile string + FuncName string + } + ResourceType struct { + IntervalTimeMs int + MaxCount int + } + +} - ScoringMethod struct { - LibFile string - } - - }{} - sconf.Must(&cfg).Read(ini.File("./src/configuremgr/incubator/simple.ini")) +func Example() { + var cfg = new(doc) + sconf.Must(cfg).Read(ini.File("./src/configuremgr/incubator/simple.ini")) // fmt.Println(cfg.Version.ConfVersion) fmt.Println(cfg) diff --git a/src/configuremgr/incubator/simple.ini b/src/configuremgr/incubator/simple.ini index 2fe43b0..ab1f475 100644 --- a/src/configuremgr/incubator/simple.ini +++ b/src/configuremgr/incubator/simple.ini @@ -6,9 +6,10 @@ ConfVersion=v0.0 ; Version of Configurati ServiceName={service_name} ; Name of distributed service ExecFilePath=/path/to/execute/file ; Exec file path +[ScoringMethod] +LibFile={scoringMethod}.so ; Library file name +FuncName=add + [ResourceType] IntervalTimeMs=1000 ; Interval time of get resource MaxCount=10 ; Number of times - -[ScoringMethod] -LibFile={service_name}.so ; Library file name \ No newline at end of file diff --git a/src/configuremgr/mock/mysum/mysum.conf b/src/configuremgr/mock/mysum/mysum.conf index d60485f..6a622a2 100644 --- a/src/configuremgr/mock/mysum/mysum.conf +++ b/src/configuremgr/mock/mysum/mysum.conf @@ -1,13 +1,14 @@ -# Description of service that will be requested -[Version] -ConfVersion=v0.0 ; Version of Configuration file - -[ServiceInfo] -ServiceName=HelloWorldService ; Name of distributed service - -[ResourceType] -IntervalTimeMs=1000 ; Interval time of get resource -MaxCount=10 ; Number of times - -[ScoringMethod] -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