Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
黄成意
/
go_sku_server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f2cf48f9
authored
Aug 18, 2025
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
添加mongo配置
parent
7bf43ffe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
12 deletions
conf/dev/mongo.ini
pkg/config/mongo.go
conf/dev/mongo.ini
View file @
f2cf48f9
...
...
@@ -4,4 +4,11 @@ host = 192.168.1.237:27017
username
=
"ichunt"
password
=
"huntmon6699"
database
=
ichunt
maxPoolSize
=
8000
[pre_sku_mongo]
host
=
192.168.1.237:27017
username
=
"ichunt"
password
=
"huntmon6699"
database
=
ichunt
maxPoolSize
=
8000
\ No newline at end of file
pkg/config/mongo.go
View file @
f2cf48f9
package
config
type
MongoDbDatabase
struct
{
Host
string
UserName
string
UserName
string
Password
string
Database
string
MaxPoolSize
string
}
func
BuildMongoDbConfgs
()
map
[
string
]
MongoDbDatabase
{
func
BuildMongoDbConfgs
()
map
[
string
]
MongoDbDatabase
{
return
map
[
string
]
MongoDbDatabase
{
"default"
:
{
Host
:
Get
(
"mongo.host"
)
.
String
(),
UserName
:
Get
(
"mongo.username"
)
.
String
(),
Password
:
Get
(
"mongo.password"
)
.
String
(),
Database
:
Get
(
"mongo.database"
)
.
String
(),
MaxPoolSize
:
Get
(
"mongo.maxPoolSize"
)
.
String
(),
"default"
:
{
Host
:
Get
(
"mongo.host"
)
.
String
(),
UserName
:
Get
(
"mongo.username"
)
.
String
(),
Password
:
Get
(
"mongo.password"
)
.
String
(),
Database
:
Get
(
"mongo.database"
)
.
String
(),
MaxPoolSize
:
Get
(
"mongo.maxPoolSize"
)
.
String
(),
},
"pre_sku"
:
{
Host
:
Get
(
"mongo.pre_sku.host"
)
.
String
(),
UserName
:
Get
(
"mongo.pre_sku.username"
)
.
String
(),
Password
:
Get
(
"mongo.pre_sku.password"
)
.
String
(),
Database
:
Get
(
"mongo.pre_sku.database"
)
.
String
(),
MaxPoolSize
:
Get
(
"mongo.pre_sku.maxPoolSize"
)
.
String
(),
},
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment