Skip to content

Commit

Permalink
chore: make rpc client global (#147)
Browse files Browse the repository at this point in the history
* chore: make rpc client global

Signed-off-by: rogerogers <[email protected]>

* chore: fix typo

Signed-off-by: rogerogers <[email protected]>

* chore: upgrade workflow gofumt version

Signed-off-by: rogerogers <[email protected]>

* chore: workflow use ubuntu-latest

Signed-off-by: rogerogers <[email protected]>

* chore: fix lint

Signed-off-by: rogerogers <[email protected]>

---------

Signed-off-by: rogerogers <[email protected]>
  • Loading branch information
rogerogers authored Jun 7, 2024
1 parent 36af1b1 commit 231bdf8
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [pull_request]

jobs:
compliant:
runs-on: self-hosted
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [push, pull_request]

jobs:
lint-and-ut:
runs-on: self-hosted
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

Expand All @@ -23,8 +23,8 @@ jobs:
- name: Lint
run: |
go vet -stdmethods=false $(go list ./...)
go install mvdan.cc/gofumpt@v0.5.0
test -z "$(gofumpt -l -extra .)"
go install mvdan.cc/gofumpt@v0.6.0
test -z "$(gofumpt -l -extra .)"
- name: Unit Test
run: go test -race -covermode=atomic -coverprofile=coverage.out ./...

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

2 changes: 1 addition & 1 deletion bizdemo/tiktok_demo/biz/router/favorite/middleware.go

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

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"))
}
3 changes: 3 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 231bdf8

Please sign in to comment.