Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
apaas-meshproxy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gzga-jzapi
apaas-meshproxy
Commits
e24b3a7b
Commit
e24b3a7b
authored
Nov 07, 2019
by
gaoshiyao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
count 计数
parent
70c5f4f2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
src/handler/counthandler.go
src/handler/counthandler.go
+7
-0
src/handler/proxyhandler.go
src/handler/proxyhandler.go
+1
-1
No files found.
src/handler/counthandler.go
View file @
e24b3a7b
...
@@ -13,6 +13,13 @@ func GetCount(c *gin.Context) {
...
@@ -13,6 +13,13 @@ func GetCount(c *gin.Context) {
c
.
Error
(
err
)
c
.
Error
(
err
)
}
}
ic
,
err
:=
redis
.
Get
(
"bgproxy"
+
config
.
ProxyConf
.
MeshId
)
ic
,
err
:=
redis
.
Get
(
"bgproxy"
+
config
.
ProxyConf
.
MeshId
)
if
err
!=
nil
{
c
.
JSON
(
500
,
gin
.
H
{
"success"
:
0
,
"errMsg"
:
err
,
})
return
}
c
.
JSON
(
200
,
gin
.
H
{
c
.
JSON
(
200
,
gin
.
H
{
"Key"
:
fmt
.
Sprintf
(
"bgproxy"
+
config
.
ProxyConf
.
MeshId
),
"Key"
:
fmt
.
Sprintf
(
"bgproxy"
+
config
.
ProxyConf
.
MeshId
),
"Count"
:
ic
,
"Count"
:
ic
,
...
...
src/handler/proxyhandler.go
View file @
e24b3a7b
...
@@ -77,7 +77,7 @@ func count() error {
...
@@ -77,7 +77,7 @@ func count() error {
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
ic
,
err
:=
redis
.
Incr
(
"bgproxy
-
"
+
config
.
ProxyConf
.
MeshId
)
ic
,
err
:=
redis
.
Incr
(
"bgproxy"
+
config
.
ProxyConf
.
MeshId
)
_
,
err
=
ic
.
Result
()
_
,
err
=
ic
.
Result
()
return
err
return
err
}
}
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