Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
G
getty
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wei.xuan
getty
Commits
1e853451
Commit
1e853451
authored
Aug 06, 2018
by
AlexStocks
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mod: bug fix to run
parent
7cdc4714
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
2 deletions
+5
-2
config.go
rpc/client/app/config.go
+2
-1
main.go
rpc/client/app/main.go
+1
-0
config.go
rpc/server/app/config.go
+2
-1
No files found.
rpc/client/app/config.go
View file @
1e853451
...
@@ -17,6 +17,7 @@ import (
...
@@ -17,6 +17,7 @@ import (
import
(
import
(
"github.com/AlexStocks/getty/rpc"
"github.com/AlexStocks/getty/rpc"
log
"github.com/AlexStocks/log4go"
jerrors
"github.com/juju/errors"
jerrors
"github.com/juju/errors"
config
"github.com/koding/multiconfig"
config
"github.com/koding/multiconfig"
)
)
...
@@ -42,7 +43,7 @@ func initConf() {
...
@@ -42,7 +43,7 @@ func initConf() {
return
return
}
}
conf
:
=
new
(
rpc
.
ClientConfig
)
conf
=
new
(
rpc
.
ClientConfig
)
config
.
MustLoadWithPath
(
confFile
,
conf
)
config
.
MustLoadWithPath
(
confFile
,
conf
)
if
err
:=
conf
.
CheckValidity
();
err
!=
nil
{
if
err
:=
conf
.
CheckValidity
();
err
!=
nil
{
panic
(
jerrors
.
ErrorStack
(
err
))
panic
(
jerrors
.
ErrorStack
(
err
))
...
...
rpc/client/app/main.go
View file @
1e853451
...
@@ -131,6 +131,7 @@ func test() {
...
@@ -131,6 +131,7 @@ func test() {
var
errResult
int
var
errResult
int
err
=
client
.
Call
(
rpc
.
CodecJson
,
"127.0.0.1:20000"
,
"TestRpc"
,
"Err"
,
2
,
&
errResult
)
err
=
client
.
Call
(
rpc
.
CodecJson
,
"127.0.0.1:20000"
,
"TestRpc"
,
"Err"
,
2
,
&
errResult
)
if
err
!=
nil
{
if
err
!=
nil
{
// error test case, this invocation should step into this branch.
log
.
Error
(
"client.Call(TestRpc::Err) = error:%s"
,
jerrors
.
ErrorStack
(
err
))
log
.
Error
(
"client.Call(TestRpc::Err) = error:%s"
,
jerrors
.
ErrorStack
(
err
))
return
return
}
}
...
...
rpc/server/app/config.go
View file @
1e853451
...
@@ -18,8 +18,8 @@ import (
...
@@ -18,8 +18,8 @@ import (
import
(
import
(
"github.com/AlexStocks/getty/rpc"
"github.com/AlexStocks/getty/rpc"
log
"github.com/AlexStocks/log4go"
log
"github.com/AlexStocks/log4go"
config
"github.com/koding/multiconfig"
jerrors
"github.com/juju/errors"
jerrors
"github.com/juju/errors"
config
"github.com/koding/multiconfig"
)
)
const
(
const
(
...
@@ -42,6 +42,7 @@ func initConf() {
...
@@ -42,6 +42,7 @@ func initConf() {
panic
(
fmt
.
Sprintf
(
"application configure file name{%v} suffix must be .toml"
,
confFile
))
panic
(
fmt
.
Sprintf
(
"application configure file name{%v} suffix must be .toml"
,
confFile
))
return
return
}
}
conf
=
&
rpc
.
ServerConfig
{}
config
.
MustLoadWithPath
(
confFile
,
conf
)
config
.
MustLoadWithPath
(
confFile
,
conf
)
if
err
:=
conf
.
CheckValidity
();
err
!=
nil
{
if
err
:=
conf
.
CheckValidity
();
err
!=
nil
{
panic
(
jerrors
.
ErrorStack
(
err
))
panic
(
jerrors
.
ErrorStack
(
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