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
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
-# 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