package config type Config struct { Log Log `mapstructure:"log" json:"log" yaml:"log"` Serve Serve `mapstructure:"serve" json:"serve" yaml:"serve"` Oss Oss `mapstructure:"oss" json:"oss" yaml:"oss"` } // Serve gin服务配置 type Serve struct { Port int `mapstructure:"port" json:"port" yaml:"port" description:"gin开启监听http服务的端口"` RunMode string `mapstructure:"run-mode" json:"run-mode" yaml:"run-mode" description:"gin运行模式的默认,枚举值:debug,release"` UseRedis bool `mapstructure:"use-redis" json:"use-redis" yaml:"use-redis" description:"是否使用redis"` AppName string `mapstructure:"app-name" json:"app-name" yaml:"app-name" description:"项目名称"` StaticDir string `mapstructure:"static-dir" json:"static-dir" yaml:"static-dir" description:"上传的文件存储目录地址"` AppNameEn string `mapstructure:"app-name-en" json:"app-name-en" yaml:"app-name-en" description:"项目名称英文"` Md5Key string `mapstructure:"md5-key" json:"md5-key" yaml:"md5-key" description:"Md5密钥"` DesKey string `mapstructure:"des-key" json:"des-key" yaml:"des-key" description:"Des密钥"` IsStopTask bool `mapstructure:"is-stop-task" json:"is-stop-task" yaml:"is-stop-task" description:"是否停止任务,此功能用于多服务器部署时,定时任务只需一台服务器执行,其他服务器不执行的情况下设置为true"` } // Log 日志配置 type Log struct { Prefix string `mapstructure:"prefix" json:"prefix" yaml:"prefix" description:"日志输出前缀"` LogFile bool `mapstructure:"log-file" json:"logFile" yaml:"log-file" description:""` Stdout string `mapstructure:"stdout" json:"stdout" yaml:"stdout" description:""` FileStdout string `mapstructure:"file-stdout" json:"file-stdout" yaml:"file-stdout" description:""` SaveMaxDay int `mapstructure:"save-max-day" json:"save-max-day" yaml:"save-max-day" description:"最多保留多少天的日志"` CuttingDay int `mapstructure:"cutting-day" json:"cutting-day" yaml:"cutting-day" description:"相隔几天切割文件"` LogDirPath string `mapstructure:"log-dir-path" json:"log-dir-path" yaml:"log-dir-path" description:"日志目录"` LogSoftLink string `mapstructure:"log-soft-link" json:"log-soft-link" yaml:"log-soft-link" description:"日志软链接"` BinlogDirPath string `mapstructure:"binlog-dir-path" json:"binlog-dir-path" yaml:"binlog-dir-path" description:"binlog日志目录"` BinlogSoftLink string `mapstructure:"binlog-soft-link" json:"binlog-soft-link" yaml:"binlog-soft-link" description:"binlog日志软链接"` FilelogDirPath string `mapstructure:"filelog-dir-path" json:"filelog-dir-path" yaml:"filelog-dir-path" description:"用户自主记录的日志目录"` FilelogSoftLink string `mapstructure:"filelog-soft-link" json:"filelog-soft-link" yaml:"filelog-soft-link" description:"用户自主记录的日志软链接"` } type Oss struct { ObjectStorageClient string `mapstructure:"object-storage-client" json:"object-storage-client" yaml:"object-storage-client" description:"oss类型,取值:oss minio,s3,默认oss"` EndPoint string `mapstructure:"end-point" json:"end-point" yaml:"end-point" description:"oss服务地址"` BackEndPoint string `mapstructure:"back-end-point" json:"back-end-point" yaml:"back-end-point" description:"oss服务地址(用于内网)"` AccessKeyId string `mapstructure:"access-key-id" json:"access-key-id" yaml:"access-key-id" description:"oss服务access-key-id"` AccessKeySecret string `mapstructure:"access-key-secret" json:"access-key-secret" yaml:"access-key-secret" description:"oss服务access-key-secret"` BucketName string `mapstructure:"bucket-name" json:"bucket-name" yaml:"bucket-name" description:"oss服务bucketname"` RegionId string `mapstructure:"region-id" json:"region-id" yaml:"region-id" description:"oss服务region-id"` ImgHost string `mapstructure:"img-host" json:"img-host" yaml:"img-host" description:"oss服务imghost"` UploadDir string `mapstructure:"upload-dir" json:"upload-dir" yaml:"upload-dir" description:"oss服务上传路径"` Port string `mapstructure:"port" json:"port" yaml:"port" description:"oss服务端口"` ForceStyle bool `mapstructure:"force-style" json:"force-style" yaml:"force-style" description:"oss服务是否强制使用style,默认是True"` Protocol string `mapstructure:"protocol" json:"protocol" yaml:"protocol" description:"oss服务协议,默认是http"` DisableSSL bool `mapstructure:"disable-ssl" json:"disable-ssl" yaml:"disable-ssl" description:"是否禁用ssl"` OpenAcl bool `mapstructure:"open-acl" json:"open-acl" yaml:"open-acl" description:"是否开启acl"` ResourceProxyUrl string `mapstructure:"resource-proxy-url" json:"resource-proxy-url" yaml:"resource-proxy-url" description:"资源代理地址"` Ram OssRam `mapstructure:"ram" json:"ram" yaml:"ram"` } type OssRam struct { AccessKeyId string `mapstructure:"access-key-id" json:"access-key-id" yaml:"access-key-id" description:"oss服务access-key-id"` AccessKeySecret string `mapstructure:"access-key-secret" json:"access-key-secret" yaml:"access-key-secret" description:"oss服务access-key-secret"` StsScheme string `mapstructure:"sts-scheme" json:"sts-scheme" yaml:"sts-scheme" description:"oss服务sts-scheme"` RoleArn string `mapstructure:"role-arn" json:"role-arn" yaml:"role-arn" description:"oss服务role-arn"` RoleSessionName string `mapstructure:"role-session-name" json:"role-session-name" yaml:"role-session-name" description:"oss服务role-session-name"` STSTokenCacheKey string `mapstructure:"sts-token-cache-key" json:"sts-token-cache-key" yaml:"sts-token-cache-key" description:"oss服务sts-token-cache-key(缓存key,用于获取后短期内不再重复获取)"` }