Compare commits

..

179 Commits

Author SHA1 Message Date
e3fe27105b Merge pull request 'add defaultConfigService' (#133) from devstigneev/micro-client-grpc:issue_132 into master
Some checks failed
build / test (push) Successful in 1m38s
build / lint (push) Successful in 9m26s
codeql / analyze (go) (push) Failing after 13m37s
Reviewed-on: #133
2024-02-29 17:07:00 +03:00
0f8ead6acc add defaultConfigService
Some checks failed
automerge / automerge (pull_request) Has been skipped
dependabot-automerge / automerge (pull_request) Has been skipped
autoapprove / autoapprove (pull_request) Successful in 10s
codeql / analyze (go) (pull_request) Has been cancelled
prbuild / test (pull_request) Has been cancelled
prbuild / lint (pull_request) Has been cancelled
2024-02-29 16:58:44 +03:00
19a469c4e2 export grpc pool conn
Some checks failed
build / test (push) Has been cancelled
build / lint (push) Has been cancelled
codeql / analyze (go) (push) Has been cancelled
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2024-02-14 19:14:56 +03:00
2a6a93a792 export grpc conn pool
Some checks are pending
build / test (push) Waiting to run
build / lint (push) Waiting to run
codeql / analyze (go) (push) Waiting to run
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2024-02-14 18:09:34 +03:00
40b5402aa5
Merge pull request #138 from unistack-org/dependabot/go_modules/go.unistack.org/micro/v3-3.10.22
Some checks failed
build / test (push) Failing after 7s
build / lint (push) Failing after 6s
codeql / analyze (go) (push) Failing after 7s
Bump go.unistack.org/micro/v3 from 3.10.20 to 3.10.22
2023-05-29 21:01:38 +03:00
dependabot[bot]
e8b7e30e4d
Bump go.unistack.org/micro/v3 from 3.10.20 to 3.10.22
Bumps go.unistack.org/micro/v3 from 3.10.20 to 3.10.22.

---
updated-dependencies:
- dependency-name: go.unistack.org/micro/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-29 17:59:00 +00:00
55e7e3d61d
Merge pull request #137 from unistack-org/dependabot/go_modules/go.unistack.org/micro/v3-3.10.20
Bump go.unistack.org/micro/v3 from 3.10.19 to 3.10.20
2023-05-26 21:01:41 +03:00
dependabot[bot]
d75c36938a
Bump go.unistack.org/micro/v3 from 3.10.19 to 3.10.20
Bumps go.unistack.org/micro/v3 from 3.10.19 to 3.10.20.

---
updated-dependencies:
- dependency-name: go.unistack.org/micro/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-26 17:57:58 +00:00
a7cec360e9
Merge pull request #132 from unistack-org/dependabot/go_modules/go.unistack.org/micro/v3-3.10.19
Bump go.unistack.org/micro/v3 from 3.10.18 to 3.10.19
2023-04-03 21:01:31 +03:00
dependabot[bot]
3978256931
Bump go.unistack.org/micro/v3 from 3.10.18 to 3.10.19
Bumps go.unistack.org/micro/v3 from 3.10.18 to 3.10.19.

---
updated-dependencies:
- dependency-name: go.unistack.org/micro/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-03 17:58:44 +00:00
6dfff28203
Merge pull request #130 from unistack-org/dependabot/go_modules/go.unistack.org/micro/v3-3.10.18
Bump go.unistack.org/micro/v3 from 3.10.16 to 3.10.18
2023-03-16 21:01:43 +03:00
dependabot[bot]
373acda151
Bump go.unistack.org/micro/v3 from 3.10.16 to 3.10.18
Bumps go.unistack.org/micro/v3 from 3.10.16 to 3.10.18.

---
updated-dependencies:
- dependency-name: go.unistack.org/micro/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-16 17:58:49 +00:00
3f9ed4e83b
Merge pull request #128 from unistack-org/dependabot/go_modules/go.unistack.org/micro/v3-3.10.16
Bump go.unistack.org/micro/v3 from 3.10.14 to 3.10.16
2023-03-14 21:02:09 +03:00
dependabot[bot]
0486780f36
Bump go.unistack.org/micro/v3 from 3.10.14 to 3.10.16
Bumps go.unistack.org/micro/v3 from 3.10.14 to 3.10.16.

---
updated-dependencies:
- dependency-name: go.unistack.org/micro/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-14 17:58:45 +00:00
36788b5fbf
Merge pull request #127 from unistack-org/dependabot/go_modules/go.unistack.org/micro/v3-3.10.14
Bump go.unistack.org/micro/v3 from 3.10.13 to 3.10.14
2023-02-27 21:05:25 +03:00
dependabot[bot]
c79b83a3c1
Bump go.unistack.org/micro/v3 from 3.10.13 to 3.10.14
Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.10.13 to 3.10.14.
- [Release notes](https://github.com/unistack-org/micro/releases)
- [Commits](https://github.com/unistack-org/micro/compare/v3.10.13...v3.10.14)

---
updated-dependencies:
- dependency-name: go.unistack.org/micro/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-27 18:02:45 +00:00
a6585fd6d4
Merge pull request #126 from unistack-org/dependabot/go_modules/go.unistack.org/micro/v3-3.10.13
Bump go.unistack.org/micro/v3 from 3.10.12 to 3.10.13
2023-02-22 20:18:46 +03:00
dependabot[bot]
7fce5ccad9
Bump go.unistack.org/micro/v3 from 3.10.12 to 3.10.13
Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.10.12 to 3.10.13.
- [Release notes](https://github.com/unistack-org/micro/releases)
- [Commits](https://github.com/unistack-org/micro/compare/v3.10.12...v3.10.13)

---
updated-dependencies:
- dependency-name: go.unistack.org/micro/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-22 17:15:33 +00:00
b5a5e98f9e
Merge pull request #125 from unistack-org/dependabot/go_modules/go.unistack.org/micro/v3-3.10.12
Bump go.unistack.org/micro/v3 from 3.10.11 to 3.10.12
2023-02-21 21:33:19 +03:00
dependabot[bot]
e419c6a67c
Bump go.unistack.org/micro/v3 from 3.10.11 to 3.10.12
Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.10.11 to 3.10.12.
- [Release notes](https://github.com/unistack-org/micro/releases)
- [Commits](https://github.com/unistack-org/micro/compare/v3.10.11...v3.10.12)

---
updated-dependencies:
- dependency-name: go.unistack.org/micro/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-21 18:30:27 +00:00
17c46e63a2
Merge pull request #124 from unistack-org/dependabot/go_modules/go.unistack.org/micro/v3-3.10.11
Bump go.unistack.org/micro/v3 from 3.10.10 to 3.10.11
2023-02-14 21:00:50 +03:00
dependabot[bot]
cdf1a2c3e3
Bump go.unistack.org/micro/v3 from 3.10.10 to 3.10.11
Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.10.10 to 3.10.11.
- [Release notes](https://github.com/unistack-org/micro/releases)
- [Commits](https://github.com/unistack-org/micro/compare/v3.10.10...v3.10.11)

---
updated-dependencies:
- dependency-name: go.unistack.org/micro/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-14 17:58:09 +00:00
aba3df63df
Merge pull request #123 from unistack-org/dependabot/go_modules/go.unistack.org/micro/v3-3.10.10
Bump go.unistack.org/micro/v3 from 3.10.9 to 3.10.10
2023-02-13 21:05:17 +03:00
dependabot[bot]
337df46029
Bump go.unistack.org/micro/v3 from 3.10.9 to 3.10.10
Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.10.9 to 3.10.10.
- [Release notes](https://github.com/unistack-org/micro/releases)
- [Commits](https://github.com/unistack-org/micro/compare/v3.10.9...v3.10.10)

---
updated-dependencies:
- dependency-name: go.unistack.org/micro/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-13 18:02:41 +00:00
bfe4839a00
Merge pull request #122 from unistack-org/dependabot/go_modules/go.unistack.org/micro/v3-3.10.9
Bump go.unistack.org/micro/v3 from 3.10.8 to 3.10.9
2023-02-08 20:06:46 +03:00
dependabot[bot]
5474c37f8f
Bump go.unistack.org/micro/v3 from 3.10.8 to 3.10.9
Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.10.8 to 3.10.9.
- [Release notes](https://github.com/unistack-org/micro/releases)
- [Commits](https://github.com/unistack-org/micro/compare/v3.10.8...v3.10.9)

---
updated-dependencies:
- dependency-name: go.unistack.org/micro/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-08 17:04:04 +00:00
ba88a5568a
Merge pull request #120 from unistack-org/dependabot/go_modules/go.unistack.org/micro/v3-3.10.8
Bump go.unistack.org/micro/v3 from 3.10.6 to 3.10.8
2023-02-07 20:05:21 +03:00
dependabot[bot]
57f903a8c2
Bump go.unistack.org/micro/v3 from 3.10.6 to 3.10.8
Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.10.6 to 3.10.8.
- [Release notes](https://github.com/unistack-org/micro/releases)
- [Commits](https://github.com/unistack-org/micro/compare/v3.10.6...v3.10.8)

---
updated-dependencies:
- dependency-name: go.unistack.org/micro/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-07 17:02:24 +00:00
9f918bd3f2
Merge pull request #119 from unistack-org/dependabot/go_modules/go.unistack.org/micro/v3-3.10.6
Bump go.unistack.org/micro/v3 from 3.10.5 to 3.10.6
2023-02-06 20:06:51 +03:00
dependabot[bot]
0d88050daf
Bump go.unistack.org/micro/v3 from 3.10.5 to 3.10.6
Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.10.5 to 3.10.6.
- [Release notes](https://github.com/unistack-org/micro/releases)
- [Commits](https://github.com/unistack-org/micro/compare/v3.10.5...v3.10.6)

---
updated-dependencies:
- dependency-name: go.unistack.org/micro/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-06 17:03:59 +00:00
dependabot[bot]
d1ed5bed51
Bump google.golang.org/grpc from 1.51.0 to 1.52.3 (#117)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.51.0 to 1.52.3.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.51.0...v1.52.3)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-31 06:44:12 +03:00
dependabot[bot]
42697318b1
Bump dependabot/fetch-metadata from 1.3.5 to 1.3.6 (#115)
Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 1.3.5 to 1.3.6.
- [Release notes](https://github.com/dependabot/fetch-metadata/releases)
- [Commits](https://github.com/dependabot/fetch-metadata/compare/v1.3.5...v1.3.6)

---
updated-dependencies:
- dependency-name: dependabot/fetch-metadata
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-30 21:21:42 +03:00
28aea45725
Merge pull request #118 from unistack-org/dependabot/go_modules/go.unistack.org/micro/v3-3.10.5
Bump go.unistack.org/micro/v3 from 3.10.4 to 3.10.5
2023-01-30 20:08:27 +03:00
dependabot[bot]
ed72c05645
Bump go.unistack.org/micro/v3 from 3.10.4 to 3.10.5
Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.10.4 to 3.10.5.
- [Release notes](https://github.com/unistack-org/micro/releases)
- [Commits](https://github.com/unistack-org/micro/compare/v3.10.4...v3.10.5)

---
updated-dependencies:
- dependency-name: go.unistack.org/micro/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-30 17:06:16 +00:00
dependabot[bot]
d239dcde63
Bump golangci/golangci-lint-action from 3.3.1 to 3.4.0 (#114)
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 3.3.1 to 3.4.0.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](https://github.com/golangci/golangci-lint-action/compare/v3.3.1...v3.4.0)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-24 10:13:05 +03:00
6eb07dc351
Merge pull request #113 from unistack-org/dependabot/go_modules/go.unistack.org/micro/v3-3.10.4
Bump go.unistack.org/micro/v3 from 3.10.1 to 3.10.4
2023-01-18 20:06:01 +03:00
dependabot[bot]
a0d704f845
Bump go.unistack.org/micro/v3 from 3.10.1 to 3.10.4
Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.10.1 to 3.10.4.
- [Release notes](https://github.com/unistack-org/micro/releases)
- [Commits](https://github.com/unistack-org/micro/compare/v3.10.1...v3.10.4)

---
updated-dependencies:
- dependency-name: go.unistack.org/micro/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-18 17:03:22 +00:00
4b8a761f30
Merge pull request #112 from unistack-org/dependabot/go_modules/go.unistack.org/micro/v3-3.10.1
Bump go.unistack.org/micro/v3 from 3.10.0 to 3.10.1
2023-01-17 20:06:30 +03:00
dependabot[bot]
a2c711a1b5
Bump go.unistack.org/micro/v3 from 3.10.0 to 3.10.1
Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.10.0 to 3.10.1.
- [Release notes](https://github.com/unistack-org/micro/releases)
- [Commits](https://github.com/unistack-org/micro/compare/v3.10.0...v3.10.1)

---
updated-dependencies:
- dependency-name: go.unistack.org/micro/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-17 17:03:58 +00:00
be564f50aa
Merge pull request #110 from unistack-org/dependabot/go_modules/go.unistack.org/micro/v3-3.10.0
Bump go.unistack.org/micro/v3 from 3.9.18 to 3.10.0
2023-01-09 20:08:38 +03:00
dependabot[bot]
b7b1eff81c
Bump go.unistack.org/micro/v3 from 3.9.18 to 3.10.0
Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.9.18 to 3.10.0.
- [Release notes](https://github.com/unistack-org/micro/releases)
- [Commits](https://github.com/unistack-org/micro/compare/v3.9.18...v3.10.0)

---
updated-dependencies:
- dependency-name: go.unistack.org/micro/v3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-09 17:06:42 +00:00
671a6b6f7c
Merge pull request #109 from unistack-org/content-type
use default google grpc content-type
2023-01-07 23:29:28 +03:00
27c1c4d86b use default google grpc content-type
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2023-01-07 23:27:04 +03:00
76d37a99eb
Merge pull request #108 from unistack-org/dependabot/go_modules/go.unistack.org/micro/v3-3.9.18
Bump go.unistack.org/micro/v3 from 3.9.17 to 3.9.18
2022-12-28 20:06:04 +03:00
dependabot[bot]
4c2827172f
Bump go.unistack.org/micro/v3 from 3.9.17 to 3.9.18
Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.9.17 to 3.9.18.
- [Release notes](https://github.com/unistack-org/micro/releases)
- [Commits](https://github.com/unistack-org/micro/compare/v3.9.17...v3.9.18)

---
updated-dependencies:
- dependency-name: go.unistack.org/micro/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-28 17:03:31 +00:00
e3461dd23f
Merge pull request #107 from unistack-org/dependabot/go_modules/go.unistack.org/micro/v3-3.9.17
Bump go.unistack.org/micro/v3 from 3.9.15 to 3.9.17
2022-12-26 20:08:43 +03:00
dependabot[bot]
d8b5c011e5
Bump go.unistack.org/micro/v3 from 3.9.15 to 3.9.17
Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.9.15 to 3.9.17.
- [Release notes](https://github.com/unistack-org/micro/releases)
- [Commits](https://github.com/unistack-org/micro/compare/v3.9.15...v3.9.17)

---
updated-dependencies:
- dependency-name: go.unistack.org/micro/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-26 17:06:46 +00:00
dependabot[bot]
15abd38afd
Bump google.golang.org/grpc from 1.50.1 to 1.51.0 (#105)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.50.1 to 1.51.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.50.1...v1.51.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-28 22:17:27 +03:00
5865a0f388
Merge pull request #106 from unistack-org/dependabot/go_modules/go.unistack.org/micro/v3-3.9.15
Bump go.unistack.org/micro/v3 from 3.9.13 to 3.9.15
2022-11-28 20:08:39 +03:00
dependabot[bot]
67da8d1165
Bump go.unistack.org/micro/v3 from 3.9.13 to 3.9.15
Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.9.13 to 3.9.15.
- [Release notes](https://github.com/unistack-org/micro/releases)
- [Commits](https://github.com/unistack-org/micro/compare/v3.9.13...v3.9.15)

---
updated-dependencies:
- dependency-name: go.unistack.org/micro/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-28 17:06:05 +00:00
dependabot[bot]
c7d24caa03
Bump hmarr/auto-approve-action from 2 to 3 (#104)
Bumps [hmarr/auto-approve-action](https://github.com/hmarr/auto-approve-action) from 2 to 3.
- [Release notes](https://github.com/hmarr/auto-approve-action/releases)
- [Commits](https://github.com/hmarr/auto-approve-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: hmarr/auto-approve-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-28 16:27:01 +03:00
8c222c4715
Merge pull request #103 from unistack-org/ctx_dialer
add context dialer option
2022-11-17 00:03:03 +03:00
6e91cd5cf5 add context dialer option
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2022-11-17 00:00:50 +03:00
a9e673b2ef
Merge pull request #102 from unistack-org/ctx_dialer
WIP: add context dialer option
2022-11-17 00:00:38 +03:00
251f06cc31 add context dialer option
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2022-11-16 23:58:24 +03:00
e97e4580a1
Merge pull request #101 from unistack-org/metadata
support response metadata
2022-11-16 23:12:44 +03:00
bd7dbe94ca support response metadata
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2022-11-16 23:10:27 +03:00
dependabot[bot]
0f32fad4c0
Bump dependabot/fetch-metadata from 1.3.4 to 1.3.5 (#98)
Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 1.3.4 to 1.3.5.
- [Release notes](https://github.com/dependabot/fetch-metadata/releases)
- [Commits](https://github.com/dependabot/fetch-metadata/compare/v1.3.4...v1.3.5)

---
updated-dependencies:
- dependency-name: dependabot/fetch-metadata
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-14 07:04:39 +03:00
dependabot[bot]
858111106e
Bump golangci/golangci-lint-action from 3.2.0 to 3.3.1 (#99)
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 3.2.0 to 3.3.1.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](https://github.com/golangci/golangci-lint-action/compare/v3.2.0...v3.3.1)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-12 18:19:47 +03:00
dependabot[bot]
dc35dc6d3e
Bump google.golang.org/grpc from 1.49.0 to 1.50.1 (#96)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.49.0 to 1.50.1.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.49.0...v1.50.1)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-19 22:50:42 +03:00
dependabot[bot]
24b1abfb9a
Bump dependabot/fetch-metadata from 1.3.3 to 1.3.4 (#94)
Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 1.3.3 to 1.3.4.
- [Release notes](https://github.com/dependabot/fetch-metadata/releases)
- [Commits](https://github.com/dependabot/fetch-metadata/compare/v1.3.3...v1.3.4)

---
updated-dependencies:
- dependency-name: dependabot/fetch-metadata
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-04 12:50:07 +03:00
dependabot[bot]
205fd53047
Bump dependabot/fetch-metadata from 1.3.1 to 1.3.3 (#90)
Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 1.3.1 to 1.3.3.
- [Release notes](https://github.com/dependabot/fetch-metadata/releases)
- [Commits](https://github.com/dependabot/fetch-metadata/compare/v1.3.1...v1.3.3)

---
updated-dependencies:
- dependency-name: dependabot/fetch-metadata
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-28 17:48:02 +03:00
dependabot[bot]
b3b7d1af13
Bump google.golang.org/grpc from 1.47.0 to 1.49.0 (#93)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.47.0 to 1.49.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.47.0...v1.49.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-28 17:22:57 +03:00
80e2184bba
Merge pull request #91 from unistack-org/dependabot/go_modules/go.unistack.org/micro/v3-3.9.11
Bump go.unistack.org/micro/v3 from 3.9.10 to 3.9.11
2022-07-11 20:26:27 +03:00
dependabot[bot]
a920d15d95
Bump go.unistack.org/micro/v3 from 3.9.10 to 3.9.11
Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.9.10 to 3.9.11.
- [Release notes](https://github.com/unistack-org/micro/releases)
- [Commits](https://github.com/unistack-org/micro/compare/v3.9.10...v3.9.11)

---
updated-dependencies:
- dependency-name: go.unistack.org/micro/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-11 17:24:25 +00:00
5ecbfac164
Merge pull request #88 from unistack-org/dependabot/go_modules/go.unistack.org/micro/v3-3.9.10
Bump go.unistack.org/micro/v3 from 3.9.8 to 3.9.10
2022-06-27 20:34:59 +03:00
dependabot[bot]
61d7a322de
Bump go.unistack.org/micro/v3 from 3.9.8 to 3.9.10
Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.9.8 to 3.9.10.
- [Release notes](https://github.com/unistack-org/micro/releases)
- [Commits](https://github.com/unistack-org/micro/compare/v3.9.8...v3.9.10)

---
updated-dependencies:
- dependency-name: go.unistack.org/micro/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-27 17:32:18 +00:00
dependabot[bot]
b43c207f6a
Bump google.golang.org/grpc from 1.46.0 to 1.47.0 (#87)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.46.0 to 1.47.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.46.0...v1.47.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-25 23:12:03 +03:00
dependabot[bot]
d243b884c7
Bump golangci/golangci-lint-action from 3.1.0 to 3.2.0 (#85)
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 3.1.0 to 3.2.0.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](https://github.com/golangci/golangci-lint-action/compare/v3.1.0...v3.2.0)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-25 22:50:10 +03:00
107b470b9a
Merge pull request #84 from unistack-org/dependabot/go_modules/go.unistack.org/micro/v3-3.9.8
Bump go.unistack.org/micro/v3 from 3.9.7 to 3.9.8
2022-05-03 20:24:42 +03:00
dependabot[bot]
878bac53ac
Bump go.unistack.org/micro/v3 from 3.9.7 to 3.9.8
Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.9.7 to 3.9.8.
- [Release notes](https://github.com/unistack-org/micro/releases)
- [Commits](https://github.com/unistack-org/micro/compare/v3.9.7...v3.9.8)

---
updated-dependencies:
- dependency-name: go.unistack.org/micro/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-03 17:22:50 +00:00
e28c584056
Merge pull request #83 from unistack-org/backoff
use backoff for lookup too
2022-05-01 23:25:23 +03:00
b8dc821784 use backoff for lookup too
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2022-05-01 23:23:15 +03:00
dependabot[bot]
907d2591df
Bump github/codeql-action from 1 to 2 (#81)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 1 to 2.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-26 20:45:42 +00:00
dependabot[bot]
8cc656eec7
Bump google.golang.org/grpc from 1.45.0 to 1.46.0 (#82)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.45.0 to 1.46.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.45.0...v1.46.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-26 23:42:03 +03:00
dependabot[bot]
5792434604
Bump dependabot/fetch-metadata from 1.3.0 to 1.3.1 (#80)
Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 1.3.0 to 1.3.1.
- [Release notes](https://github.com/dependabot/fetch-metadata/releases)
- [Commits](https://github.com/dependabot/fetch-metadata/compare/v1.3.0...v1.3.1)

---
updated-dependencies:
- dependency-name: dependabot/fetch-metadata
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-21 23:49:33 +03:00
402ccee5b9
Merge pull request #79 from unistack-org/dependabot/github_actions/actions/setup-go-3
Bump actions/setup-go from 2 to 3
2022-04-11 22:55:48 +03:00
dependabot[bot]
90986a26e2
Bump actions/setup-go from 2 to 3
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 2 to 3.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-08 17:17:22 +00:00
6d41afd5a0
Merge pull request #78 from unistack-org/feature2
handle more error cases
2022-04-05 15:16:06 +03:00
2e645748bb handle more error cases
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2022-04-05 15:13:58 +03:00
f6b1c8d745
Merge pull request #77 from unistack-org/feature
test error transfering from grpc server
2022-04-05 12:38:21 +03:00
ea503d0583 test error transfering from grpc server
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2022-04-05 12:36:14 +03:00
048773c669
Merge pull request #76 from unistack-org/dependabot/go_modules/go.unistack.org/micro/v3-3.9.7
Bump go.unistack.org/micro/v3 from 3.9.5 to 3.9.7
2022-03-30 20:21:14 +03:00
dependabot[bot]
e3cb87ffe3
Bump go.unistack.org/micro/v3 from 3.9.5 to 3.9.7
Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.9.5 to 3.9.7.
- [Release notes](https://github.com/unistack-org/micro/releases)
- [Commits](https://github.com/unistack-org/micro/compare/v3.9.5...v3.9.7)

---
updated-dependencies:
- dependency-name: go.unistack.org/micro/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-30 17:19:10 +00:00
b1af43c4b0
Merge pull request #75 from unistack-org/dependabot/go_modules/go.unistack.org/micro/v3-3.9.5
Bump go.unistack.org/micro/v3 from 3.9.2 to 3.9.5
2022-03-28 20:24:54 +03:00
dependabot[bot]
f994df9e04
Bump go.unistack.org/micro/v3 from 3.9.2 to 3.9.5
Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.9.2 to 3.9.5.
- [Release notes](https://github.com/unistack-org/micro/releases)
- [Commits](https://github.com/unistack-org/micro/compare/v3.9.2...v3.9.5)

---
updated-dependencies:
- dependency-name: go.unistack.org/micro/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-28 17:22:57 +00:00
c556f7157f
Merge pull request #74 from unistack-org/dependabot/go_modules/go.unistack.org/micro/v3-3.9.2
Bump go.unistack.org/micro/v3 from 3.9.1 to 3.9.2
2022-03-25 20:22:33 +03:00
dependabot[bot]
17be582d19
Bump go.unistack.org/micro/v3 from 3.9.1 to 3.9.2
Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.9.1 to 3.9.2.
- [Release notes](https://github.com/unistack-org/micro/releases)
- [Commits](https://github.com/unistack-org/micro/compare/v3.9.1...v3.9.2)

---
updated-dependencies:
- dependency-name: go.unistack.org/micro/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-25 17:20:19 +00:00
131a150d3d
Merge pull request #71 from unistack-org/dependabot/github_actions/actions/cache-3
Bump actions/cache from 2 to 3
2022-03-22 23:08:05 +03:00
dependabot[bot]
7f874a286e
Bump actions/cache from 2 to 3
Bumps [actions/cache](https://github.com/actions/cache) from 2 to 3.
- [Release notes](https://github.com/actions/cache/releases)
- [Commits](https://github.com/actions/cache/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-22 17:41:45 +00:00
2f40797303
Merge pull request #73 from unistack-org/dependabot/go_modules/go.unistack.org/micro/v3-3.9.1
Bump go.unistack.org/micro/v3 from 3.9.0 to 3.9.1
2022-03-22 20:40:55 +03:00
dependabot[bot]
3e1b2b7c5d
Bump go.unistack.org/micro/v3 from 3.9.0 to 3.9.1
Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.9.0 to 3.9.1.
- [Release notes](https://github.com/unistack-org/micro/releases)
- [Commits](https://github.com/unistack-org/micro/compare/v3.9.0...v3.9.1)

---
updated-dependencies:
- dependency-name: go.unistack.org/micro/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-22 17:20:00 +00:00
6442f4c474
Merge pull request #72 from unistack-org/dependabot/go_modules/go.unistack.org/micro/v3-3.9.0
Bump go.unistack.org/micro/v3 from 3.8.21 to 3.9.0
2022-03-21 20:30:57 +03:00
dependabot[bot]
1dda7e6b83
Bump go.unistack.org/micro/v3 from 3.8.21 to 3.9.0
Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.8.21 to 3.9.0.
- [Release notes](https://github.com/unistack-org/micro/releases)
- [Commits](https://github.com/unistack-org/micro/compare/v3.8.21...v3.9.0)

---
updated-dependencies:
- dependency-name: go.unistack.org/micro/v3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-21 17:28:50 +00:00
2b85cabe1f
Merge pull request #70 from unistack-org/headers
pass timeout headers in proper format
2022-03-21 14:14:08 +03:00
02895dd712
Merge branch 'v3' into headers 2022-03-21 14:11:41 +03:00
42b93ce57e pass timeout headers in proper format
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2022-03-21 14:09:08 +03:00
763c299ab7
Merge pull request #68 from unistack-org/dependabot/go_modules/google.golang.org/grpc-1.45.0
Bump google.golang.org/grpc from 1.44.0 to 1.45.0
2022-03-12 13:06:44 +03:00
dependabot[bot]
937a6d62b2
Bump google.golang.org/grpc from 1.44.0 to 1.45.0
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.44.0 to 1.45.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.44.0...v1.45.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-10 17:18:35 +00:00
fb6e2c8845 Merge branch 'master' into v3 2022-03-10 12:29:52 +03:00
3e9a3a917d update go version
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2022-03-07 13:45:02 +03:00
289a765784
Merge pull request #67 from unistack-org/dependabot/go_modules/go.unistack.org/micro/v3-3.8.21
Bump go.unistack.org/micro/v3 from 3.8.14 to 3.8.21
2022-03-07 13:35:46 +03:00
b13ad231d1
Merge branch 'v3' into dependabot/go_modules/go.unistack.org/micro/v3-3.8.21 2022-03-07 13:32:30 +03:00
0793e84da6
Merge pull request #66 from unistack-org/dependabot/go_modules/google.golang.org/grpc-1.44.0
Bump google.golang.org/grpc from 1.43.0 to 1.44.0
2022-03-07 13:31:49 +03:00
dependabot[bot]
f2c6d7cc80
Bump go.unistack.org/micro/v3 from 3.8.14 to 3.8.21
Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.8.14 to 3.8.21.
- [Release notes](https://github.com/unistack-org/micro/releases)
- [Commits](https://github.com/unistack-org/micro/compare/v3.8.14...v3.8.21)

---
updated-dependencies:
- dependency-name: go.unistack.org/micro/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-07 10:29:11 +00:00
6969b228a7
Merge branch 'v3' into dependabot/go_modules/google.golang.org/grpc-1.44.0 2022-03-07 13:26:12 +03:00
84362e6dd9
Merge pull request #65 from unistack-org/dependabot/github_actions/golangci/golangci-lint-action-3.1.0
Bump golangci/golangci-lint-action from 2 to 3.1.0
2022-03-07 13:26:00 +03:00
dependabot[bot]
b83cc26ca0
Bump google.golang.org/grpc from 1.43.0 to 1.44.0
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.43.0 to 1.44.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.43.0...v1.44.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-07 09:44:35 +00:00
dependabot[bot]
6591845ded
Bump golangci/golangci-lint-action from 2 to 3.1.0
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 2 to 3.1.0.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](https://github.com/golangci/golangci-lint-action/compare/v2...v3.1.0)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-07 09:44:26 +00:00
7c7c93521f update workflows
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2022-03-05 19:14:01 +03:00
9e10237b97
Merge pull request #62 from unistack-org/dependabot/github_actions/golangci/golangci-lint-action-3.1.0
Bump golangci/golangci-lint-action from 2 to 3.1.0
2022-03-01 00:37:31 +03:00
dependabot[bot]
856c7dae7c
Bump golangci/golangci-lint-action from 2 to 3.1.0
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 2 to 3.1.0.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](https://github.com/golangci/golangci-lint-action/compare/v2...v3.1.0)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-28 17:25:49 +00:00
e85f2e1f45
Merge pull request #57 from unistack-org/dependabot/go_modules/google.golang.org/grpc-1.44.0
Bump google.golang.org/grpc from 1.43.0 to 1.44.0
2022-02-25 09:58:22 +03:00
dependabot[bot]
0a8ccce4e1
Bump google.golang.org/grpc from 1.43.0 to 1.44.0
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.43.0 to 1.44.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.43.0...v1.44.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-25 06:45:21 +00:00
1b7e22442f
Merge pull request #60 from unistack-org/dependabot/github_actions/dependabot/fetch-metadata-1.2.1
Bump dependabot/fetch-metadata from 1.1.1 to 1.2.1
2022-02-25 09:44:38 +03:00
dependabot[bot]
4c81ce6a9d
Bump dependabot/fetch-metadata from 1.1.1 to 1.2.1
Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 1.1.1 to 1.2.1.
- [Release notes](https://github.com/dependabot/fetch-metadata/releases)
- [Commits](https://github.com/dependabot/fetch-metadata/compare/v1.1.1...v1.2.1)

---
updated-dependencies:
- dependency-name: dependabot/fetch-metadata
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-23 17:18:30 +00:00
89ffe47d06
Merge pull request #58 from unistack-org/dependabot/go_modules/go.unistack.org/micro/v3-3.8.21
Bump go.unistack.org/micro/v3 from 3.8.20 to 3.8.21
2022-01-31 20:24:50 +03:00
dependabot[bot]
a03274011f
Bump go.unistack.org/micro/v3 from 3.8.20 to 3.8.21
Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.8.20 to 3.8.21.
- [Release notes](https://github.com/unistack-org/micro/releases)
- [Commits](https://github.com/unistack-org/micro/compare/v3.8.20...v3.8.21)

---
updated-dependencies:
- dependency-name: go.unistack.org/micro/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-31 17:22:26 +00:00
186ec6bf00
Merge pull request #56 from unistack-org/dependabot/go_modules/go.unistack.org/micro/v3-3.8.20
Bump go.unistack.org/micro/v3 from 3.8.19 to 3.8.20
2022-01-26 20:18:42 +03:00
dependabot[bot]
fefcc273d9
Bump go.unistack.org/micro/v3 from 3.8.19 to 3.8.20
Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.8.19 to 3.8.20.
- [Release notes](https://github.com/unistack-org/micro/releases)
- [Commits](https://github.com/unistack-org/micro/compare/v3.8.19...v3.8.20)

---
updated-dependencies:
- dependency-name: go.unistack.org/micro/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-26 17:16:35 +00:00
a5ca5ec499
Merge pull request #55 from unistack-org/dependabot/go_modules/go.unistack.org/micro/v3-3.8.19
Bump go.unistack.org/micro/v3 from 3.8.18 to 3.8.19
2022-01-25 20:21:24 +03:00
dependabot[bot]
7104528c7d
Bump go.unistack.org/micro/v3 from 3.8.18 to 3.8.19
Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.8.18 to 3.8.19.
- [Release notes](https://github.com/unistack-org/micro/releases)
- [Commits](https://github.com/unistack-org/micro/compare/v3.8.18...v3.8.19)

---
updated-dependencies:
- dependency-name: go.unistack.org/micro/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-25 17:19:20 +00:00
eaa61e254e
Merge pull request #54 from unistack-org/dependabot/go_modules/go.unistack.org/micro/v3-3.8.18
Bump go.unistack.org/micro/v3 from 3.8.15 to 3.8.18
2022-01-21 20:22:00 +03:00
dependabot[bot]
00aa5331f6
Bump go.unistack.org/micro/v3 from 3.8.15 to 3.8.18
Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.8.15 to 3.8.18.
- [Release notes](https://github.com/unistack-org/micro/releases)
- [Commits](https://github.com/unistack-org/micro/compare/v3.8.15...v3.8.18)

---
updated-dependencies:
- dependency-name: go.unistack.org/micro/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-21 17:19:25 +00:00
c165c0f1a8
Merge pull request #53 from unistack-org/dependabot/go_modules/go.unistack.org/micro/v3-3.8.15
Bump go.unistack.org/micro/v3 from 3.8.14 to 3.8.15
2022-01-19 20:22:16 +03:00
dependabot[bot]
fa6fe590bd
Bump go.unistack.org/micro/v3 from 3.8.14 to 3.8.15
Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.8.14 to 3.8.15.
- [Release notes](https://github.com/unistack-org/micro/releases)
- [Commits](https://github.com/unistack-org/micro/compare/v3.8.14...v3.8.15)

---
updated-dependencies:
- dependency-name: go.unistack.org/micro/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-19 17:20:13 +00:00
8cae060e05 Merge branch 'master' into v3 2022-01-12 17:41:42 +03:00
a10275ad1f update for latest micro
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2022-01-12 17:41:33 +03:00
dependabot[bot]
f247a8c906 Bump go.unistack.org/micro/v3 from 3.8.13 to 3.8.14
Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.8.13 to 3.8.14.
- [Release notes](https://github.com/unistack-org/micro/releases)
- [Commits](https://github.com/unistack-org/micro/compare/v3.8.13...v3.8.14)

---
updated-dependencies:
- dependency-name: go.unistack.org/micro/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-12 17:41:33 +03:00
dependabot[bot]
015b2a4b05 Bump google.golang.org/grpc from 1.42.0 to 1.43.0
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.42.0 to 1.43.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.42.0...v1.43.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-12 17:41:33 +03:00
dependabot[bot]
c9da9d36a0 Bump go.unistack.org/micro/v3 from 3.8.12 to 3.8.13
Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.8.12 to 3.8.13.
- [Release notes](https://github.com/unistack-org/micro/releases)
- [Commits](https://github.com/unistack-org/micro/compare/v3.8.12...v3.8.13)

---
updated-dependencies:
- dependency-name: go.unistack.org/micro/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-12 17:41:33 +03:00
1f69062916 update for latest micro
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2022-01-12 17:40:58 +03:00
c4ca900a56
Merge pull request #52 from unistack-org/dependabot/go_modules/go.unistack.org/micro/v3-3.8.14
Bump go.unistack.org/micro/v3 from 3.8.13 to 3.8.14
2022-01-10 20:23:42 +03:00
dependabot[bot]
569d95e3e3
Bump go.unistack.org/micro/v3 from 3.8.13 to 3.8.14
Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.8.13 to 3.8.14.
- [Release notes](https://github.com/unistack-org/micro/releases)
- [Commits](https://github.com/unistack-org/micro/compare/v3.8.13...v3.8.14)

---
updated-dependencies:
- dependency-name: go.unistack.org/micro/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-10 17:21:29 +00:00
d2f1b7b3b9
Merge pull request #49 from unistack-org/dependabot/go_modules/google.golang.org/grpc-1.43.0
Bump google.golang.org/grpc from 1.42.0 to 1.43.0
2021-12-29 01:30:59 +03:00
dependabot[bot]
65c10f7b0a
Bump google.golang.org/grpc from 1.42.0 to 1.43.0
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.42.0 to 1.43.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.42.0...v1.43.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-28 17:23:25 +00:00
76537a045a
Merge pull request #51 from unistack-org/dependabot/go_modules/go.unistack.org/micro/v3-3.8.13
Bump go.unistack.org/micro/v3 from 3.8.12 to 3.8.13
2021-12-28 20:18:28 +03:00
dependabot[bot]
7f19288476
Bump go.unistack.org/micro/v3 from 3.8.12 to 3.8.13
Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.8.12 to 3.8.13.
- [Release notes](https://github.com/unistack-org/micro/releases)
- [Commits](https://github.com/unistack-org/micro/compare/v3.8.12...v3.8.13)

---
updated-dependencies:
- dependency-name: go.unistack.org/micro/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-28 17:16:37 +00:00
c3d10b669b
Merge pull request #50 from unistack-org/master
merge master
2021-12-16 15:35:28 +03:00
20c5840f47 fix for latest micro
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2021-12-16 15:34:28 +03:00
8b2dd91711
Merge pull request #48 from unistack-org/dependabot/go_modules/go.unistack.org/micro/v3-3.8.11
Bump go.unistack.org/micro/v3 from 3.8.10 to 3.8.11
2021-11-24 20:27:43 +03:00
dependabot[bot]
08621f7cf3
Bump go.unistack.org/micro/v3 from 3.8.10 to 3.8.11
Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.8.10 to 3.8.11.
- [Release notes](https://github.com/unistack-org/micro/releases)
- [Commits](https://github.com/unistack-org/micro/compare/v3.8.10...v3.8.11)

---
updated-dependencies:
- dependency-name: go.unistack.org/micro/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-24 17:25:38 +00:00
dependabot[bot]
8d7d802730
Bump google.golang.org/grpc from 1.41.0 to 1.42.0 (#45)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.41.0 to 1.42.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.41.0...v1.42.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-24 14:49:16 +03:00
137fbae58e
Merge pull request #47 from unistack-org/dependabot/go_modules/go.unistack.org/micro/v3-3.8.10
Bump go.unistack.org/micro/v3 from 3.8.9 to 3.8.10
2021-11-19 20:25:29 +03:00
dependabot[bot]
13093dd404
Bump go.unistack.org/micro/v3 from 3.8.9 to 3.8.10
Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.8.9 to 3.8.10.
- [Release notes](https://github.com/unistack-org/micro/releases)
- [Commits](https://github.com/unistack-org/micro/compare/v3.8.9...v3.8.10)

---
updated-dependencies:
- dependency-name: go.unistack.org/micro/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-19 17:23:22 +00:00
12cf576b9c
Merge pull request #46 from unistack-org/dependabot/go_modules/go.unistack.org/micro/v3-3.8.9
Bump go.unistack.org/micro/v3 from 3.8.7 to 3.8.9
2021-11-18 20:22:33 +03:00
dependabot[bot]
b91014d287
Bump go.unistack.org/micro/v3 from 3.8.7 to 3.8.9
Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.8.7 to 3.8.9.
- [Release notes](https://github.com/unistack-org/micro/releases)
- [Commits](https://github.com/unistack-org/micro/compare/v3.8.7...v3.8.9)

---
updated-dependencies:
- dependency-name: go.unistack.org/micro/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-18 17:20:21 +00:00
6b867760e5
Merge pull request #44 from unistack-org/dependabot/go_modules/go.unistack.org/micro/v3-3.8.7
Bump go.unistack.org/micro/v3 from 3.8.5 to 3.8.7
2021-10-27 23:34:16 +03:00
dependabot[bot]
f61f056a8e
Bump go.unistack.org/micro/v3 from 3.8.5 to 3.8.7
Bumps [go.unistack.org/micro/v3](https://github.com/unistack-org/micro) from 3.8.5 to 3.8.7.
- [Release notes](https://github.com/unistack-org/micro/releases)
- [Commits](https://github.com/unistack-org/micro/compare/v3.8.5...v3.8.7)

---
updated-dependencies:
- dependency-name: go.unistack.org/micro/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-27 20:19:34 +00:00
0525dae1cd update workflows
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2021-10-27 23:16:15 +03:00
dependabot[bot]
50d0d836e5
Bump google.golang.org/grpc from 1.40.0 to 1.41.0 (#40)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.40.0 to 1.41.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.40.0...v1.41.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-27 18:31:21 +03:00
a1e7560d6f update import paths
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2021-10-27 00:57:12 +03:00
a510f982e2 update for latest micro
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2021-10-01 01:34:16 +03:00
1129a1e992 remove stale code
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2021-09-27 09:14:05 +03:00
dependabot[bot]
033fcd3e2b
Bump actions/github-script from 4 to 5 (#39)
Bumps [actions/github-script](https://github.com/actions/github-script) from 4 to 5.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2021-09-27 09:09:51 +03:00
c2ef582962 update for latest micro
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2021-09-27 09:06:52 +03:00
4c9f1f21a9 update workflow
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2021-09-21 21:46:40 +03:00
dependabot[bot]
4585b73513
Bump google.golang.org/grpc from 1.39.0 to 1.40.0 (#35)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.39.0 to 1.40.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.39.0...v1.40.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2021-09-17 15:58:20 +03:00
dependabot[bot]
728d3f2a8c
Bump github.com/unistack-org/micro/v3 from 3.7.0 to 3.7.1 (#37)
Bumps [github.com/unistack-org/micro/v3](https://github.com/unistack-org/micro) from 3.7.0 to 3.7.1.
- [Release notes](https://github.com/unistack-org/micro/releases)
- [Commits](https://github.com/unistack-org/micro/compare/v3.7.0...v3.7.1)

---
updated-dependencies:
- dependency-name: github.com/unistack-org/micro/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-17 08:34:26 +03:00
c1a2cfae67 update workflows
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2021-09-17 07:47:45 +03:00
8edc3d35bb enable automerge
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2021-09-16 11:03:05 +03:00
dependabot[bot]
4d0bb35dd9
Bump github.com/unistack-org/micro/v3 from 3.5.6 to 3.7.0 (#36) 2021-09-06 11:05:26 +00:00
0539d08195 replace renovate with dependabot
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2021-09-06 10:28:28 +03:00
f40591a520
Create codeql-analysis.yml 2021-09-02 11:51:09 +03:00
acfab7e10c update for latest micro
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2021-07-31 15:10:59 +03:00
6697ccddf2 use metadata header names
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2021-07-23 12:30:21 +03:00
d536140a5b allow to publish body only
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2021-06-13 12:37:01 +03:00
db02559a00 limit send/recv msg size for streams too
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2021-06-05 16:24:29 +03:00
0fae2e1bdd move default content type to const
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2021-05-24 23:11:10 +03:00
Renovate Bot
7a1fdef33a Update module google.golang.org/grpc to v1.37.1 2021-05-11 23:44:05 +00:00
2bb81ff232 merge https://github.com/asim/go-micro/pull/2158
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2021-04-29 14:31:57 +03:00
Renovate Bot
9ac268b2f0 Update module github.com/unistack-org/micro/v3 to v3.3.17 2021-04-27 08:54:25 +00:00
510fa4b379
lint (#32)
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2021-04-26 19:17:29 +03:00
Renovate Bot
08def4d244 Update module github.com/unistack-org/micro/v3 to v3.3.16 2021-04-20 11:52:53 +00:00
a4683c0b78 drop AuthTLS option and use client TLSConfig option
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2021-04-20 12:21:40 +03:00
Renovate Bot
637e3df24a Update module github.com/unistack-org/micro/v3 to v3.3.15 2021-04-19 14:55:53 +00:00
Renovate Bot
36c7fa6a23 Update module github.com/unistack-org/micro/v3 to v3.3.14 2021-04-19 04:53:53 +00:00
2bef21a001 minor content-type fixes
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2021-04-16 17:07:12 +03:00
Renovate Bot
78c32dc3e8 Update module github.com/unistack-org/micro/v3 to v3.3.13 2021-04-10 01:39:46 +00:00
22 changed files with 1598 additions and 335 deletions

19
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,19 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
# Maintain dependencies for Golang
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "daily"

19
.github/renovate.json vendored
View File

@ -1,19 +0,0 @@
{
"extends": [
"config:base"
],
"packageRules": [
{
"matchUpdateTypes": ["minor", "patch", "pin", "digest"],
"automerge": true
},
{
"groupName": "all deps",
"separateMajorMinor": true,
"groupSlug": "all",
"packagePatterns": [
"*"
]
}
]
}

13
.github/stale.sh vendored
View File

@ -1,13 +0,0 @@
#!/bin/bash -ex
export PATH=$PATH:$(pwd)/bin
export GO111MODULE=on
export GOBIN=$(pwd)/bin
#go get github.com/rvflash/goup@v0.4.1
#goup -v ./...
#go get github.com/psampaz/go-mod-outdated@v0.6.0
go list -u -m -mod=mod -json all | go-mod-outdated -update -direct -ci || true
#go list -u -m -json all | go-mod-outdated -update

20
.github/workflows/autoapprove.yml vendored Normal file
View File

@ -0,0 +1,20 @@
name: "autoapprove"
on:
pull_request_target:
types: [assigned, opened, synchronize, reopened]
permissions:
pull-requests: write
contents: write
jobs:
autoapprove:
runs-on: ubuntu-latest
steps:
- name: approve
uses: hmarr/auto-approve-action@v3
if: github.actor == 'vtolstov' || github.actor == 'dependabot[bot]'
id: approve
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

21
.github/workflows/automerge.yml vendored Normal file
View File

@ -0,0 +1,21 @@
name: "automerge"
on:
pull_request_target:
types: [assigned, opened, synchronize, reopened]
permissions:
pull-requests: write
contents: write
jobs:
automerge:
runs-on: ubuntu-latest
if: github.actor == 'vtolstov'
steps:
- name: merge
id: merge
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.TOKEN}}

View File

@ -3,19 +3,20 @@ on:
push: push:
branches: branches:
- master - master
- v3
jobs: jobs:
test: test:
name: test name: test
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: setup - name: setup
uses: actions/setup-go@v2 uses: actions/setup-go@v3
with: with:
go-version: 1.16 go-version: 1.17
- name: checkout - name: checkout
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: cache - name: cache
uses: actions/cache@v2 uses: actions/cache@v3
with: with:
path: ~/go/pkg/mod path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
@ -31,9 +32,9 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: checkout - name: checkout
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: lint - name: lint
uses: golangci/golangci-lint-action@v2 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.

78
.github/workflows/codeql-analysis.yml vendored Normal file
View File

@ -0,0 +1,78 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "codeql"
on:
workflow_run:
workflows: ["prbuild"]
types:
- completed
push:
branches: [ master, v3 ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master, v3 ]
schedule:
- cron: '34 1 * * 0'
jobs:
analyze:
name: analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'go' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
steps:
- name: checkout
uses: actions/checkout@v3
- name: setup
uses: actions/setup-go@v3
with:
go-version: 1.17
# Initializes the CodeQL tools for scanning.
- name: init
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: autobuild
uses: github/codeql-action/autobuild@v2
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
#- run: |
# make bootstrap
# make release
- name: analyze
uses: github/codeql-action/analyze@v2

View File

@ -0,0 +1,27 @@
name: "dependabot-automerge"
on:
pull_request_target:
types: [assigned, opened, synchronize, reopened]
permissions:
pull-requests: write
contents: write
jobs:
automerge:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:
- name: metadata
id: metadata
uses: dependabot/fetch-metadata@v1.3.6
with:
github-token: "${{ secrets.TOKEN }}"
- name: merge
id: merge
if: ${{contains(steps.metadata.outputs.dependency-names, 'go.unistack.org')}}
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.TOKEN}}

View File

@ -3,19 +3,20 @@ on:
pull_request: pull_request:
branches: branches:
- master - master
- v3
jobs: jobs:
test: test:
name: test name: test
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: setup - name: setup
uses: actions/setup-go@v2 uses: actions/setup-go@v3
with: with:
go-version: 1.16 go-version: 1.17
- name: checkout - name: checkout
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: cache - name: cache
uses: actions/cache@v2 uses: actions/cache@v3
with: with:
path: ~/go/pkg/mod path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
@ -31,9 +32,9 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: checkout - name: checkout
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: lint - name: lint
uses: golangci/golangci-lint-action@v2 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.

24
.gitignore vendored Normal file
View File

@ -0,0 +1,24 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
bin
# Test binary, built with `go test -c`
*.test
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
# Dependency directories (remove the comment below to include it)
# vendor/
# Go workspace file
go.work
# General
.DS_Store
.idea
.vscode

44
.golangci.yml Normal file
View File

@ -0,0 +1,44 @@
run:
concurrency: 4
deadline: 5m
issues-exit-code: 1
tests: true
linters-settings:
govet:
check-shadowing: true
enable:
- fieldalignment
linters:
enable:
- govet
- deadcode
- errcheck
- govet
- ineffassign
- staticcheck
- structcheck
- typecheck
- unused
- varcheck
- bodyclose
- gci
- goconst
- gocritic
- gosimple
- gofmt
- gofumpt
- goimports
- golint
- gosec
- makezero
- misspell
- nakedret
- nestif
- nilerr
- noctx
- prealloc
- unconvert
- unparam
disable-all: false

View File

@ -3,11 +3,16 @@ package grpc
import ( import (
"io" "io"
"github.com/unistack-org/micro/v3/codec" "go.unistack.org/micro/v3/codec"
"google.golang.org/grpc" "google.golang.org/grpc"
"google.golang.org/grpc/encoding" "google.golang.org/grpc/encoding"
) )
var (
_ encoding.Codec = &wrapMicroCodec{}
_ codec.Codec = &wrapGrpcCodec{}
)
type wrapStream struct{ grpc.ClientStream } type wrapStream struct{ grpc.ClientStream }
func (w *wrapStream) Write(d []byte) (int, error) { func (w *wrapStream) Write(d []byte) (int, error) {
@ -19,7 +24,7 @@ func (w *wrapStream) Write(d []byte) (int, error) {
func (w *wrapStream) Read(d []byte) (int, error) { func (w *wrapStream) Read(d []byte) (int, error) {
m := &codec.Frame{} m := &codec.Frame{}
err := w.ClientStream.RecvMsg(m) err := w.ClientStream.RecvMsg(m)
d = m.Data copy(d, m.Data)
return len(d), err return len(d), err
} }
@ -29,26 +34,32 @@ func (w *wrapMicroCodec) Name() string {
return w.Codec.String() return w.Codec.String()
} }
func (w *wrapMicroCodec) Marshal(v interface{}) ([]byte, error) {
return w.Codec.Marshal(v)
}
func (w *wrapMicroCodec) Unmarshal(d []byte, v interface{}) error {
return w.Codec.Unmarshal(d, v)
}
type wrapGrpcCodec struct{ encoding.Codec } type wrapGrpcCodec struct{ encoding.Codec }
func (w *wrapGrpcCodec) String() string { func (w *wrapGrpcCodec) String() string {
return w.Codec.Name() return w.Codec.Name()
} }
func (w *wrapGrpcCodec) Marshal(v interface{}) ([]byte, error) { func (w *wrapGrpcCodec) Marshal(v interface{}, opts ...codec.Option) ([]byte, error) {
switch m := v.(type) { if m, ok := v.(*codec.Frame); ok {
case *codec.Frame:
return m.Data, nil return m.Data, nil
} }
return w.Codec.Marshal(v) return w.Codec.Marshal(v)
} }
func (w wrapGrpcCodec) Unmarshal(d []byte, v interface{}) error { func (w *wrapGrpcCodec) Unmarshal(d []byte, v interface{}, opts ...codec.Option) error {
if d == nil || v == nil { if d == nil || v == nil {
return nil return nil
} }
switch m := v.(type) { if m, ok := v.(*codec.Frame); ok {
case *codec.Frame:
m.Data = d m.Data = d
return nil return nil
} }
@ -69,7 +80,7 @@ type grpcCodec struct {
*/ */
func (g *wrapGrpcCodec) ReadHeader(conn io.Reader, m *codec.Message, mt codec.MessageType) error { func (w *wrapGrpcCodec) ReadHeader(conn io.Reader, m *codec.Message, mt codec.MessageType) error {
/* /*
if m == nil { if m == nil {
m = codec.NewMessage(codec.Request) m = codec.NewMessage(codec.Request)
@ -92,20 +103,19 @@ func (g *wrapGrpcCodec) ReadHeader(conn io.Reader, m *codec.Message, mt codec.Me
return nil return nil
} }
func (g *wrapGrpcCodec) ReadBody(conn io.Reader, v interface{}) error { func (w *wrapGrpcCodec) ReadBody(conn io.Reader, v interface{}) error {
// caller has requested a frame // caller has requested a frame
switch m := v.(type) { if m, ok := v.(*codec.Frame); ok {
case *codec.Frame:
_, err := conn.Read(m.Data) _, err := conn.Read(m.Data)
return err return err
} }
return codec.ErrInvalidMessage return codec.ErrInvalidMessage
} }
func (g *wrapGrpcCodec) Write(conn io.Writer, m *codec.Message, v interface{}) error { func (w *wrapGrpcCodec) Write(conn io.Writer, m *codec.Message, v interface{}) error {
// if we don't have a body // if we don't have a body
if v != nil { if v != nil {
b, err := g.Marshal(v) b, err := w.Marshal(v)
if err != nil { if err != nil {
return err return err
} }

View File

@ -1,7 +1,7 @@
package grpc package grpc
import ( import (
"github.com/unistack-org/micro/v3/errors" "go.unistack.org/micro/v3/errors"
"google.golang.org/grpc/status" "google.golang.org/grpc/status"
) )
@ -9,31 +9,46 @@ func microError(err error) error {
// no error // no error
if err == nil { if err == nil {
// nothing to do
return nil return nil
} }
if verr, ok := err.(*errors.Error); ok { if verr, ok := err.(*errors.Error); ok {
// micro error
return verr return verr
} }
// grpc error // grpc error
s, ok := status.FromError(err) s, ok := status.FromError(err)
if !ok { if !ok {
// can't get status detals from grpc error, return base error
return err return err
} }
// return first error from details details := s.Details()
if details := s.Details(); len(details) > 0 { switch len(details) {
if verr, ok := details[0].(error); ok { case 0:
return microError(verr) if verr := errors.Parse(s.Message()); verr.Code > 0 {
// return micro error
return verr
} }
// return base error as it not micro error
return err
case 1:
if verr, ok := details[0].(*errors.Error); ok {
// return nested micro error
return verr
}
// return base error as it not holds micro error
return err
} }
// try to decode micro *errors.Error // attached messages in details more then 1, try to fallback to micro error
if e := errors.Parse(s.Message()); e.Code > 0 { if verr := errors.Parse(s.Message()); verr.Code > 0 {
return e // actually a micro error // return micro error
return verr
} }
// fallback // not micro error return base error
return errors.InternalServerError("go.micro.client", s.Message()) return err
} }

11
go.mod
View File

@ -1,13 +1,8 @@
module github.com/unistack-org/micro-client-grpc/v3 module go.unistack.org/micro-client-grpc/v3
go 1.16 go 1.16
require ( require (
github.com/google/go-cmp v0.5.1 // indirect go.unistack.org/micro/v3 v3.10.22
github.com/unistack-org/micro/v3 v3.3.11 google.golang.org/grpc v1.52.3
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d // indirect
google.golang.org/grpc v1.37.0
) )
//replace github.com/unistack-org/micro/v3 => ../../micro

979
go.sum

File diff suppressed because it is too large Load Diff

323
grpc.go
View File

@ -1,51 +1,52 @@
// Package grpc provides a gRPC client // Package grpc provides a gRPC client
package grpc package grpc // import "go.unistack.org/micro-client-grpc/v3"
import ( import (
"context" "context"
"crypto/tls" "crypto/tls"
"fmt" "fmt"
"net" "net"
"os"
"reflect" "reflect"
"strings" "strings"
"sync" "sync"
"sync/atomic"
"time" "time"
"github.com/unistack-org/micro/v3/broker" "go.unistack.org/micro/v3/broker"
"github.com/unistack-org/micro/v3/client" "go.unistack.org/micro/v3/client"
"github.com/unistack-org/micro/v3/codec" "go.unistack.org/micro/v3/codec"
"github.com/unistack-org/micro/v3/errors" "go.unistack.org/micro/v3/errors"
"github.com/unistack-org/micro/v3/metadata" "go.unistack.org/micro/v3/metadata"
"go.unistack.org/micro/v3/selector"
"google.golang.org/grpc" "google.golang.org/grpc"
"google.golang.org/grpc/credentials" "google.golang.org/grpc/credentials"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/encoding" "google.golang.org/grpc/encoding"
gmetadata "google.golang.org/grpc/metadata" gmetadata "google.golang.org/grpc/metadata"
) )
const (
DefaultContentType = "application/grpc"
)
type grpcClient struct { type grpcClient struct {
pool *ConnPool
opts client.Options opts client.Options
codecs map[string]encoding.Codec
pool *pool
once atomic.Value
init bool
sync.RWMutex sync.RWMutex
init bool
} }
// secure returns the dial option for whether its a secure or insecure connection // secure returns the dial option for whether its a secure or insecure connection
func (g *grpcClient) secure(addr string) grpc.DialOption { func (g *grpcClient) secure(addr string) grpc.DialOption {
// first we check if theres'a tls config // first we check if theres'a tls config
if g.opts.Context != nil { if g.opts.TLSConfig != nil {
if v := g.opts.Context.Value(tlsAuth{}); v != nil { creds := credentials.NewTLS(g.opts.TLSConfig)
tls := v.(*tls.Config)
creds := credentials.NewTLS(tls)
// return tls config if it exists // return tls config if it exists
return grpc.WithTransportCredentials(creds) return grpc.WithTransportCredentials(creds)
} }
}
// default config // default config
tlsConfig := &tls.Config{} tlsConfig := &tls.Config{MinVersion: tls.VersionTLS12}
defaultCreds := grpc.WithTransportCredentials(credentials.NewTLS(tlsConfig)) defaultCreds := grpc.WithTransportCredentials(credentials.NewTLS(tlsConfig))
// check if the address is prepended with https // check if the address is prepended with https
@ -63,7 +64,7 @@ func (g *grpcClient) secure(addr string) grpc.DialOption {
} }
// other fallback to insecure // other fallback to insecure
return grpc.WithInsecure() return grpc.WithTransportCredentials(insecure.NewCredentials())
} }
func (g *grpcClient) call(ctx context.Context, addr string, req client.Request, rsp interface{}, opts client.CallOptions) error { func (g *grpcClient) call(ctx context.Context, addr string, req client.Request, rsp interface{}, opts client.CallOptions) error {
@ -77,22 +78,27 @@ func (g *grpcClient) call(ctx context.Context, addr string, req client.Request,
} else { } else {
header = make(map[string]string, 2) header = make(map[string]string, 2)
} }
if opts.RequestMetadata != nil {
for k, v := range opts.RequestMetadata {
header[k] = v
}
}
// set timeout in nanoseconds // set timeout in nanoseconds
header["timeout"] = fmt.Sprintf("%d", opts.RequestTimeout) header["Grpc-Timeout"] = fmt.Sprintf("%dn", opts.RequestTimeout)
// set the content type for the request header["timeout"] = fmt.Sprintf("%dn", opts.RequestTimeout)
header["x-content-type"] = req.ContentType() header["content-type"] = req.ContentType()
md := gmetadata.New(header) md := gmetadata.New(header)
ctx = gmetadata.NewOutgoingContext(ctx, md) ctx = gmetadata.NewOutgoingContext(ctx, md)
cf, err := g.newGRPCCodec(req.ContentType()) cf, err := g.newCodec(req.ContentType())
if err != nil { if err != nil {
return errors.InternalServerError("go.micro.client", err.Error()) return errors.InternalServerError("go.micro.client", err.Error())
} }
maxRecvMsgSize := g.maxRecvMsgSizeValue() maxRecvMsgSize := g.maxRecvMsgSizeValue()
maxSendMsgSize := g.maxSendMsgSizeValue() maxSendMsgSize := g.maxSendMsgSizeValue()
cfgService := g.serviceConfig()
var grr error var grr error
@ -111,30 +117,47 @@ func (g *grpcClient) call(ctx context.Context, addr string, req client.Request,
grpc.MaxCallRecvMsgSize(maxRecvMsgSize), grpc.MaxCallRecvMsgSize(maxRecvMsgSize),
grpc.MaxCallSendMsgSize(maxSendMsgSize), grpc.MaxCallSendMsgSize(maxSendMsgSize),
), ),
grpc.WithDefaultServiceConfig(cfgService),
} }
if opts := g.getGrpcDialOptions(); opts != nil { if opts := g.getGrpcDialOptions(opts.Context); opts != nil {
grpcDialOptions = append(grpcDialOptions, opts...) grpcDialOptions = append(grpcDialOptions, opts...)
} }
cc, err := g.pool.getConn(dialCtx, addr, grpcDialOptions...) contextDialer := g.opts.ContextDialer
if opts.ContextDialer != nil {
contextDialer = opts.ContextDialer
}
if contextDialer != nil {
grpcDialOptions = append(grpcDialOptions, grpc.WithContextDialer(contextDialer))
}
cc, err := g.pool.Get(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))
} }
defer func() { defer func() {
// defer execution of release // defer execution of release
g.pool.release(addr, cc, grr) g.pool.Put(cc, grr)
}() }()
ch := make(chan error, 1) ch := make(chan error, 1)
var gmd gmetadata.MD
go func() {
grpcCallOptions := []grpc.CallOption{ grpcCallOptions := []grpc.CallOption{
grpc.ForceCodec(&wrapMicroCodec{cf}), grpc.CallContentSubtype((&wrapMicroCodec{cf}).Name()),
grpc.CallContentSubtype((&wrapMicroCodec{cf}).Name())} }
if opts := g.getGrpcCallOptions(); opts != nil {
if opts := g.getGrpcCallOptions(opts.Context); opts != nil {
grpcCallOptions = append(grpcCallOptions, opts...) grpcCallOptions = append(grpcCallOptions, opts...)
} }
if opts.ResponseMetadata != nil {
gmd = gmetadata.MD{}
grpcCallOptions = append(grpcCallOptions, grpc.Header(&gmd))
}
go func() {
err := cc.Invoke(ctx, methodToGRPC(req.Service(), req.Endpoint()), req.Body(), rsp, grpcCallOptions...) err := cc.Invoke(ctx, methodToGRPC(req.Service(), req.Endpoint()), req.Body(), rsp, grpcCallOptions...)
ch <- microError(err) ch <- microError(err)
}() }()
@ -146,6 +169,13 @@ func (g *grpcClient) call(ctx context.Context, addr string, req client.Request,
grr = errors.Timeout("go.micro.client", "%v", ctx.Err()) grr = errors.Timeout("go.micro.client", "%v", ctx.Err())
} }
if opts.ResponseMetadata != nil {
*opts.ResponseMetadata = metadata.New(gmd.Len())
for k, v := range gmd {
opts.ResponseMetadata.Set(k, strings.Join(v, ","))
}
}
return grr return grr
} }
@ -163,15 +193,16 @@ func (g *grpcClient) stream(ctx context.Context, addr string, req client.Request
// set timeout in nanoseconds // set timeout in nanoseconds
if opts.StreamTimeout > time.Duration(0) { if opts.StreamTimeout > time.Duration(0) {
header["timeout"] = fmt.Sprintf("%d", opts.StreamTimeout) header["Grpc-Timeout"] = fmt.Sprintf("%dn", opts.StreamTimeout)
header["timeout"] = fmt.Sprintf("%dn", opts.StreamTimeout)
} }
// set the content type for the request // set the content type for the request
header["x-content-type"] = req.ContentType() header["content-type"] = req.ContentType()
md := gmetadata.New(header) md := gmetadata.New(header)
ctx = gmetadata.NewOutgoingContext(ctx, md) ctx = gmetadata.NewOutgoingContext(ctx, md)
cf, err := g.newGRPCCodec(req.ContentType()) cf, err := g.newCodec(req.ContentType())
if err != nil { if err != nil {
return errors.InternalServerError("go.micro.client", err.Error()) return errors.InternalServerError("go.micro.client", err.Error())
} }
@ -187,15 +218,32 @@ func (g *grpcClient) stream(ctx context.Context, addr string, req client.Request
wc := &wrapMicroCodec{cf} wc := &wrapMicroCodec{cf}
maxRecvMsgSize := g.maxRecvMsgSizeValue()
maxSendMsgSize := g.maxSendMsgSizeValue()
cfgService := g.serviceConfig()
grpcDialOptions := []grpc.DialOption{ grpcDialOptions := []grpc.DialOption{
g.secure(addr), g.secure(addr),
grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(maxRecvMsgSize),
grpc.MaxCallSendMsgSize(maxSendMsgSize),
),
grpc.WithDefaultServiceConfig(cfgService),
} }
if opts := g.getGrpcDialOptions(); opts != nil { if opts := g.getGrpcDialOptions(opts.Context); opts != nil {
grpcDialOptions = append(grpcDialOptions, opts...) grpcDialOptions = append(grpcDialOptions, opts...)
} }
cc, err := g.pool.getConn(dialCtx, addr, grpcDialOptions...) contextDialer := g.opts.ContextDialer
if opts.ContextDialer != nil {
contextDialer = opts.ContextDialer
}
if contextDialer != nil {
grpcDialOptions = append(grpcDialOptions, grpc.WithContextDialer(contextDialer))
}
cc, err := g.pool.Get(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))
} }
@ -207,12 +255,17 @@ func (g *grpcClient) stream(ctx context.Context, addr string, req client.Request
} }
grpcCallOptions := []grpc.CallOption{ grpcCallOptions := []grpc.CallOption{
grpc.ForceCodec(wc), // grpc.ForceCodec(wc),
grpc.CallContentSubtype(wc.Name()), grpc.CallContentSubtype(wc.Name()),
} }
if opts := g.getGrpcCallOptions(); opts != nil { if opts := g.getGrpcCallOptions(opts.Context); opts != nil {
grpcCallOptions = append(grpcCallOptions, opts...) grpcCallOptions = append(grpcCallOptions, opts...)
} }
var gmd gmetadata.MD
if opts.ResponseMetadata != nil {
gmd = gmetadata.MD{}
grpcCallOptions = append(grpcCallOptions, grpc.Header(&gmd))
}
// create a new cancelling context // create a new cancelling context
newCtx, cancel := context.WithCancel(ctx) newCtx, cancel := context.WithCancel(ctx)
@ -223,7 +276,7 @@ func (g *grpcClient) stream(ctx context.Context, addr string, req client.Request
// cancel the context // cancel the context
cancel() cancel()
// release the connection // release the connection
g.pool.release(addr, cc, err) g.pool.Put(cc, err)
// now return the error // now return the error
return errors.InternalServerError("go.micro.client", fmt.Sprintf("Error creating stream: %v", err)) return errors.InternalServerError("go.micro.client", fmt.Sprintf("Error creating stream: %v", err))
} }
@ -245,19 +298,20 @@ func (g *grpcClient) stream(ctx context.Context, addr string, req client.Request
}, },
conn: cc, conn: cc,
close: func(err error) { close: func(err error) {
// cancel the context if an error occured // cancel the context if an error occurred
if err != nil { if err != nil {
cancel() cancel()
} }
// defer execution of release // defer execution of release
g.pool.release(addr, cc, err) g.pool.Put(cc, err)
}, },
} }
// set the stream as the response // set the stream as the response
val := reflect.ValueOf(rsp).Elem() val := reflect.ValueOf(rsp).Elem()
val.Set(reflect.ValueOf(stream).Elem()) val.Set(reflect.ValueOf(stream).Elem())
return nil return nil
} }
@ -305,16 +359,31 @@ func (g *grpcClient) maxSendMsgSizeValue() int {
return v.(int) return v.(int)
} }
func (g *grpcClient) newGRPCCodec(ct string) (codec.Codec, error) { func (g *grpcClient) newCodec(ct string) (codec.Codec, error) {
g.RLock() g.RLock()
defer g.RUnlock() defer g.RUnlock()
if idx := strings.IndexRune(ct, ';'); idx >= 0 {
ct = ct[:idx]
}
if c, ok := g.opts.Codecs[ct]; ok { if c, ok := g.opts.Codecs[ct]; ok {
return c, nil return c, nil
} }
return nil, codec.ErrUnknownContentType return nil, codec.ErrUnknownContentType
} }
func (g *grpcClient) serviceConfig() string {
if g.opts.Context == nil {
return DefaultServiceConfig
}
v := g.opts.Context.Value(serviceConfigKey{})
if v == nil {
return DefaultServiceConfig
}
return v.(string)
}
func (g *grpcClient) Init(opts ...client.Option) error { func (g *grpcClient) Init(opts ...client.Option) error {
if len(opts) == 0 && g.init { if len(opts) == 0 && g.init {
return nil return nil
@ -378,6 +447,7 @@ func (g *grpcClient) Call(ctx context.Context, req client.Request, rsp interface
} }
// make a copy of call opts // make a copy of call opts
callOpts := g.opts.CallOptions callOpts := g.opts.CallOptions
for _, opt := range opts { for _, opt := range opts {
opt(&callOpts) opt(&callOpts)
} }
@ -426,20 +496,8 @@ func (g *grpcClient) Call(ctx context.Context, req client.Request, rsp interface
callOpts.Address = []string{g.opts.Proxy} callOpts.Address = []string{g.opts.Proxy}
} }
// lookup the route to send the reques to var next selector.Next
// TODO apply any filtering here
routes, err := g.opts.Lookup(ctx, req, callOpts)
if err != nil {
return errors.InternalServerError("go.micro.client", err.Error())
}
// balance the list of nodes
next, err := callOpts.Selector.Select(routes)
if err != nil {
return err
}
// return errors.New("go.micro.client", "request timeout", 408)
call := func(i int) error { call := func(i int) error {
// call backoff first. Someone may want an initial start delay // call backoff first. Someone may want an initial start delay
t, err := callOpts.Backoff(ctx, req, i) t, err := callOpts.Backoff(ctx, req, i)
@ -452,6 +510,23 @@ func (g *grpcClient) Call(ctx context.Context, req client.Request, rsp interface
time.Sleep(t) time.Sleep(t)
} }
if next == nil {
var routes []string
// lookup the route to send the reques to
// TODO apply any filtering here
routes, err = g.opts.Lookup(ctx, req, callOpts)
if err != nil {
return errors.InternalServerError("go.micro.client", err.Error())
}
// balance the list of nodes
next, err = callOpts.Selector.Select(routes)
if err != nil {
return err
}
}
// get the next node // get the next node
node := next() node := next()
@ -543,18 +618,7 @@ func (g *grpcClient) Stream(ctx context.Context, req client.Request, opts ...cli
callOpts.Address = []string{g.opts.Proxy} callOpts.Address = []string{g.opts.Proxy}
} }
// lookup the route to send the reques to var next selector.Next
// TODO: move to internal lookup func
routes, err := g.opts.Lookup(ctx, req, callOpts)
if err != nil {
return nil, errors.InternalServerError("go.micro.client", err.Error())
}
// balance the list of nodes
next, err := callOpts.Selector.Select(routes)
if err != nil {
return nil, err
}
call := func(i int) (client.Stream, error) { call := func(i int) (client.Stream, error) {
// call backoff first. Someone may want an initial start delay // call backoff first. Someone may want an initial start delay
@ -568,6 +632,23 @@ func (g *grpcClient) Stream(ctx context.Context, req client.Request, opts ...cli
time.Sleep(t) time.Sleep(t)
} }
if next == nil {
var routes []string
// lookup the route to send the reques to
// TODO apply any filtering here
routes, err = g.opts.Lookup(ctx, req, callOpts)
if err != nil {
return nil, errors.InternalServerError("go.micro.client", err.Error())
}
// balance the list of nodes
next, err = callOpts.Selector.Select(routes)
if err != nil {
return nil, err
}
}
// get the next node // get the next node
node := next() node := next()
@ -631,24 +712,42 @@ func (g *grpcClient) Stream(ctx context.Context, req client.Request, opts ...cli
return nil, grr return nil, grr
} }
func (g *grpcClient) BatchPublish(ctx context.Context, ps []client.Message, opts ...client.PublishOption) error {
return g.publish(ctx, ps, opts...)
}
func (g *grpcClient) Publish(ctx context.Context, p client.Message, opts ...client.PublishOption) error { func (g *grpcClient) Publish(ctx context.Context, p client.Message, opts ...client.PublishOption) error {
return g.publish(ctx, []client.Message{p}, opts...)
}
func (g *grpcClient) publish(ctx context.Context, ps []client.Message, opts ...client.PublishOption) error {
var body []byte var body []byte
options := client.NewPublishOptions(opts...) options := client.NewPublishOptions(opts...)
md, ok := metadata.FromOutgoingContext(ctx) // get proxy
if !ok { exchange := ""
md = metadata.New(2) if v, ok := os.LookupEnv("MICRO_PROXY"); ok {
exchange = v
} }
md["Content-Type"] = p.ContentType()
md["Micro-Topic"] = p.Topic() msgs := make([]*broker.Message, 0, len(ps))
omd, ok := metadata.FromOutgoingContext(ctx)
if !ok {
omd = metadata.New(2)
}
for _, p := range ps {
md := metadata.Copy(omd)
md[metadata.HeaderContentType] = p.ContentType()
// passed in raw data // passed in raw data
if d, ok := p.Payload().(*codec.Frame); ok { if d, ok := p.Payload().(*codec.Frame); ok {
body = d.Data body = d.Data
} else { } else {
// use codec for payload // use codec for payload
cf, err := g.newGRPCCodec(p.ContentType()) cf, err := g.newCodec(p.ContentType())
if err != nil { if err != nil {
return errors.InternalServerError("go.micro.client", err.Error()) return errors.InternalServerError("go.micro.client", err.Error())
} }
@ -661,16 +760,21 @@ func (g *grpcClient) Publish(ctx context.Context, p client.Message, opts ...clie
} }
topic := p.Topic() topic := p.Topic()
if len(exchange) > 0 {
// get the exchange topic = exchange
if len(options.Exchange) > 0 {
topic = options.Exchange
} }
return g.opts.Broker.Publish(metadata.NewOutgoingContext(ctx, md), topic, &broker.Message{ for k, v := range p.Metadata() {
Header: md, md.Set(k, v)
Body: body, }
}, broker.PublishContext(options.Context)) md.Set(metadata.HeaderTopic, topic)
msgs = append(msgs, &broker.Message{Header: md, Body: body})
}
return g.opts.Broker.BatchPublish(ctx, msgs,
broker.PublishContext(options.Context),
broker.PublishBodyOnly(options.BodyOnly),
)
} }
func (g *grpcClient) String() string { func (g *grpcClient) String() string {
@ -681,41 +785,45 @@ func (g *grpcClient) Name() string {
return g.opts.Name return g.opts.Name
} }
func (g *grpcClient) getGrpcDialOptions() []grpc.DialOption { func (g *grpcClient) getGrpcDialOptions(ctx context.Context) []grpc.DialOption {
if g.opts.CallOptions.Context == nil { var opts []grpc.DialOption
return nil
if g.opts.CallOptions.Context != nil {
if v := g.opts.CallOptions.Context.Value(grpcDialOptions{}); v != nil {
if vopts, ok := v.([]grpc.DialOption); ok {
opts = append(opts, vopts...)
}
}
} }
v := g.opts.CallOptions.Context.Value(grpcDialOptions{}) if ctx != nil {
if v := ctx.Value(grpcDialOptions{}); v != nil {
if v == nil { if vopts, ok := v.([]grpc.DialOption); ok {
return nil opts = append(opts, vopts...)
}
} }
opts, ok := v.([]grpc.DialOption)
if !ok {
return nil
} }
return opts return opts
} }
func (g *grpcClient) getGrpcCallOptions() []grpc.CallOption { func (g *grpcClient) getGrpcCallOptions(ctx context.Context) []grpc.CallOption {
if g.opts.CallOptions.Context == nil { var opts []grpc.CallOption
return nil
if g.opts.CallOptions.Context != nil {
if v := g.opts.CallOptions.Context.Value(grpcCallOptions{}); v != nil {
if vopts, ok := v.([]grpc.CallOption); ok {
opts = append(opts, vopts...)
}
}
} }
v := g.opts.CallOptions.Context.Value(grpcCallOptions{}) if ctx != nil {
if v := ctx.Value(grpcCallOptions{}); v != nil {
if v == nil { if vopts, ok := v.([]grpc.CallOption); ok {
return nil opts = append(opts, vopts...)
}
} }
opts, ok := v.([]grpc.CallOption)
if !ok {
return nil
} }
return opts return opts
@ -724,14 +832,15 @@ func (g *grpcClient) getGrpcCallOptions() []grpc.CallOption {
func NewClient(opts ...client.Option) client.Client { func NewClient(opts ...client.Option) client.Client {
options := client.NewOptions(opts...) options := client.NewOptions(opts...)
// default content type for grpc // default content type for grpc
options.ContentType = "application/grpc+proto" if options.ContentType == "" {
options.ContentType = DefaultContentType
}
rc := &grpcClient{ rc := &grpcClient{
opts: options, opts: options,
} }
rc.pool = newPool(options.PoolSize, options.PoolTTL, rc.poolMaxIdle(), rc.poolMaxStreams()) rc.pool = NewConnPool(options.PoolSize, options.PoolTTL, rc.poolMaxIdle(), rc.poolMaxStreams())
c := client.Client(rc) c := client.Client(rc)
// wrap in reverse // wrap in reverse

View File

@ -2,6 +2,7 @@ package grpc
import ( import (
"context" "context"
"strings"
"sync" "sync"
"time" "time"
@ -9,56 +10,47 @@ import (
"google.golang.org/grpc/connectivity" "google.golang.org/grpc/connectivity"
) )
type pool struct { type ConnPool struct {
conns map[string]*streamsPool
size int size int
ttl int64 ttl int64
// max streams on a *poolConn
maxStreams int maxStreams int
// max idle conns
maxIdle int maxIdle int
sync.Mutex sync.Mutex
conns map[string]*streamsPool
} }
type streamsPool struct { type streamsPool struct {
// head of list // head of list
head *poolConn head *PoolConn
// busy conns list // busy conns list
busy *poolConn busy *PoolConn
// the siza of list // the siza of list
count int count int
// idle conn // idle conn
idle int idle int
} }
type poolConn struct { type PoolConn struct {
// grpc conn
*grpc.ClientConn
err error err error
addr string *grpc.ClientConn
next *PoolConn
// pool and streams pool pool *ConnPool
pool *pool
sp *streamsPool sp *streamsPool
pre *PoolConn
addr string
streams int streams int
created int64 created int64
// list
pre *poolConn
next *poolConn
in bool in bool
} }
func newPool(size int, ttl time.Duration, idle int, ms int) *pool { func NewConnPool(size int, ttl time.Duration, idle int, ms int) *ConnPool {
if ms <= 0 { if ms <= 0 {
ms = 1 ms = 1
} }
if idle < 0 { if idle < 0 {
idle = 0 idle = 0
} }
return &pool{ return &ConnPool{
size: size, size: size,
ttl: int64(ttl.Seconds()), ttl: int64(ttl.Seconds()),
maxStreams: ms, maxStreams: ms,
@ -67,12 +59,15 @@ func newPool(size int, ttl time.Duration, idle int, ms int) *pool {
} }
} }
func (p *pool) getConn(ctx context.Context, addr string, opts ...grpc.DialOption) (*poolConn, error) { func (p *ConnPool) Get(ctx context.Context, addr string, opts ...grpc.DialOption) (*PoolConn, error) {
if strings.HasPrefix(addr, "http") {
addr = addr[strings.Index(addr, ":")+3:]
}
now := time.Now().Unix() now := time.Now().Unix()
p.Lock() p.Lock()
sp, ok := p.conns[addr] sp, ok := p.conns[addr]
if !ok { if !ok {
sp = &streamsPool{head: &poolConn{}, busy: &poolConn{}, count: 0, idle: 0} sp = &streamsPool{head: &PoolConn{}, busy: &PoolConn{}, count: 0, idle: 0}
p.conns[addr] = sp p.conns[addr] = sp
} }
// while we have conns check streams and then return one // while we have conns check streams and then return one
@ -135,12 +130,12 @@ func (p *pool) getConn(ctx context.Context, addr string, opts ...grpc.DialOption
} }
p.Unlock() p.Unlock()
// create new conn // create new conn)
cc, err := grpc.DialContext(ctx, addr, opts...) cc, err := grpc.DialContext(ctx, addr, opts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
conn = &poolConn{cc, nil, addr, p, sp, 1, time.Now().Unix(), nil, nil, false} conn = &PoolConn{ClientConn: cc, err: nil, addr: addr, pool: p, sp: sp, streams: 1, created: time.Now().Unix(), pre: nil, next: nil, in: false}
// add conn to streams pool // add conn to streams pool
p.Lock() p.Lock()
@ -152,7 +147,7 @@ func (p *pool) getConn(ctx context.Context, addr string, opts ...grpc.DialOption
return conn, nil return conn, nil
} }
func (p *pool) release(addr string, conn *poolConn, err error) { func (p *ConnPool) Put(conn *PoolConn, err error) {
p.Lock() p.Lock()
p, sp, created := conn.pool, conn.sp, conn.created p, sp, created := conn.pool, conn.sp, conn.created
// try to add conn // try to add conn
@ -187,11 +182,11 @@ func (p *pool) release(addr string, conn *poolConn, err error) {
p.Unlock() p.Unlock()
} }
func (conn *poolConn) Close() { func (conn *PoolConn) Close() {
conn.pool.release(conn.addr, conn, conn.err) conn.pool.Put(conn, conn.err)
} }
func removeConn(conn *poolConn) { func removeConn(conn *PoolConn) {
if conn.pre != nil { if conn.pre != nil {
conn.pre.next = conn.next conn.pre.next = conn.next
} }
@ -204,7 +199,7 @@ func removeConn(conn *poolConn) {
conn.sp.count-- conn.sp.count--
} }
func addConnAfter(conn *poolConn, after *poolConn) { func addConnAfter(conn *PoolConn, after *PoolConn) {
conn.next = after.next conn.next = after.next
conn.pre = after conn.pre = after
if after.next != nil { if after.next != nil {

View File

@ -1,20 +1,19 @@
package grpc package grpc
import ( import (
"github.com/unistack-org/micro/v3/client" "go.unistack.org/micro/v3/client"
"go.unistack.org/micro/v3/metadata"
) )
type grpcEvent struct { type grpcEvent struct {
payload interface{}
topic string topic string
contentType string contentType string
payload interface{} opts client.MessageOptions
} }
func newGRPCEvent(topic string, payload interface{}, contentType string, opts ...client.MessageOption) client.Message { func newGRPCEvent(topic string, payload interface{}, contentType string, opts ...client.MessageOption) client.Message {
var options client.MessageOptions options := client.NewMessageOptions(opts...)
for _, o := range opts {
o(&options)
}
if len(options.ContentType) > 0 { if len(options.ContentType) > 0 {
contentType = options.ContentType contentType = options.ContentType
@ -24,6 +23,7 @@ func newGRPCEvent(topic string, payload interface{}, contentType string, opts ..
payload: payload, payload: payload,
topic: topic, topic: topic,
contentType: contentType, contentType: contentType,
opts: options,
} }
} }
@ -38,3 +38,7 @@ func (g *grpcEvent) Topic() string {
func (g *grpcEvent) Payload() interface{} { func (g *grpcEvent) Payload() interface{} {
return g.payload return g.payload
} }
func (g *grpcEvent) Metadata() metadata.Metadata {
return g.opts.Metadata
}

View File

@ -3,15 +3,14 @@ package grpc
import ( import (
"context" "context"
"crypto/tls"
"github.com/unistack-org/micro/v3/client" "go.unistack.org/micro/v3/client"
"google.golang.org/grpc" "google.golang.org/grpc"
"google.golang.org/grpc/encoding" "google.golang.org/grpc/encoding"
) )
var ( var (
// DefaultPoolMaxStreams maximum streams on a connectioin // DefaultPoolMaxStreams maximum streams on a connection
// (20) // (20)
DefaultPoolMaxStreams = 20 DefaultPoolMaxStreams = 20
@ -26,16 +25,12 @@ var (
// DefaultMaxSendMsgSize maximum message that client can send // DefaultMaxSendMsgSize maximum message that client can send
// (4 MB). // (4 MB).
DefaultMaxSendMsgSize = 1024 * 1024 * 4 DefaultMaxSendMsgSize = 1024 * 1024 * 4
// DefaultServiceConfig enable load balancing
DefaultServiceConfig = `{"loadBalancingPolicy":"round_robin"}`
) )
type poolMaxStreams struct{} type poolMaxStreams struct{}
type poolMaxIdle struct{}
type codecsKey struct{}
type tlsAuth struct{}
type maxRecvMsgSizeKey struct{}
type maxSendMsgSizeKey struct{}
type grpcDialOptions struct{}
type grpcCallOptions struct{}
// maximum streams on a connectioin // maximum streams on a connectioin
func PoolMaxStreams(n int) client.Option { func PoolMaxStreams(n int) client.Option {
@ -47,6 +42,8 @@ func PoolMaxStreams(n int) client.Option {
} }
} }
type poolMaxIdle struct{}
// maximum idle conns of a pool // maximum idle conns of a pool
func PoolMaxIdle(d int) client.Option { func PoolMaxIdle(d int) client.Option {
return func(o *client.Options) { return func(o *client.Options) {
@ -57,6 +54,8 @@ func PoolMaxIdle(d int) client.Option {
} }
} }
type codecsKey struct{}
// gRPC Codec to be used to encode/decode requests for a given content type // gRPC Codec to be used to encode/decode requests for a given content type
func Codec(contentType string, c encoding.Codec) client.Option { func Codec(contentType string, c encoding.Codec) client.Option {
return func(o *client.Options) { return func(o *client.Options) {
@ -72,19 +71,9 @@ func Codec(contentType string, c encoding.Codec) client.Option {
} }
} }
// AuthTLS should be used to setup a secure authentication using TLS type maxRecvMsgSizeKey struct{}
func AuthTLS(t *tls.Config) client.Option {
return func(o *client.Options) {
if o.Context == nil {
o.Context = context.Background()
}
o.Context = context.WithValue(o.Context, tlsAuth{}, t)
}
}
//
// MaxRecvMsgSize set the maximum size of message that client can receive. // MaxRecvMsgSize set the maximum size of message that client can receive.
//
func MaxRecvMsgSize(s int) client.Option { func MaxRecvMsgSize(s int) client.Option {
return func(o *client.Options) { return func(o *client.Options) {
if o.Context == nil { if o.Context == nil {
@ -94,9 +83,9 @@ func MaxRecvMsgSize(s int) client.Option {
} }
} }
// type maxSendMsgSizeKey struct{}
// MaxSendMsgSize set the maximum size of message that client can send. // MaxSendMsgSize set the maximum size of message that client can send.
//
func MaxSendMsgSize(s int) client.Option { func MaxSendMsgSize(s int) client.Option {
return func(o *client.Options) { return func(o *client.Options) {
if o.Context == nil { if o.Context == nil {
@ -106,9 +95,9 @@ func MaxSendMsgSize(s int) client.Option {
} }
} }
// type grpcDialOptions struct{}
// DialOptions to be used to configure gRPC dial options // DialOptions to be used to configure gRPC dial options
//
func DialOptions(opts ...grpc.DialOption) client.CallOption { func DialOptions(opts ...grpc.DialOption) client.CallOption {
return func(o *client.CallOptions) { return func(o *client.CallOptions) {
if o.Context == nil { if o.Context == nil {
@ -118,9 +107,9 @@ func DialOptions(opts ...grpc.DialOption) client.CallOption {
} }
} }
// type grpcCallOptions struct{}
// CallOptions to be used to configure gRPC call options // CallOptions to be used to configure gRPC call options
//
func CallOptions(opts ...grpc.CallOption) client.CallOption { func CallOptions(opts ...grpc.CallOption) client.CallOption {
return func(o *client.CallOptions) { return func(o *client.CallOptions) {
if o.Context == nil { if o.Context == nil {
@ -129,3 +118,14 @@ func CallOptions(opts ...grpc.CallOption) client.CallOption {
o.Context = context.WithValue(o.Context, grpcCallOptions{}, opts) o.Context = context.WithValue(o.Context, grpcCallOptions{}, opts)
} }
} }
type serviceConfigKey struct{}
func ServiceConfig(str string) client.CallOption {
return func(options *client.CallOptions) {
if options.Context == nil {
options.Context = context.Background()
}
options.Context = context.WithValue(options.Context, serviceConfigKey{}, str)
}
}

View File

@ -4,17 +4,17 @@ import (
"fmt" "fmt"
"strings" "strings"
"github.com/unistack-org/micro/v3/client" "go.unistack.org/micro/v3/client"
"github.com/unistack-org/micro/v3/codec" "go.unistack.org/micro/v3/codec"
) )
type grpcRequest struct { type grpcRequest struct {
request interface{}
codec codec.Codec
service string service string
method string method string
contentType string contentType string
request interface{}
opts client.RequestOptions opts client.RequestOptions
codec codec.Codec
} }
// service Struct.Method /service.Struct/Method // service Struct.Method /service.Struct/Method
@ -38,15 +38,12 @@ func methodToGRPC(service, method string) string {
return fmt.Sprintf("/%s.%s/%s", service, mParts[0], mParts[1]) return fmt.Sprintf("/%s.%s/%s", service, mParts[0], mParts[1])
} }
func newGRPCRequest(service, method string, request interface{}, contentType string, reqOpts ...client.RequestOption) client.Request { func newGRPCRequest(service, method string, request interface{}, contentType string, opts ...client.RequestOption) client.Request {
var opts client.RequestOptions options := client.NewRequestOptions(opts...)
for _, o := range reqOpts {
o(&opts)
}
// set the content-type specified // set the content-type specified
if len(opts.ContentType) > 0 { if len(options.ContentType) > 0 {
contentType = opts.ContentType contentType = options.ContentType
} }
return &grpcRequest{ return &grpcRequest{
@ -54,7 +51,7 @@ func newGRPCRequest(service, method string, request interface{}, contentType str
method: method, method: method,
request: request, request: request,
contentType: contentType, contentType: contentType,
opts: opts, opts: options,
} }
} }

View File

@ -3,13 +3,13 @@ package grpc
import ( import (
"strings" "strings"
"github.com/unistack-org/micro/v3/codec" "go.unistack.org/micro/v3/codec"
"github.com/unistack-org/micro/v3/metadata" "go.unistack.org/micro/v3/metadata"
"google.golang.org/grpc" "google.golang.org/grpc"
) )
type response struct { type response struct {
conn *poolConn conn *PoolConn
stream grpc.ClientStream stream grpc.ClientStream
codec codec.Codec codec codec.Codec
} }
@ -23,7 +23,7 @@ func (r *response) Codec() codec.Codec {
func (r *response) Header() metadata.Metadata { func (r *response) Header() metadata.Metadata {
meta, err := r.stream.Header() meta, err := r.stream.Header()
if err != nil { if err != nil {
return metadata.New(0) return nil
} }
md := metadata.New(len(meta)) md := metadata.New(len(meta))
for k, v := range meta { for k, v := range meta {

View File

@ -5,23 +5,21 @@ import (
"io" "io"
"sync" "sync"
"github.com/unistack-org/micro/v3/client" "go.unistack.org/micro/v3/client"
"google.golang.org/grpc" "google.golang.org/grpc"
) )
// Implements the streamer interface // Implements the streamer interface
type grpcStream struct { type grpcStream struct {
// embed so we can access if need be
grpc.ClientStream grpc.ClientStream
context context.Context
sync.RWMutex
closed bool
err error err error
conn *poolConn
request client.Request request client.Request
response client.Response response client.Response
context context.Context
close func(err error) close func(err error)
conn *PoolConn
sync.RWMutex
closed bool
} }
func (g *grpcStream) Context() context.Context { func (g *grpcStream) Context() context.Context {
@ -44,6 +42,14 @@ func (g *grpcStream) Send(msg interface{}) error {
return nil return nil
} }
func (g *grpcStream) SendMsg(msg interface{}) error {
if err := g.ClientStream.SendMsg(msg); err != nil {
g.setError(err)
return err
}
return nil
}
func (g *grpcStream) Recv(msg interface{}) (err error) { func (g *grpcStream) Recv(msg interface{}) (err error) {
defer g.setError(err) defer g.setError(err)
@ -62,6 +68,24 @@ func (g *grpcStream) Recv(msg interface{}) (err error) {
return return
} }
func (g *grpcStream) RecvMsg(msg interface{}) (err error) {
defer g.setError(err)
if err = g.ClientStream.RecvMsg(msg); err != nil {
// #202 - inconsistent gRPC stream behavior
// the only way to tell if the stream is done is when we get a EOF on the Recv
// here we should close the underlying gRPC ClientConn
closeErr := g.Close()
if err == io.EOF && closeErr != nil {
err = closeErr
}
return err
}
return
}
func (g *grpcStream) Error() error { func (g *grpcStream) Error() error {
g.RLock() g.RLock()
defer g.RUnlock() defer g.RUnlock()
@ -92,3 +116,17 @@ func (g *grpcStream) Close() error {
g.close(g.err) g.close(g.err)
return g.ClientStream.CloseSend() return g.ClientStream.CloseSend()
} }
func (g *grpcStream) CloseSend() error {
g.Lock()
defer g.Unlock()
if g.closed {
return nil
}
// close the connection
g.closed = true
g.close(g.err)
return g.ClientStream.CloseSend()
}