package app //服务基础配置 type Server struct { Appsetup appsetup `mapstructure:"appsetup" json:"appsetup" yaml:"appsetup"` Logsetup logsetup `mapstructure:"logconfig" json:"logconfig" yaml:"logconfig"` Captcha captcha `mapstructure:"captcha" json:"captcha" yaml:"captcha"` RedisPrefixStr redisPrefixStr `mapstructure:"redisprefix" json:"redisprefix" yaml:"redisprefix"` WechatCompany wechatCompany `mapstructure:"wechatcompany" json:"wechatcompany" yaml:"wechatcompany"` //企业ID } //服务配置详情 type appsetup struct { Port int `mapstructure:"port" json:"port" yaml:"port"` Readtime int `mapstructure:"readtime" json:"readtime" yaml:"readtime"` Writetime int `mapstructure:"writetime" json:"writetime" yaml:"writetime"` AppKey string `mapstructure:"appkey" json:"appkey" yaml:"appkey"` DefaultPassword string `mapstructure:"password" json:"password" yaml:"password"` PreFix string `mapstructure:"prefix" json:"prefix" yaml:"prefix"` WebUrl string `mapstructure:"weburl" json:"weburl" yaml:"weburl"` PcbUrl string `mapstructure:"pcurl" json:"pcurl" yaml:"pcurl"` } //日志配置 type logsetup struct { Path string `mapstructure:"path" json:"path" yaml:"path"` } //验证码相关 type captcha struct { KeyLong int `mapstructure:"key-long" json:"keyLong" yaml:"key-long"` // 验证码长度 ImgWidth int `mapstructure:"img-width" json:"imgWidth" yaml:"img-width"` // 验证码宽度 ImgHeight int `mapstructure:"img-height" json:"imgHeight" yaml:"img-height"` // 验证码高度 } type redisPrefixStr struct { PreFix string `mapstructure:"prefix" json:"prefix" yaml:"prefix"` // 键前缀 Alias string `mapstructure:"alias" json:"alias" yaml:"alias"` // 别名 ActivateCluster bool `mapstructure:"activateCluster" json:"activateCluster" yaml:"activateCluster"` // 是否开启集群 PoolSize int `mapstructure:"poolSize" json:"poolSize" yaml:"poolSize"` // 连接池最大socket连接数,默认为4倍CPU数, 4 * runtime.NumCPU MinIdleConns int `mapstructure:"minIdleConns" json:"minIdleConns" yaml:"minIdleConns"` //在启动阶段创建指定数量的Idle连接,并长期维持idle状态的连接数不少于指定数量;。 DialTimeout int `mapstructure:"dialTimeout" json:"dialTimeout" yaml:"dialTimeout"` //连接建立超时时间,默认5秒。 } //企业微信基础配置 type wechatCompany struct { CompanyId string `mapstructure:"companyid" json:"companyid" yaml:"companyid"` // 企业ID } //企业微信自建引用结构 type wechatConfig struct { Agentid string `mapstructure:"agentid" json:"agentid" yaml:"agentid"` // Agentid Secret string `mapstructure:"secret" json:"secret" yaml:"secret"` // Secret Token string `mapstructure:"token" json:"token" yaml:"token"` // Token Encodingaeskey string `mapstructure:"encodingaeskey" json:"encodingaeskey" yaml:"encodingaeskey"` // EncodingAESKey }