zhangmeng
2019-12-19 b0d88019decc266c74b1125c9010ce67de3066d8
proc.go
@@ -1,7 +1,33 @@
package sdkstruct
import (
   "encoding/json"
   "fmt"
   "io/ioutil"
)
// SDKInfo db
type SDKInfo struct {
   IpcID   string
   SdkType string
}
// SdkConfig sdk
type SdkConfig struct {
   SoFile string            `json:"so_file_path"`
   Env    string            `json:"runtime"`
   Param  map[string]string `json:"param"`
}
func readConfig(file string) (SdkConfig, error) {
   data, err := ioutil.ReadFile(file)
   if err != nil {
      return SdkConfig{}, fmt.Errorf("READ SDK CONFIG FILE %s ERROR", file)
   }
   //读取的数据为json格式,需要进行解码
   var v SdkConfig
   err = json.Unmarshal(data, &v)
   return v, err
}