package main import ( "time" "linkfog.com/pluginx/pluginmgr" "linkfog.com/public/lib/l" ) func main() { pluginConfig := `{ "testa": { "name": "testa", "path": "testdata/testa.sh", "enable": true, "mem": 419430400, "md5": "uninitialized" }, "testb": { "name": "testb", "path": "testdata/testb.sh", "enable": true, "mem": 419430400, "md5": "uninitialized" } }` cfg, err := pluginmgr.LoadPluginConfigWithData([]byte(pluginConfig)) if err != nil { l.Error("LoadPluginConfigWithData err:", err) return } for k, v := range cfg { l.Infof("plugin:%s, config:%v", k, v) } pluginmgr.EnableValidatePluginMD5 = false mgr := pluginmgr.NewProcessMgr(cfg) mgr.Start() time.Sleep(60 * time.Second) mgr.Stop() }