配置
简介
配置模块是Firmeve中基础模块之一,Firmeve的启动必须带上config配置,在cli中使用-c选项指定config路径
配置文件示例
framework:
lang: zh-CN
key: "!!@#$123^%"
database:
default: mysql
connections:
mysql:
addr: "root:root@(127.0.0.1)/default?charset=utf8mb4&parseTime=True&loc=Local"
pool:
max_idle: 100
max_connection: 50
max_lifetime: 60
migration:
path: "../../../testdata/migrations"
cache:
prefix: firmeve_cache
default: redis
repositories:
redis:
connection: cache基础示例
其它可用方法:
GetBool()
GetString()
GetFloat64()
GetInt()
GetIntSlice()
GetString()
GetStringMap()
GetStringMapString()
GetTime()
GetDuration()
环境变量
环境变量的键会统一转换为大写,不支持小写环境变量名
环境变量设置
环境变量读取
Last updated
Was this helpful?