Documentation ¶
Index ¶
Constants ¶
View Source
const ConfigFilePath string = "configs"
ConfigFilePath is current directory that config file saved
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Aliyun ¶
type Aliyun struct { Available bool `yaml:"available"` AccessKeyID string `yaml:"accessKeyID"` AccessKeySecret string `yaml:"accessKeySecret"` OSSEndpoint string `yaml:"OSSEndpoint"` OSSBucketName string `yaml:"OSSBucketName"` OSSCDN string `yaml:"OSSCDN"` }
Aliyun is defined for aliyun config model
type App ¶
type App struct { Name string `yaml:"name"` Build string `yaml:"build"` Version string `yaml:"version"` Description string `yaml:"description"` Scheme string `yaml:"scheme"` Host string `yaml:"host"` Base string `yaml:"base"` Locales []string `yaml:"locales"` }
App is defined for application bootstrap config model
type Config ¶
type Config struct { App struct { Name string `yaml:"name" json:"name"` Build string `yaml:"build" json:"build"` Version string `yaml:"version" json:"version"` Description string `yaml:"description" json:"description"` Scheme string `yaml:"scheme" json:"scheme"` Host string `yaml:"host" json:"host"` Base string `yaml:"base" json:"base"` Locales []string `yaml:"locales" json:"locales"` } MiddleWares struct { FallbackLocale string `yaml:"fallbackLocale"` Gzip bool `yaml:"gzip"` LimitRate int `yaml:"limitRate"` Log bool `yaml:"log"` Dump bool `yaml:"dump"` CORS bool `yaml:"CORS"` } Jwt struct { Key string `yaml:"key"` Expire time.Duration `yaml:"expire"` } DB struct { Driver string `yaml:"driver"` DSN string `yaml:"dsn"` } Redis struct { Host string `yaml:"host"` DB int `yaml:"db"` Port int `yaml:"port"` Password string `yaml:"password"` IdleTimeout time.Duration `yaml:"idleTimeout"` ReadTimeout time.Duration `yaml:"readTimeout"` WriteTimeout time.Duration `yaml:"writeTimeout"` PoolTimeout time.Duration `yaml:"poolTimeout"` } SMTP struct { Host string `yaml:"host"` Port int `yaml:"port"` Password string `yaml:"password"` Username string `yaml:"username"` TestRcpt string `yaml:"testRcpt"` } Aliyun struct { Available bool `yaml:"available"` AccessKeyID string `yaml:"accessKeyID"` AccessKeySecret string `yaml:"accessKeySecret"` OSSEndpoint string `yaml:"OSSEndpoint"` OSSBucketName string `yaml:"OSSBucketName"` OSSCDN string `yaml:"OSSCDN"` } }
Config model
func (*Config) GetBootstrapConfig ¶
GetBootstrapConfig is defined for get config from current files 根据环境配置返回app配置信息 app配置信息分别存储在development.yaml或production.yaml中 开发配置的信息和生产的将分开
type MiddleWares ¶
type MiddleWares struct { FallbackLocale string `yaml:"fallbackLocale"` Gzip bool `yaml:"gzip"` LimitRate int `yaml:"limitRate"` Log bool `yaml:"log"` Dump bool `yaml:"dump"` CORS bool `yaml:"CORS"` }
MiddleWares is defined for middleWares config model
type Redis ¶
type Redis struct { Host string `yaml:"host"` DB int `yaml:"db"` Port int `yaml:"port"` Password string `yaml:"password"` IdleTimeout time.Duration `yaml:"idleTimeout"` ReadTimeout time.Duration `yaml:"readTimeout"` WriteTimeout time.Duration `yaml:"writeTimeout"` PoolTimeout time.Duration `yaml:"poolTimeout"` }
Redis is defined for redis config model
type SMSConfig ¶
type SMSConfig struct { API string `yaml:"api" json:"-"` Account string `yaml:"account" json:"-"` Password string `yaml:"password" json:"-"` Sign string `yaml:"sign" json:"-"` CreateAccount string `yaml:"createAccount" json:"-"` ModifyPassword string `yaml:"modifyPassword" json:"-"` Login string `yaml:"login" json:"-"` Common string `yaml:"common" json:"-"` Actions []string `yaml:"actions" json:"actions"` }
SMSConfig is defined for sms api and templates config model
Click to show internal directories.
Click to hide internal directories.