蛋蛋星球 后台端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

cfg_app.go 2.3 KiB

1 month ago
1 month ago
3 weeks ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. package cfg
  2. import (
  3. "time"
  4. )
  5. type Config struct {
  6. Debug bool `yaml:"debug"`
  7. Prd bool `yaml:"prd"`
  8. CurlDebug bool `yaml:"curldebug"`
  9. SrvAddr string `yaml:"srv_addr"`
  10. RedisAddr string `yaml:"redis_addr"`
  11. RedisPassword string `yaml:"redis_password"`
  12. DB DBCfg `yaml:"db"`
  13. ImDB DBCfg `yaml:"im_db"`
  14. Log LogCfg `yaml:"log"`
  15. ImBusinessRpc ImBusinessRpcCfg `yaml:"im_business_rpc"`
  16. ImLogicRpc ImLogicRpcCfg `yaml:"im_logic_rpc"`
  17. Local bool
  18. MQ MQCfg `yaml:"mq"`
  19. ES ESCfg
  20. }
  21. type ImBusinessRpcCfg struct {
  22. URL string `yaml:"url"`
  23. PORT string `yaml:"port"`
  24. }
  25. type ImLogicRpcCfg struct {
  26. URL string `yaml:"url"`
  27. PORT string `yaml:"port"`
  28. }
  29. type AppCommCfg struct {
  30. OuterURL string `yaml:"outer_url"` // 本模块外部地址
  31. }
  32. type ArkIDCfg struct {
  33. Admin string `yaml:"admin"`
  34. AdminPassword string `yaml:"admin_password"`
  35. Url string `yaml:"url"`
  36. }
  37. // 数据库配置结构体
  38. type DBCfg struct {
  39. Host string `yaml:"host"` //ip及端口
  40. Name string `yaml:"name"` //库名
  41. User string `yaml:"user"` //用户
  42. Psw string `yaml:"psw"` //密码
  43. ShowLog bool `yaml:"show_log"` //是否显示SQL语句
  44. MaxLifetime time.Duration `yaml:"max_lifetime"`
  45. MaxOpenConns int `yaml:"max_open_conns"`
  46. MaxIdleConns int `yaml:"max_idle_conns"`
  47. Path string `yaml:"path"` //日志文件存放路径
  48. }
  49. // 日志配置结构体
  50. type LogCfg struct {
  51. AppName string `yaml:"app_name" `
  52. Level string `yaml:"level"`
  53. IsStdOut bool `yaml:"is_stdout"`
  54. TimeFormat string `yaml:"time_format"` // second, milli, nano, standard, iso,
  55. Encoding string `yaml:"encoding"` // console, json
  56. IsFileOut bool `yaml:"is_file_out"`
  57. FileDir string `yaml:"file_dir"`
  58. FileName string `yaml:"file_name"`
  59. FileMaxSize int `yaml:"file_max_size"`
  60. FileMaxAge int `yaml:"file_max_age"`
  61. }
  62. type MQCfg struct {
  63. Host string `yaml:"host"`
  64. Port string `yaml:"port"`
  65. User string `yaml:"user"`
  66. Pwd string `yaml:"pwd"`
  67. }
  68. type ESCfg struct {
  69. Url string `yaml:"url"`
  70. User string `yaml:"user"`
  71. Pwd string `yaml:"pwd"`
  72. }