-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into dependabot/go_modules/github.com/gin-contr…
…ib/cors-1.6.0
- Loading branch information
Showing
24 changed files
with
445 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
default: | ||
Driver: mysql # 驱动名称,目前支持 mysql,postgres,默认: mysql | ||
Name: eagle # 数据库名称 | ||
Addr: db:3306 # 如果是 docker,可以替换为 对应的服务名称,eg: db:3306 | ||
Driver: mysql # 驱动名称,目前支持 mysql,postgres,默认: mysql | ||
Name: eagle # 数据库名称 | ||
Addr: db:3306 # 如果是 docker,可以替换为 对应的服务名称,eg: db:3306 | ||
UserName: root | ||
Password: root | ||
ShowLog: true # 是否打印所有SQL日志 | ||
MaxIdleConn: 10 # 最大闲置的连接数,0意味着使用默认的大小2, 小于0表示不使用连接池 | ||
MaxOpenConn: 60 # 最大打开的连接数, 需要小于数据库配置中的max_connections数 | ||
Timeout: 3s # 数据库连接超时时间 | ||
ReadTimeout: 3s # 数据库去读超时时间, 0代表不限制 | ||
WriteTimeout: 3s # 数据库写入超时时间, 0代表不限制 | ||
ConnMaxLifeTime: 4h # 单个连接最大存活时间,建议设置比数据库超时时长(wait_timeout)稍小一些 | ||
SlowThreshold: 500ms # 慢查询阈值,设置后只打印慢查询日志,默认为200ms | ||
ShowLog: true # 是否打印所有SQL日志 | ||
MaxIdleConn: 10 # 最大闲置的连接数,0意味着使用默认的大小2, 小于0表示不使用连接池 | ||
MaxOpenConn: 60 # 最大打开的连接数, 需要小于数据库配置中的max_connections数 | ||
Timeout: 3s # 数据库连接超时时间 | ||
ReadTimeout: 3s # 数据库去读超时时间, 0代表不限制 | ||
WriteTimeout: 3s # 数据库写入超时时间, 0代表不限制 | ||
ConnMaxLifeTime: 4h # 单个连接最大存活时间,建议设置比数据库超时时长(wait_timeout)稍小一些 | ||
SlowThreshold: 500ms # 慢查询阈值,设置后只打印慢查询日志,默认为200ms | ||
EnableTrace: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
Development: false | ||
DisableCaller: false | ||
DisableStacktrace: false | ||
Encoding: json # json or console | ||
Level: info # 日志级别,INFO, WARN, ERROR | ||
Name: eagle | ||
Writers: console # 有2个可选项:file,console 选择file会将日志记录到logger_file指定的日志文件中,选择console会将日志输出到标准输出,当然也可以两者同时选择 | ||
Encoding: json # json or console | ||
Level: info # 日志级别,INFO, WARN, ERROR | ||
ServiceName: user-service | ||
Filename: eagle | ||
Writers: console # 有2个可选项:file,console 选择file会将日志记录到logger_file指定的日志文件中,选择console会将日志输出到标准输出,当然也可以两者同时选择 | ||
LoggerDir: /data/logs | ||
LogRollingPolicy: daily | ||
LogRotateDate: 1 | ||
LogRotateSize: 1 | ||
LogBackupCount: 7 | ||
FlushInterval: 1s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,30 @@ | ||
default: | ||
Driver: mysql # 驱动名称,目前支持: mysql,postgres,默认: mysql | ||
Name: eagle # 数据库名称 | ||
Addr: localhost:3306 # 如果是 docker,可以替换为 对应的服务名称,eg: db:3306, pg:5432 | ||
Driver: mysql # 驱动名称,目前支持: mysql,postgres,默认: mysql | ||
Name: eagle # 数据库名称 | ||
Addr: localhost:3306 # 如果是 docker,可以替换为 对应的服务名称,eg: db:3306, pg:5432 | ||
UserName: root | ||
Password: 123456 | ||
ShowLog: true # 是否打印所有SQL日志 | ||
MaxIdleConn: 10 # 最大闲置的连接数,0意味着使用默认的大小2, 小于0表示不使用连接池 | ||
MaxOpenConn: 60 # 最大打开的连接数, 需要小于数据库配置中的max_connections数 | ||
Timeout: 3s # 数据库连接超时时间, 如果是 PostgreSQL 不需要加入单位 | ||
ReadTimeout: 3s # 数据库去读超时时间, 0代表不限制,如果是PostgreSQL, 3000代表3s | ||
WriteTimeout: 3s # 数据库写入超时时间, 0代表不限制,如果是PostgreSQL, 不会使用该字段的值 | ||
ConnMaxLifeTime: 4h # 单个连接最大存活时间,建议设置比数据库超时时长(wait_timeout)稍小一些 | ||
SlowThreshold: 500ms # 慢查询阈值,设置后只打印慢查询日志,默认为200ms | ||
ShowLog: true # 是否打印所有SQL日志 | ||
MaxIdleConn: 10 # 最大闲置的连接数,0意味着使用默认的大小2, 小于0表示不使用连接池 | ||
MaxOpenConn: 60 # 最大打开的连接数, 需要小于数据库配置中的max_connections数 | ||
Timeout: 3s # 数据库连接超时时间, 如果是 PostgreSQL 不需要加入单位 | ||
ReadTimeout: 3s # 数据库去读超时时间, 0代表不限制,如果是PostgreSQL, 3000代表3s | ||
WriteTimeout: 3s # 数据库写入超时时间, 0代表不限制,如果是PostgreSQL, 不会使用该字段的值 | ||
ConnMaxLifeTime: 4h # 单个连接最大存活时间,建议设置比数据库超时时长(wait_timeout)稍小一些 | ||
SlowThreshold: 500ms # 慢查询阈值,设置后只打印慢查询日志,默认为200ms | ||
EnableTrace: false | ||
user: | ||
Driver: mysql # 驱动名称,目前支持: mysql,postgres,默认: mysql | ||
Name: eagle # 数据库名称 | ||
Addr: localhost:3306 # 如果是 docker,可以替换为 对应的服务名称,eg: db:3306, pg:5432 | ||
Driver: mysql # 驱动名称,目前支持: mysql,postgres,默认: mysql | ||
Name: eagle # 数据库名称 | ||
Addr: localhost:3306 # 如果是 docker,可以替换为 对应的服务名称,eg: db:3306, pg:5432 | ||
UserName: root | ||
Password: 123456 | ||
ShowLog: true # 是否打印所有SQL日志 | ||
MaxIdleConn: 10 # 最大闲置的连接数,0意味着使用默认的大小2, 小于0表示不使用连接池 | ||
MaxOpenConn: 60 # 最大打开的连接数, 需要小于数据库配置中的max_connections数 | ||
Timeout: 3s # 数据库连接超时时间 | ||
ReadTimeout: 3s # 数据库去读超时时间, 0代表不限制 | ||
WriteTimeout: 3s # 数据库写入超时时间, 0代表不限制 | ||
ConnMaxLifeTime: 4h # 单个连接最大存活时间,建议设置比数据库超时时长(wait_timeout)稍小一些 | ||
SlowThreshold: 500ms # 慢查询阈值,设置后只打印慢查询日志,默认为200ms | ||
ShowLog: true # 是否打印所有SQL日志 | ||
MaxIdleConn: 10 # 最大闲置的连接数,0意味着使用默认的大小2, 小于0表示不使用连接池 | ||
MaxOpenConn: 60 # 最大打开的连接数, 需要小于数据库配置中的max_connections数 | ||
Timeout: 3s # 数据库连接超时时间 | ||
ReadTimeout: 3s # 数据库去读超时时间, 0代表不限制 | ||
WriteTimeout: 3s # 数据库写入超时时间, 0代表不限制 | ||
ConnMaxLifeTime: 4h # 单个连接最大存活时间,建议设置比数据库超时时长(wait_timeout)稍小一些 | ||
SlowThreshold: 500ms # 慢查询阈值,设置后只打印慢查询日志,默认为200ms | ||
EnableTrace: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
Development: false | ||
DisableCaller: false | ||
DisableStacktrace: false | ||
Encoding: json # json or console | ||
Level: info # 日志级别,INFO, WARN, ERROR | ||
Name: eagle | ||
Writers: console # 有2个可选项:file,console 选择file会将日志记录到logger_file指定的日志文件中,选择console会将日志输出到标准输出,当然也可以两者同时选择 | ||
Encoding: json # json or console | ||
Level: info # 日志级别,INFO, WARN, ERROR | ||
ServiceName: user-service | ||
Filename: eagle | ||
Writers: console # 有2个可选项:file,console 选择file会将日志记录到logger_file指定的日志文件中,选择console会将日志输出到标准输出,当然也可以两者同时选择 | ||
LoggerDir: /data/logs | ||
LogRollingPolicy: daily | ||
LogRotateDate: 1 | ||
LogRotateSize: 1 | ||
LogBackupCount: 7 | ||
FlushInterval: 1s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package lock | ||
|
||
var ( | ||
// lockscript lua script for acrequire a lock | ||
lockLuaScript = ` | ||
if redis.call("GET", KEYS[1]) == ARGV[1] then | ||
redis.call("SET", KEYS[1], ARGV[1], "PX", ARGV[2]) | ||
return "OK" | ||
else | ||
return redis.call("SET", KEYS[1], ARGV[1], "NX", "PX", ARGV[2]) | ||
end | ||
` | ||
|
||
// unlockscript lua script for release a lock | ||
unlockLuaScript = ` | ||
if redis.call("GET", KEYS[1]) == ARGV[1] then | ||
return redis.call("DEL", KEYS[1]) | ||
else | ||
return 0 | ||
end | ||
` | ||
) |
Oops, something went wrong.