Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
search_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
9021543e
authored
Jun 04, 2020
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
测试通过redis
parent
5ee28309
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
0 deletions
boot/app.go
conf/config.ini
test/redisTest.go
boot/app.go
View file @
9021543e
...
@@ -2,6 +2,7 @@ package boot
...
@@ -2,6 +2,7 @@ package boot
import
(
import
(
"jtthink/pkg/config"
"jtthink/pkg/config"
"jtthink/pkg/gredis"
"jtthink/pkg/mysql"
"jtthink/pkg/mysql"
)
)
...
@@ -12,5 +13,8 @@ func Boot() (err error) {
...
@@ -12,5 +13,8 @@ func Boot() (err error) {
if
err
=
mysql
.
Setup
();
err
!=
nil
{
if
err
=
mysql
.
Setup
();
err
!=
nil
{
return
return
}
}
if
err
=
gredis
.
Setup
();
err
!=
nil
{
return
}
return
return
}
}
conf/config.ini
View file @
9021543e
...
@@ -7,6 +7,10 @@ table_prefix =
...
@@ -7,6 +7,10 @@ table_prefix =
type
=
mysql
type
=
mysql
[redis]
[redis]
write_host
=
192.168.1.235:6379
read_host
=
192.168.1.235:6379
write_password
=
icDb29mLy2s
read_password
=
icDb29mLy2s
max_idle
=
10
max_idle
=
10
max_active
=
10
max_active
=
10
idle_timeout
=
20
idle_timeout
=
20
\ No newline at end of file
test/redisTest.go
0 → 100644
View file @
9021543e
package
main
import
(
"fmt"
"github.com/gomodule/redigo/redis"
"jtthink/boot"
"jtthink/pkg/gredis"
)
func
main
()
{
boot
.
Boot
()
gredis
.
Delete
(
"testKey"
)
//gredis.HDelete("testHKey", 1)
fmt
.
Println
(
redis
.
String
(
gredis
.
Get
(
"testKey"
)))
}
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