package conf import ( "flag" "gomicro-base/common/conf" "gomicro-base/common/logz" "gomicro-base/common/mysql" ) func init() { flag.StringVar(&confPath, "conf", "config/config.yaml", "配置文件路径") } var ( confPath string Conf = &Config{} ) type Config struct { Server *Server Mysql *mysql.Config Log *logz.Config } type Server struct { Name string ConsulServer []string EtcdServer []string Grpc struct { Addr string } Http struct { Addr string } } func LoadConfig() { conf.LoadFromYaml(confPath, &Conf) }