-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
136 additions
and
96 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[APP] | ||
page_size=20 | ||
log_path=storage/log | ||
log_type=error | ||
time_location=asia/shanghai | ||
|
||
[SERVER] | ||
port=80 | ||
|
||
[DB_MASTER] | ||
host=127.0.0.1 | ||
port=3306 | ||
username=root | ||
password=123456 | ||
dbname=test | ||
|
||
[DB_SLAVE] | ||
host=127.0.0.1 | ||
port=3306 | ||
username=root | ||
password=123456 | ||
dbname=test | ||
|
||
[REDIS_MASTER] | ||
host=127.0.0.1 | ||
port=6379 | ||
password=123456 | ||
db=0 | ||
|
||
[REDIS_SLAVE1] | ||
host=127.0.0.1 | ||
port=6379 | ||
password=123456 | ||
db=0 |
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,3 +1,2 @@ | ||
.env | ||
.env_test | ||
.env_production |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,23 @@ | ||
package config | ||
|
||
import "github.com/wk331100/iFTY/system/helper" | ||
|
||
var RedisConfig = helper.Map{} | ||
|
||
func InitRedisConfig(){ | ||
RedisConfig = helper.Map{ | ||
"master" : helper.Map{ | ||
"host" : helper.Env("host", "REDIS_MASTER"), | ||
"port" : helper.EnvInt("port", "REDIS_MASTER"), | ||
"password" : helper.Env("password", "REDIS_MASTER"), | ||
"db" : helper.EnvInt("db", "REDIS_MASTER"), | ||
}, | ||
"slave1" : helper.Map{ | ||
"host" : helper.Env("host", "REDIS_SLAVE1"), | ||
"port" : helper.EnvInt("port", "REDIS_SLAVE1"), | ||
"password" : helper.Env("password", "REDIS_SLAVE1"), | ||
"db" : helper.EnvInt("db", "REDIS_SLAVE1"), | ||
}, | ||
} | ||
} | ||
|
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,52 +1,23 @@ | ||
package config | ||
|
||
import "github.com/wk331100/iFTY/system/helper" | ||
import ( | ||
"github.com/wk331100/iFTY/system/helper" | ||
) | ||
|
||
var MysqlConfig = helper.Map{} | ||
var RedisConfig = helper.Map{} | ||
var AppConfig = helper.Map{} | ||
var ServerConfig = helper.Map{} | ||
|
||
func InitConfig(){ | ||
ServerConfig = helper.Map{ | ||
"port" : helper.EnvInt("port", "SERVER"), | ||
} | ||
InitAppConfig() | ||
InitServerConfig() | ||
InitDatabaseConfig() | ||
InitRedisConfig() | ||
} | ||
|
||
func InitAppConfig() { | ||
AppConfig = helper.Map{ | ||
"pageSize" : helper.EnvInt("page_size", "APP"), | ||
"logPath" : helper.Env("log_path", "APP"), | ||
"logType" : helper.Env("log_type", "APP"), | ||
"timeLocation" : helper.Env("time_location", "APP"), | ||
} | ||
MysqlConfig = helper.Map{ | ||
"master" : helper.Map{ | ||
"host" : helper.Env("host", "DB_MASTER"), | ||
"port" : helper.EnvInt("port", "DB_MASTER"), | ||
"username" : helper.Env("username", "DB_MASTER"), | ||
"password" : helper.Env("password", "DB_MASTER"), | ||
"dbname" : helper.Env("dbname", "DB_MASTER"), | ||
}, | ||
"slave" : helper.Map{ | ||
"host" : helper.Env("host", "DB_SLAVE"), | ||
"port" : helper.EnvInt("port", "DB_SLAVE"), | ||
"username" : helper.Env("username", "DB_SLAVE"), | ||
"password" : helper.Env("password", "DB_SLAVE"), | ||
"dbname" : helper.Env("dbname", "DB_SLAVE"), | ||
}, | ||
} | ||
|
||
RedisConfig = helper.Map{ | ||
"master" : helper.Map{ | ||
"host" : helper.Env("host", "REDIS_MASTER"), | ||
"port" : helper.EnvInt("port", "REDIS_MASTER"), | ||
"password" : helper.Env("password", "REDIS_MASTER"), | ||
"db" : helper.EnvInt("db", "REDIS_MASTER"), | ||
}, | ||
"slave1" : helper.Map{ | ||
"host" : helper.Env("host", "REDIS_SLAVE1"), | ||
"port" : helper.EnvInt("port", "REDIS_SLAVE1"), | ||
"password" : helper.Env("password", "REDIS_SLAVE1"), | ||
"db" : helper.EnvInt("db", "REDIS_SLAVE1"), | ||
}, | ||
} | ||
} | ||
|
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 was deleted.
Oops, something went wrong.
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,5 +1,13 @@ | ||
package config | ||
|
||
import "github.com/wk331100/iFTY/system/helper" | ||
|
||
var ServerConfig = map[string]interface{}{ | ||
"Port" : 8080, | ||
} | ||
|
||
func InitServerConfig() { | ||
ServerConfig = helper.Map{ | ||
"port" : helper.EnvInt("port", "SERVER"), | ||
} | ||
} |
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,5 @@ | ||
[2021-08-02 20:37:32] [info] Request Log From After MiddleWare | ||
[2021-08-02 20:37:32] [info] Request Log From After MiddleWare | ||
[2021-08-02 20:40:27] [info] Request Log From After MiddleWare | ||
[2021-08-02 20:47:04] [info] Request Log From After MiddleWare | ||
[2021-08-02 20:48:13] [info] Request Log From After MiddleWare |