baseConfig.go 1.5 KB

123456789101112131415161718192021222324252627282930
  1. package config
  2. type Base struct {
  3. HttpConfig struct {
  4. HttpPort string `json:"http_port" mapstructure:"http_port"`
  5. ReadTimeOut int `json:"read_timeout" mapstructure:"read_timeout"`
  6. WriteTimeOut int `json:"write_timeout" mapstructure:"write_timeout"`
  7. ServerPageRouter bool `json:"server_page_router" mapstructure:"server_page_router"`
  8. StaticRoot string `json:"static_root" mapstructure:"static_root"`
  9. StaticPrefix string `json:"static_prefix" mapstructure:"static_prefix"`
  10. TemplateDir string `json:"template_dir" mapstructure:"template_dir"`
  11. } `mapstructure:"http"`
  12. ZapConfig struct {
  13. Level string `mapstructure:"level" json:"level"`
  14. Format string `mapstructure:"format" json:"format"`
  15. Prefix string `mapstructure:"prefix" json:"prefix"`
  16. Director string `mapstructure:"director" json:"director"`
  17. LinkName string `mapstructure:"link-name" json:"linkName"`
  18. ShowLine bool `mapstructure:"show-line" json:"showLine"`
  19. EncodeLevel string `mapstructure:"encode-level" json:"encodeLevel"`
  20. StacktraceKey string `mapstructure:"stacktrace-key" json:"stacktraceKey"`
  21. LogInConsole bool `mapstructure:"log-in-console" json:"logInConsole"`
  22. } `mapstructure:"zap"`
  23. RedisSession struct {
  24. RedisToken string `json:"redis_token" mapstructure:"redis_token"`
  25. } `mapstructure:"session"`
  26. JWT struct {
  27. SigningKey string `mspstructure:"signing_key" json:"signing_key"`
  28. } `mapstructure:"jwt"`
  29. }