Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Aliyun ¶
type Aliyun struct {
Endpoint string `mapstructure:"endpoint" json:"endpoint" yaml:"endpoint"`
BasePath string `mapstructure:"base-path" json:"basePath" yaml:"base-path"`
BucketUrl string `mapstructure:"bucket-url" json:"bucketUrl" yaml:"bucket-url"`
BucketName string `mapstructure:"bucket-name" json:"bucketName" yaml:"bucket-name"`
AccessKeyId string `mapstructure:"access-key-id" json:"accessKeyId" yaml:"access-key-id"`
AccessKeySecret string `mapstructure:"access-key-secret" json:"accessKeySecret" yaml:"access-key-secret"`
}
type Captcha ¶
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"` // 验证码高度
Verification bool `mapstructure:"verification" json:"verification" yaml:"verification"` // 验证码开启
}
type Casbin ¶
type Casbin struct {
ModelPath string `mapstructure:"model-path" json:"modelPath" yaml:"model-path"` // 存放casbin模型的相对路径
}
type Config ¶
type Config struct {
Jwt Jwt `mapstructure:"jwt" json:"jwt" yaml:"jwt"` // jwt
Zap Zap `mapstructure:"zap" json:"zap" yaml:"zap"` // zap 日志
Gorm Gorm `mapstructure:"gorm" json:"gorm" yaml:"gorm"` // gorm
Redis Redis `mapstructure:"redis" json:"redis" yaml:"redis"` // redis
Email Email `mapstructure:"email" json:"email" yaml:"email"` // email 邮箱
System System `mapstructure:"system" json:"system" yaml:"system"` // system 系统
Casbin Casbin `mapstructure:"casbin" json:"casbin" yaml:"casbin"` // casbin 权限
Captcha Captcha `mapstructure:"captcha" json:"captcha" yaml:"captcha"` // captcha 验证码
Qiniu Qiniu `mapstructure:"qiniu" json:"qiniu" yaml:"qiniu"` // 七牛云对象存储
Local Local `mapstructure:"local" json:"local" yaml:"local"` // 本地
Minio Minio `mapstructure:"minio" json:"minio" yaml:"minio"` // minio对象存储
Aliyun Aliyun `mapstructure:"aliyun" json:"aliyun" yaml:"aliyun"` // 阿里云对象存储
Tencent Tencent `mapstructure:"tencent" json:"tencent" yaml:"tencent"` // 腾讯对象存储
AutoCode AutoCode `mapstructure:"auto-code" json:"autoCode" yaml:"auto-code"` // 代码生成器
}
type Email ¶
type Email struct {
To string `mapstructure:"to" json:"to" yaml:"to"` // 收件人:多个以英文逗号分隔 例:a@qq.com b@qq.com 正式开发中请把此项目作为参数使用
From string `mapstructure:"from" json:"from" yaml:"from"` // 发件人 你自己要发邮件的邮箱
Host string `mapstructure:"host" json:"host" yaml:"host"` // 服务器地址 例如 smtp.qq.com 请前往QQ或者你要发邮件的邮箱查看其smtp协议
Secret string `mapstructure:"secret" json:"secret" yaml:"secret"` // 密钥 用于登录的密钥 最好不要用邮箱密码 去邮箱smtp申请一个用于登录的密钥
Nickname string `mapstructure:"nickname" json:"nickname" yaml:"nickname"` // 昵称 发件人昵称 通常为自己的邮箱
Port int `mapstructure:"port" json:"port" yaml:"port"` // 端口 请前往QQ或者你要发邮件的邮箱查看其smtp协议 大多为 465
IsSSL bool `mapstructure:"is-ssl" json:"isSSL" yaml:"is-ssl"` // 是否SSL 是否开启SSL
}
type Gorm ¶
type Gorm struct {
Dsn Dsn `mapstructure:"dsn" json:"dns" yaml:"dsn"`
Config string `mapstructure:"config" json:"config" yaml:"config"`
LogZap bool `mapstructure:"log-zap" json:"logZap" yaml:"log-zap"`
LogMode string `mapstructure:"log-mode" json:"logMode" yaml:"log-mode"`
AutoMigrate bool `mapstructure:"auto-migrate" json:"autoMigrate" yaml:"auto-migrate"`
MaxIdleConnes int `mapstructure:"max-idle-connes" json:"maxIdleConnes" yaml:"max-idle-connes"`
MaxOpenConnes int `mapstructure:"max-open-connes" json:"maxOpenConnes" yaml:"max-open-connes"`
ConnMaxLifetime time.Duration `mapstructure:"conn-max-lifetime" json:"connMaxLifetime" yaml:"conn-max-lifetime"`
ConnMaxIdleTime time.Duration `mapstructure:"conn-max-idle-time" json:"connMaxIdleTime" yaml:"conn-max-idle-time"`
}
func (*Gorm) GetConnMaxIdleTime ¶
GetConnMaxIdleTime 获取 ConnMaxIdleTime 值, 局部不为0则取局部, 为0则取全局 Author: SliverHorn
func (*Gorm) GetConnMaxLifetime ¶
GetConnMaxLifetime 获取 ConnMaxLifetime 值, 局部不为0则取局部, 为0则取全局 Author: SliverHorn
func (*Gorm) GetMaxIdleConnes ¶
GetMaxIdleConnes 获取 MaxIdleConnes 值, 局部不为0则取局部, 为0则取全局 Author: SliverHorn
func (*Gorm) GetMaxOpenConnes ¶
GetMaxOpenConnes 获取 MaxOpenConnes 值, 局部不为0则取局部, 为0则取全局 Author: SliverHorn
type Local ¶
type Local struct {
Path string `mapstructure:"path" json:"path" yaml:"path"` // 本地文件路径
}
func (*Local) Filename ¶
Filename 拼接新文件名 Author [SliverHorn](https://github.com/SliverHorn)
type Minio ¶
type Minio struct {
Id string `mapstructure:"id" json:"id" yaml:"id"`
Path string `mapstructure:"path" json:"path" yaml:"path"`
Token string `mapstructure:"token" json:"token" yaml:"token"`
Bucket string `mapstructure:"bucket" json:"bucket" yaml:"bucket"`
Secret string `mapstructure:"secret" json:"secret" yaml:"secret"`
Endpoint string `mapstructure:"endpoint" json:"endpoint" yaml:"endpoint"`
UseSsl bool `mapstructure:"use-ssl" json:"useSsl" yaml:"use-ssl"`
}
func (*Minio) Filename ¶
Filename 文件名格式 自己可以改 建议保证唯一性 Author [SliverHorn](https://github.com/SliverHorn)
type Qiniu ¶
type Qiniu struct {
Zone string `mapstructure:"zone" json:"zone" yaml:"zone"` // 存储区域
Bucket string `mapstructure:"bucket" json:"bucket" yaml:"bucket"` // 空间名称
ImgPath string `mapstructure:"img-path" json:"imgPath" yaml:"img-path"` // CDN加速域名
UseHTTPS bool `mapstructure:"use-https" json:"useHttps" yaml:"use-https"` // 是否使用https
AccessKey string `mapstructure:"access-key" json:"accessKey" yaml:"access-key"` // 秘钥AK
SecretKey string `mapstructure:"secret-key" json:"secretKey" yaml:"secret-key"` // 秘钥SK
UseCdnDomains bool `mapstructure:"use-cdn-domains" json:"useCdnDomains" yaml:"use-cdn-domains"` // 上传是否使用CDN上传加速
}
type Server ¶
type Server struct {
Api string `mapstructure:"api" json:"api" yaml:"api"`
Boot string `mapstructure:"boot" json:"boot" yaml:"boot"`
Root string `mapstructure:"root" json:"root" yaml:"root"`
Model string `mapstructure:"model" json:"model" yaml:"model"`
Router string `mapstructure:"router" json:"router" yaml:"router"`
Request string `mapstructure:"request" json:"request" yaml:"request"`
Service string `mapstructure:"service" json:"service" yaml:"service"`
}
type Tencent ¶
type Tencent struct {
Bucket string `mapstructure:"bucket" json:"bucket" yaml:"bucket"`
Region string `mapstructure:"region" json:"region" yaml:"region"`
BaseURL string `mapstructure:"base-url" json:"baseURL" yaml:"base-url"`
SecretID string `mapstructure:"secret-id" json:"secretID" yaml:"secret-id"`
SecretKey string `mapstructure:"secret-key" json:"secretKey" yaml:"secret-key"`
PathPrefix string `mapstructure:"path-prefix" json:"pathPrefix" yaml:"path-prefix"`
}
type Web ¶
type Web struct {
Api string `mapstructure:"api" json:"api" yaml:"api"`
Root string `mapstructure:"root" json:"root" yaml:"root"`
Form string `mapstructure:"form" json:"form" yaml:"form"`
Flow string `mapstructure:"flow" json:"flow" yaml:"flow"`
Table string `mapstructure:"table" json:"table" yaml:"table"`
}
type Zap ¶
type Zap struct {
Level string `mapstructure:"level" json:"level" yaml:"level"` // 级别
Format string `mapstructure:"format" json:"format" yaml:"format"` // 输出
Prefix string `mapstructure:"prefix" json:"prefix" yaml:"prefix"` // 日志前缀
Director string `mapstructure:"director" json:"director" yaml:"director"` // 日志文件夹
LinkName string `mapstructure:"link-name" json:"linkName" yaml:"link-name"` // 软链接名称
ShowLine bool `mapstructure:"show-line" json:"showLine" yaml:"showLine"` // 显示行
EncodeLevel string `mapstructure:"encode-level" json:"encodeLevel" yaml:"encode-level"` // 编码级
StacktraceKey string `mapstructure:"stacktrace-key" json:"stacktraceKey" yaml:"stacktrace-key"` // 栈名
LogInConsole bool `mapstructure:"log-in-console" json:"logInConsole" yaml:"log-in-console"` // 输出控制台
}
func (*Zap) GetZapLevel ¶
GetZapLevel 初始化配置文件的Level Author SliverHorn
Click to show internal directories.
Click to hide internal directories.