| | |
| | | package insertdata |
| | | |
| | | import ( |
| | | "ruleprocess/logger" |
| | | "encoding/json" |
| | | "errors" |
| | | "fmt" |
| | | "io/ioutil" |
| | | "net" |
| | | "ruleprocess/cache" |
| | | "ruleprocess/logger" |
| | | "strings" |
| | | "time" |
| | | |
| | |
| | | func init() { |
| | | logger.Info("_________________________________________老子想看你执行了没") |
| | | fmt.Println("_________________________________________老子想看你执行了没") |
| | | data, _ := ioutil.ReadFile("conf.yml") |
| | | data, err := ioutil.ReadFile("./config/conf.yml") |
| | | if err != nil { |
| | | fmt.Println("读取配置文件出错--",err) |
| | | logger.Error("读取配置文件出错--",err) |
| | | } |
| | | fmt.Println("从配置文件中读取的值为:",string(data)) |
| | | c := conf{} |
| | | //把yaml形式的字符串解析成struct类型 |
| | | yaml.Unmarshal(data, &c) |
| | | fmt.Println("c.PhotoUrl的值为:",c.PhotoUrl) |
| | | weedfsUrl = c.PhotoUrl |
| | | fmt.Println("weedfsUrl的值为:",weedfsUrl) |
| | | logger.Info("weedfsUrl的值为:",weedfsUrl) |