Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
im-microservice
Overview
Overview
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
Li Feifei
im-microservice
Commits
25a939db
Commit
25a939db
authored
Jul 02, 2020
by
Li Feifei
Browse files
Options
Browse Files
Download
Plain Diff
服务端错误返回code码
parents
0d8946a0
88ab1f8d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
main.go
main.go
+2
-0
No files found.
main.go
View file @
25a939db
...
@@ -137,6 +137,7 @@ func main() {
...
@@ -137,6 +137,7 @@ func main() {
var
opts
[]
grpc
.
ServerOption
var
opts
[]
grpc
.
ServerOption
opts
=
append
(
opts
,
grpc
.
UnaryInterceptor
(
auth
))
opts
=
append
(
opts
,
grpc
.
UnaryInterceptor
(
auth
))
s
:=
grpc
.
NewServer
(
opts
...
)
s
:=
grpc
.
NewServer
(
opts
...
)
srv
:=
NewServer
()
srv
:=
NewServer
()
pb
.
RegisterHealthServer
(
s
,
srv
)
pb
.
RegisterHealthServer
(
s
,
srv
)
pb
.
RegisterConfigureSeviceServer
(
s
,
&
ic
.
ConfigureSevice
{})
pb
.
RegisterConfigureSeviceServer
(
s
,
&
ic
.
ConfigureSevice
{})
...
@@ -144,6 +145,7 @@ func main() {
...
@@ -144,6 +145,7 @@ func main() {
pb
.
RegisterImUserServer
(
s
,
&
im_user
.
ImUserServer
{})
pb
.
RegisterImUserServer
(
s
,
&
im_user
.
ImUserServer
{})
pb
.
RegisterUserRelationshipServiceServer
(
s
,
&
iur
.
UserRelationshipService
{})
pb
.
RegisterUserRelationshipServiceServer
(
s
,
&
iur
.
UserRelationshipService
{})
reflection
.
Register
(
s
)
reflection
.
Register
(
s
)
log
.
Println
(
"gRPC server is running on "
+
port
+
" port."
)
log
.
Println
(
"gRPC server is running on "
+
port
+
" port."
)
if
err
:=
s
.
Serve
(
lis
);
err
!=
nil
{
if
err
:=
s
.
Serve
(
lis
);
err
!=
nil
{
log
.
Fatalf
(
"failed to serve: %v"
,
err
)
log
.
Fatalf
(
"failed to serve: %v"
,
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