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
0689224b
Commit
0689224b
authored
Nov 06, 2019
by
gaoshiyao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新路由设置
parent
58d1ca72
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
6 deletions
+10
-6
build/dockerfile
build/dockerfile
+1
-1
src/config/conf.go
src/config/conf.go
+1
-0
src/main.go
src/main.go
+8
-5
No files found.
build/dockerfile
View file @
0689224b
...
...
@@ -3,4 +3,4 @@ MAINTAINER {{ AUTHOR }}
LABEL
Author={{ AUTHOR }} Name={{ PROJECT }} Version={{ VERSION }}
COPY
./dist/. /app
EXPOSE
80
ENTRYPOINT
["/app/proxy", "--port=80"]
ENTRYPOINT
["/app/proxy", "--port=80"
,"--prefix=/bgmesh/fiddler"
]
src/config/conf.go
View file @
0689224b
...
...
@@ -3,6 +3,7 @@ package config
var
(
RedisURL
string
RedisTag
string
Prefix
string
)
var
ProxyConf
=
struct
{
...
...
src/main.go
View file @
0689224b
...
...
@@ -18,10 +18,11 @@ import (
)
var
(
argPort
=
pflag
.
Int
(
"port"
,
8088
,
""
)
redisUrl
=
pflag
.
String
(
"redisUrl"
,
"redis://k8s.wodcloud.com:16379"
,
""
)
redisTag
=
pflag
.
String
(
"redisTag"
,
"apaas-mesh-proxy"
,
""
)
confPath
=
pflag
.
String
(
"confPath"
,
"/app/config/proxy.yaml"
,
""
)
argPort
=
pflag
.
Int
(
"port"
,
8088
,
""
)
argPrefix
=
pflag
.
String
(
"prefix"
,
"/bgmesh/fiddler"
,
""
)
redisUrl
=
pflag
.
String
(
"redisUrl"
,
"redis://k8s.wodcloud.com:16379"
,
""
)
redisTag
=
pflag
.
String
(
"redisTag"
,
"apaas-mesh-proxy"
,
""
)
confPath
=
pflag
.
String
(
"confPath"
,
"/app/config/proxy.yaml"
,
""
)
)
func
main
()
{
...
...
@@ -33,8 +34,9 @@ func main() {
}
func
server
()
error
{
config
.
Prefix
=
*
argPrefix
handler
:=
router
.
Load
(
ginrus
.
Ginrus
(
logrus
.
StandardLogger
(),
time
.
RFC3339
,
true
))
fmt
.
Println
(
fmt
.
Sprintf
(
"
Listen Server on
:%d"
,
*
argPort
))
fmt
.
Println
(
fmt
.
Sprintf
(
":%d"
,
*
argPort
))
return
http
.
ListenAndServe
(
fmt
.
Sprintf
(
":%d"
,
*
argPort
),
handler
,
...
...
@@ -52,6 +54,7 @@ func initEnv() {
func
initConfig
()
{
config
.
RedisTag
=
*
redisTag
config
.
RedisURL
=
*
redisUrl
config
.
Prefix
=
*
argPrefix
}
// 获取代理参数
...
...
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