hotgo/hotgo-server/config/config.example.yaml
2022-03-01 08:35:20 +08:00

132 lines
5.2 KiB
Go
Raw 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", # 登录
]
# 不需要验证权限的路由地址
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: true # 队列开关默认为true
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: 5 # 指定redis库
pass: "meng133814250" # 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"