蛋蛋星球-客户端
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 
 
 

76 satır
2.2 KiB

  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. Log LogCfg `yaml:"log"`
  14. ImBusinessRpc ImBusinessRpcCfg `yaml:"im_business_rpc"`
  15. ImLogicRpc ImLogicRpcCfg `yaml:"im_logic_rpc"`
  16. Local bool
  17. MQ MQCfg `yaml:"mq"`
  18. }
  19. type ImBusinessRpcCfg struct {
  20. URL string `yaml:"url"`
  21. PORT string `yaml:"port"`
  22. }
  23. type ImLogicRpcCfg struct {
  24. URL string `yaml:"url"`
  25. PORT string `yaml:"port"`
  26. }
  27. type AppCommCfg struct {
  28. OuterURL string `yaml:"outer_url"` // 本模块外部地址
  29. }
  30. type ArkIDCfg struct {
  31. Admin string `yaml:"admin"`
  32. AdminPassword string `yaml:"admin_password"`
  33. Url string `yaml:"url"`
  34. }
  35. // 数据库配置结构体
  36. type DBCfg struct {
  37. Host string `yaml:"host"` //ip及端口
  38. Name string `yaml:"name"` //库名
  39. User string `yaml:"user"` //用户
  40. Psw string `yaml:"psw"` //密码
  41. ShowLog bool `yaml:"show_log"` //是否显示SQL语句
  42. MaxLifetime time.Duration `yaml:"max_lifetime"`
  43. MaxOpenConns int `yaml:"max_open_conns"`
  44. MaxIdleConns int `yaml:"max_idle_conns"`
  45. Path string `yaml:"path"` //日志文件存放路径
  46. }
  47. // 日志配置结构体
  48. type LogCfg struct {
  49. AppName string `yaml:"app_name" `
  50. Level string `yaml:"level"`
  51. IsStdOut bool `yaml:"is_stdout"`
  52. TimeFormat string `yaml:"time_format"` // second, milli, nano, standard, iso,
  53. Encoding string `yaml:"encoding"` // console, json
  54. IsFileOut bool `yaml:"is_file_out"`
  55. FileDir string `yaml:"file_dir"`
  56. FileName string `yaml:"file_name"`
  57. FileMaxSize int `yaml:"file_max_size"`
  58. FileMaxAge int `yaml:"file_max_age"`
  59. }
  60. type MQCfg struct {
  61. Host string `yaml:"host"`
  62. Port string `yaml:"port"`
  63. User string `yaml:"user"`
  64. Pwd string `yaml:"pwd"`
  65. }