Skip to content

Commit

Permalink
chore: make rpc client global
Browse files Browse the repository at this point in the history
Signed-off-by: rogerogers <[email protected]>
  • Loading branch information
rogerogers committed May 29, 2024
1 parent 36af1b1 commit 2012b61
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
20 changes: 4 additions & 16 deletions hz_kitex_demo/hertz-server/biz/handler/api/student_api.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions hz_kitex_demo/hertz-server/infra/rpc/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package rpc

import (
"hertz-examples/hz_demo/hertz-server/kitex_gen/student/management/studentmanagement"

client "github.com/cloudwego/kitex/client"
)

var Client studentmanagement.Client

func InitClient() {
Client, _ = studentmanagement.NewClient("student", client.WithHostPorts("127.0.0.1:8888"))
}
2 changes: 2 additions & 0 deletions hz_kitex_demo/hertz-server/main.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2012b61

Please sign in to comment.