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
8b87c737
Commit
8b87c737
authored
Jul 10, 2020
by
gaoshiyao
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev'
parents
4fc499ee
2900fd96
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
3 deletions
+7
-3
src/config/conf.go
src/config/conf.go
+1
-0
src/main.go
src/main.go
+2
-0
src/router/router.go
src/router/router.go
+4
-3
No files found.
src/config/conf.go
View file @
8b87c737
...
@@ -3,6 +3,7 @@ package config
...
@@ -3,6 +3,7 @@ package config
var
(
var
(
RedisURL
string
RedisURL
string
RedisTag
string
RedisTag
string
MeshId
string
Prefix
string
Prefix
string
Url
string
Url
string
RedisUrl
string
RedisUrl
string
...
...
src/main.go
View file @
8b87c737
...
@@ -18,6 +18,7 @@ import (
...
@@ -18,6 +18,7 @@ import (
var
(
var
(
argPort
=
pflag
.
Int
(
"port"
,
8011
,
""
)
argPort
=
pflag
.
Int
(
"port"
,
8011
,
""
)
argPrefix
=
pflag
.
String
(
"prefix"
,
"/bgmesh/fiddler"
,
""
)
argPrefix
=
pflag
.
String
(
"prefix"
,
"/bgmesh/fiddler"
,
""
)
meshId
=
pflag
.
String
(
"meshId"
,
""
,
""
)
redisUrl
=
pflag
.
String
(
"redisUrl"
,
"redis://apaas-redis.apaas-v3:6379"
,
""
)
redisUrl
=
pflag
.
String
(
"redisUrl"
,
"redis://apaas-redis.apaas-v3:6379"
,
""
)
redisTag
=
pflag
.
String
(
"redisTag"
,
"apaas-mesh-proxy"
,
""
)
redisTag
=
pflag
.
String
(
"redisTag"
,
"apaas-mesh-proxy"
,
""
)
confPath
=
pflag
.
String
(
"confPath"
,
"/app/config/proxy.json"
,
""
)
confPath
=
pflag
.
String
(
"confPath"
,
"/app/config/proxy.json"
,
""
)
...
@@ -53,6 +54,7 @@ func initEnv() {
...
@@ -53,6 +54,7 @@ func initEnv() {
func
initConfig
()
{
func
initConfig
()
{
config
.
RedisTag
=
*
redisTag
config
.
RedisTag
=
*
redisTag
config
.
RedisURL
=
*
redisUrl
config
.
RedisURL
=
*
redisUrl
config
.
MeshId
=
*
meshId
config
.
Prefix
=
*
argPrefix
config
.
Prefix
=
*
argPrefix
config
.
DriverName
=
*
dbDriverName
config
.
DriverName
=
*
dbDriverName
config
.
DbURL
=
*
dbURL
config
.
DbURL
=
*
dbURL
...
...
src/router/router.go
View file @
8b87c737
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
package
router
package
router
import
(
import
(
"fmt"
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin"
"gitlab.wodcloud.com/apaas/apaas-meshproxy/src/config"
"gitlab.wodcloud.com/apaas/apaas-meshproxy/src/config"
"gitlab.wodcloud.com/apaas/apaas-meshproxy/src/handler"
"gitlab.wodcloud.com/apaas/apaas-meshproxy/src/handler"
...
@@ -29,10 +30,10 @@ func Load(middleware ...gin.HandlerFunc) http.Handler {
...
@@ -29,10 +30,10 @@ func Load(middleware ...gin.HandlerFunc) http.Handler {
e
.
Use
(
header
.
Options
)
e
.
Use
(
header
.
Options
)
e
.
Use
(
header
.
Secure
)
e
.
Use
(
header
.
Secure
)
e
.
Use
(
middleware
...
)
e
.
Use
(
middleware
...
)
root
:=
e
.
Group
(
config
.
Prefix
)
root
:=
e
.
Group
(
fmt
.
Sprintf
(
"%s/%s"
,
config
.
Prefix
,
config
.
MeshId
)
)
{
{
root
.
Any
(
"/:
svcId/:
applyId"
,
handler
.
Proxy
)
root
.
Any
(
"/:applyId"
,
handler
.
Proxy
)
root
.
GET
(
"/:
svcId/:
applyId/health"
,
handler
.
Proxy
)
root
.
GET
(
"/:applyId/health"
,
handler
.
Proxy
)
}
}
return
e
return
e
}
}
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