main.go 536 B

123456789101112131415161718192021222324252627282930
  1. package main
  2. import (
  3. "Cold_MqttAcl/routers"
  4. "gopkg.in/ini.v1"
  5. "log"
  6. )
  7. var (
  8. Cfg *ini.File
  9. Mysql string
  10. HttpRort string
  11. )
  12. func init() {
  13. var err error
  14. Cfg, err = ini.Load("config.ini")
  15. if err != nil {
  16. log.Fatalf("Fail to parse 'config.ini': %v", err)
  17. }
  18. Mysql = Cfg.Section("service").Key("Mysql").String()
  19. HttpRort = Cfg.Section("service").Key("HttpRort").String()
  20. }
  21. func main() {
  22. //println(routers.WeekByDate() + routers.GetRandstring(10,"0123456789123456789",int64(0)))
  23. routers.Gininit(HttpRort, Mysql)
  24. }