Compare commits
41 Commits
v3.9.0
...
36788b5fbf
| Author | SHA1 | Date | |
|---|---|---|---|
| 36788b5fbf | |||
|
|
c79b83a3c1 | ||
| a6585fd6d4 | |||
|
|
7fce5ccad9 | ||
| b5a5e98f9e | |||
|
|
e419c6a67c | ||
| 17c46e63a2 | |||
|
|
cdf1a2c3e3 | ||
| aba3df63df | |||
|
|
337df46029 | ||
| bfe4839a00 | |||
|
|
5474c37f8f | ||
| ba88a5568a | |||
|
|
57f903a8c2 | ||
| 9f918bd3f2 | |||
|
|
0d88050daf | ||
|
|
d1ed5bed51 | ||
|
|
42697318b1 | ||
| 28aea45725 | |||
|
|
ed72c05645 | ||
|
|
d239dcde63 | ||
| 6eb07dc351 | |||
|
|
a0d704f845 | ||
| 4b8a761f30 | |||
|
|
a2c711a1b5 | ||
| be564f50aa | |||
|
|
b7b1eff81c | ||
| 671a6b6f7c | |||
| 27c1c4d86b | |||
| 76d37a99eb | |||
|
|
4c2827172f | ||
| e3461dd23f | |||
|
|
d8b5c011e5 | ||
|
|
15abd38afd | ||
| 5865a0f388 | |||
|
|
67da8d1165 | ||
|
|
c7d24caa03 | ||
| 8c222c4715 | |||
| 6e91cd5cf5 | |||
| a9e673b2ef | |||
| 251f06cc31 |
2
.github/workflows/autoapprove.yml
vendored
2
.github/workflows/autoapprove.yml
vendored
@@ -13,7 +13,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: approve
|
- name: approve
|
||||||
uses: hmarr/auto-approve-action@v2
|
uses: hmarr/auto-approve-action@v3
|
||||||
if: github.actor == 'vtolstov' || github.actor == 'dependabot[bot]'
|
if: github.actor == 'vtolstov' || github.actor == 'dependabot[bot]'
|
||||||
id: approve
|
id: approve
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@@ -34,7 +34,7 @@ jobs:
|
|||||||
- name: checkout
|
- name: checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: lint
|
- name: lint
|
||||||
uses: golangci/golangci-lint-action@v3.3.1
|
uses: golangci/golangci-lint-action@v3.4.0
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
with:
|
with:
|
||||||
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
|
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
|
||||||
|
|||||||
2
.github/workflows/dependabot-automerge.yml
vendored
2
.github/workflows/dependabot-automerge.yml
vendored
@@ -15,7 +15,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: metadata
|
- name: metadata
|
||||||
id: metadata
|
id: metadata
|
||||||
uses: dependabot/fetch-metadata@v1.3.5
|
uses: dependabot/fetch-metadata@v1.3.6
|
||||||
with:
|
with:
|
||||||
github-token: "${{ secrets.TOKEN }}"
|
github-token: "${{ secrets.TOKEN }}"
|
||||||
- name: merge
|
- name: merge
|
||||||
|
|||||||
2
.github/workflows/pr.yml
vendored
2
.github/workflows/pr.yml
vendored
@@ -34,7 +34,7 @@ jobs:
|
|||||||
- name: checkout
|
- name: checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: lint
|
- name: lint
|
||||||
uses: golangci/golangci-lint-action@v3.3.1
|
uses: golangci/golangci-lint-action@v3.4.0
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
with:
|
with:
|
||||||
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
|
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
|
||||||
|
|||||||
7
go.mod
7
go.mod
@@ -3,9 +3,6 @@ module go.unistack.org/micro-client-grpc/v3
|
|||||||
go 1.16
|
go 1.16
|
||||||
|
|
||||||
require (
|
require (
|
||||||
go.unistack.org/micro/v3 v3.9.13
|
go.unistack.org/micro/v3 v3.10.14
|
||||||
golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect
|
google.golang.org/grpc v1.52.3
|
||||||
golang.org/x/sys v0.0.0-20220429233432-b5fbb4746d32 // indirect
|
|
||||||
google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e // indirect
|
|
||||||
google.golang.org/grpc v1.50.1
|
|
||||||
)
|
)
|
||||||
|
|||||||
18
grpc.go
18
grpc.go
@@ -26,7 +26,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
DefaultContentType = "application/grpc+proto"
|
DefaultContentType = "application/grpc"
|
||||||
)
|
)
|
||||||
|
|
||||||
type grpcClient struct {
|
type grpcClient struct {
|
||||||
@@ -122,6 +122,14 @@ func (g *grpcClient) call(ctx context.Context, addr string, req client.Request,
|
|||||||
grpcDialOptions = append(grpcDialOptions, opts...)
|
grpcDialOptions = append(grpcDialOptions, opts...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
contextDialer := g.opts.ContextDialer
|
||||||
|
if opts.ContextDialer != nil {
|
||||||
|
contextDialer = opts.ContextDialer
|
||||||
|
}
|
||||||
|
if contextDialer != nil {
|
||||||
|
grpcDialOptions = append(grpcDialOptions, grpc.WithContextDialer(contextDialer))
|
||||||
|
}
|
||||||
|
|
||||||
cc, err := g.pool.getConn(dialCtx, addr, grpcDialOptions...)
|
cc, err := g.pool.getConn(dialCtx, addr, grpcDialOptions...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.InternalServerError("go.micro.client", fmt.Sprintf("Error sending request: %v", err))
|
return errors.InternalServerError("go.micro.client", fmt.Sprintf("Error sending request: %v", err))
|
||||||
@@ -223,6 +231,14 @@ func (g *grpcClient) stream(ctx context.Context, addr string, req client.Request
|
|||||||
grpcDialOptions = append(grpcDialOptions, opts...)
|
grpcDialOptions = append(grpcDialOptions, opts...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
contextDialer := g.opts.ContextDialer
|
||||||
|
if opts.ContextDialer != nil {
|
||||||
|
contextDialer = opts.ContextDialer
|
||||||
|
}
|
||||||
|
if contextDialer != nil {
|
||||||
|
grpcDialOptions = append(grpcDialOptions, grpc.WithContextDialer(contextDialer))
|
||||||
|
}
|
||||||
|
|
||||||
cc, err := g.pool.getConn(dialCtx, addr, grpcDialOptions...)
|
cc, err := g.pool.getConn(dialCtx, addr, grpcDialOptions...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.InternalServerError("go.micro.client", fmt.Sprintf("Error sending request: %v", err))
|
return errors.InternalServerError("go.micro.client", fmt.Sprintf("Error sending request: %v", err))
|
||||||
|
|||||||
Reference in New Issue
Block a user