--- /dev/null
+[main]\r
+url=http://localhost/
\ No newline at end of file
--- /dev/null
+package main\r
+\r
+import (\r
+ "fmt"\r
+ \r
+ "gopkg.in/sconf/ini.v0"\r
+ "gopkg.in/sconf/sconf.v0"\r
+)\r
+\r
+func main() {\r
+ Example()\r
+}\r
+\r
+func Example() {\r
+ var cfg = struct {\r
+ Main struct {\r
+ Url string\r
+ }\r
+ }{}\r
+ sconf.Must(&cfg).Read(ini.File("./src/configuremgr/incubator/example.ini"))\r
+ fmt.Println(cfg.Main.Url)\r
+ // Output: http://localhost/\r
+}
\ No newline at end of file
--- /dev/null
+package main\r
+\r
+import (\r
+ "fmt"\r
+ \r
+ "gopkg.in/sconf/ini.v0"\r
+ "gopkg.in/sconf/sconf.v0"\r
+)\r
+\r
+func main() {\r
+ 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
+\r
+ ScoringMethod struct {\r
+ LibFile string\r
+ }\r
+ \r
+ }{}\r
+ sconf.Must(&cfg).Read(ini.File("./src/configuremgr/incubator/simple.ini"))\r
+ // fmt.Println(cfg.Version.ConfVersion)\r
+ fmt.Println(cfg)\r
+\r
+ // Output: http://localhost/\r
+}
\ No newline at end of file
--- /dev/null
+# Description of service that will be requested\r
+[Version]\r
+ConfVersion=v0.0 ; Version of Configuration file\r
+\r
+[ServiceInfo]\r
+ServiceName={service_name} ; Name of distributed service\r
+ExecFilePath=/path/to/execute/file ; Exec file path\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