-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathviper.example.toml
117 lines (109 loc) · 2.2 KB
/
viper.example.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
##################
# #
# viper 配置文件 #
# #
##################
########## MySQL 相关配置
# mysql 按不同环境可以添加多个配置
# 本地配置
[mysql.localhost]
# 数据库 host
host = "localhost"
# 数据库端口
port = 3306
# 用户名
username = "root"
# 密码
password = "roooooot"
# 数据名称
dbname = "test"
# 开启打印日志模式
log_mode = false
# 最大空闲连接数
max_idle_conns = 20
# 最大连接数
max_open_conns = 20
# 连接最长生命周期(分钟)
conn_max_life_minutes = 10
# 连接超时时间(秒)
conn_timeout = 3
# 读超时时间(秒)
read_timeout = 5
# 写超时时间(秒)
write_timeout = 5
# 其他环境
[mysql.other]
########## SQLite 相关配置
[sqlite.dev]
dbname = "sqlite.dev.db"
log_mode = false
########## Postgres 相关配置
[postgres.localhost]
host = "localhost"
port = 5432
username = "root"
password = "roooooot"
dbname = "test"
log_mode = false
max_idle_conns = 20
max_open_conns = 20
conn_max_life_minutes = 10
disable_ssl = true
########## MsSQL 相关配置
[mssql.localhost]
host = "localhost"
port = 1433
username = "root"
password = "roooooot"
dbname = "test"
log_mode = false
max_idle_conns = 20
max_open_conns = 20
conn_max_life_minutes = 10
########## Redis 相关配置
# redis 按不同环境可以添加多个配置
# 本地配置
[redis.localhost]
# redis 地址
addr = "localhost:6379"
# 密码
password = ""
# 使用的 db 索引
db = 0
# 连接超时时间(秒)
dial_timeout = 5
# 读超时(秒)
read_timeout = 3
# 写超时(秒)
write_timeout = 3
# 连接池大小: 0表示10 * runtime.NumCPU()
pool_size = 0
[redis.other]
########## Redis Sentinel 相关配置
[redis.sentinel.prod]
# master 节点名
master_name = ""
# sentinel 地址列表
sentinel_addrs = [""]
# 密码
password = ""
# db 索引
db = 0
# 连接超时时间(秒)
dial_timeout = 5
# 读超时(秒)
read_timeout = 3
# 写超时(秒)
write_timeout = 3
# 连接池大小: 0表示10 * runtime.NumCPU()
pool_size = 0
########## Redis Cluster 相关配置
[redis.cluster.prod]
# 集群节点地址列表
addrs = [""]
# 密码
password = ""
# 读超时(秒)
read_timeout = 3
# 写超时(秒)
write_timeout = 3