Files
2022-05-15 22:48:07 +08:00

139 lines
5.3 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# hotgo配置
hotgo:
debug: true # debug开关,开启后:接口出现错误时会输出堆栈信息,默认为true
ipMethod: "cz88" # IP归属地解析方法,可选:cz88|whois,默认为cz88
log: # 全局请求日志
switch: true # 日志开关,默认为true
queue: true # 是否启用队列,启用时需要配置队列信息,默认为true
module: ["admin", "api"] # 需要记录的模块
skipCode: [] # 不记录的状态码,如: ["0", "-1"]
# 路由配置
router:
# 后台
admin:
# 前缀
prefix: "/admin"
# 不需要验证登录的路由地址
exceptLogin: [
"/login/captcha", # 登录验证码
"/login/sign", # 登录
"/login/logout", # 退出
]
# 不需要验证权限的路由地址
exceptAuth: [
"/member/info", # 登录用户信息
"/role/dynamic", # 获取动态路由
]
# 接口
api:
# 前缀
prefix: "/api"
# 不需要验证登录的路由地址
exceptPath: []
# HTTP Server.
server:
address: ":8299"
serverRoot: "resource/public"
openapiPath: "/openApi.json"
swaggerPath: "/doc"
DumpRouterMap: false
logPath: "./runtime/log/server"
ErrorStack: true # 当Server捕获到异常时是否记录堆栈信息到日志中。默认为true
ErrorLogEnabled: true # 是否记录异常日志信息到日志中。默认为true
errorLogPattern: "error/{Y-m-d}.log" # 异常错误日志文件格式。默认为"error-{Ymd}.log"
accessLogEnabled: true # 是否记录访问日志。默认为false
accessLogPattern: "access/{Y-m-d}.log" # 访问日志文件格式。默认为"access-{Ymd}.log"
serverAgent: "HG HTTP Server"
# Global logging.
logger:
level: "all"
stdout: true
headerPrint: false
ctxKeys: []
path: "./runtime/log/logger" # 日志文件路径。默认为空,表示关闭,仅输出到终端
file: "{Y-m-d}.log" # 日志文件格式。默认为"{Y-m-d}.log"
exception: # 系统异常日志
path: "./runtime/log/exception"
level: "all"
file: "{Y-m-d}.log"
queue: # 消息队列日志
path: "./runtime/log/queue"
level: "all"
file: "{Y-m-d}.log"
#JWT
jwt:
version: "1.0" # 版本号
expires: "864000" # 有效期,单位:秒
sign: "hotgo" # 秘钥,考虑安全问题请修改默认值
multiPort: true # 是否允许多端登录,默认为true
#消息队列
queue:
switch: false # 队列开关,默认为false
driver: "redis" # 队列驱动,可选:redis|rocketmq|kafka
retry: 2 # 重试次数
multiComsumer: true # 是否支持创建多个消费者
groupName: "hotgo" # mq群组名称
redis:
address: "127.0.0.1:6379" # redis服务地址,默认为127.0.0.1:6379
db: 0 # 指定redis库
pass: "hg123456" # redis密码
timeout: 0 # 队列超时时间(s) ,0为永不超时,当队列一直没有被消费到达超时时间则队列会被销毁
rocketmq:
address: "127.0.0.1:9876" # brocker地址+端口
logLevel: "all" # 系统日志级别,可选:all|close|debug|info|warn|error|fatal
kafka:
address: "127.0.0.1:9092" # kafka地址+端口
version: "2.0.0.0" # kafka专属配置,默认2.0.0.0
randClient: true # 开启随机生成clientID,可以实现启动多实例同时一起消费相同topic,加速消费能力的特性,默认为true
# Redis数据库配置
redis:
default:
address: "127.0.0.1:6379"
db: "1"
pass: "hg123456."
idleTimeout: "20"
# cache:
# address: "127.0.0.1:6379"
# db: "1"
# pass: "hg123456."
# idleTimeout: "20"
# Database.
database:
logger:
level: "all"
stdout: true
default:
link: "mysql:hotgo:hg123456.@tcp(127.0.0.1:3306)/hotgo"
debug: true
Prefix: "hg_"
# CLI.
gfcli:
build:
name: "hg"
gen:
dao:
- link: "mysql:hotgo:hg123456.@tcp(127.0.0.1:3306)/hotgo"
path: "./app"
# tables: "" #指定当前数据库中需要执行代码生成的数据表。如果为空,表示数据库的所有表都会生成。
# tablesEx: "" #指定当前数据库中需要排除代码生成的数据表。
removePrefix: "hg_"
descriptionTag: true
noModelComment: true
jsonCase: "Snake"