package cfg import ( "time" ) type Config struct { Debug bool `yaml:"debug"` Prd bool `yaml:"prd"` CurlDebug bool `yaml:"curldebug"` SrvAddr string `yaml:"srv_addr"` RedisAddr string `yaml:"redis_addr"` RedisPassword string `yaml:"redis_password"` DB DBCfg `yaml:"db"` ImDB DBCfg `yaml:"im_db"` Log LogCfg `yaml:"log"` ImBusinessRpc ImBusinessRpcCfg `yaml:"im_business_rpc"` ImLogicRpc ImLogicRpcCfg `yaml:"im_logic_rpc"` Local bool MQ MQCfg `yaml:"mq"` ES ESCfg } type ImBusinessRpcCfg struct { URL string `yaml:"url"` PORT string `yaml:"port"` } type ImLogicRpcCfg struct { URL string `yaml:"url"` PORT string `yaml:"port"` } type AppCommCfg struct { OuterURL string `yaml:"outer_url"` // 本模块外部地址 } type ArkIDCfg struct { Admin string `yaml:"admin"` AdminPassword string `yaml:"admin_password"` Url string `yaml:"url"` } // 数据库配置结构体 type DBCfg struct { Host string `yaml:"host"` //ip及端口 Name string `yaml:"name"` //库名 User string `yaml:"user"` //用户 Psw string `yaml:"psw"` //密码 ShowLog bool `yaml:"show_log"` //是否显示SQL语句 MaxLifetime time.Duration `yaml:"max_lifetime"` MaxOpenConns int `yaml:"max_open_conns"` MaxIdleConns int `yaml:"max_idle_conns"` Path string `yaml:"path"` //日志文件存放路径 } // 日志配置结构体 type LogCfg struct { AppName string `yaml:"app_name" ` Level string `yaml:"level"` IsStdOut bool `yaml:"is_stdout"` TimeFormat string `yaml:"time_format"` // second, milli, nano, standard, iso, Encoding string `yaml:"encoding"` // console, json IsFileOut bool `yaml:"is_file_out"` FileDir string `yaml:"file_dir"` FileName string `yaml:"file_name"` FileMaxSize int `yaml:"file_max_size"` FileMaxAge int `yaml:"file_max_age"` } type MQCfg struct { Host string `yaml:"host"` Port string `yaml:"port"` User string `yaml:"user"` Pwd string `yaml:"pwd"` } type ESCfg struct { Url string `yaml:"url"` User string `yaml:"user"` Pwd string `yaml:"pwd"` }