Compare commits

...

224 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 2m20s
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
Renovate Bot
4d5a2d1a4a Update module google.golang.org/grpc to v1.37.0 2021-04-07 20:27:07 +00:00
Renovate Bot
9817e0c1af Update module github.com/unistack-org/micro/v3 to v3.3.11 2021-04-03 10:40:13 +00:00
Renovate Bot
ca4d561efe Update module github.com/unistack-org/micro/v3 to v3.3.10 2021-04-01 00:25:07 +00:00
Renovate Bot
0ffbfc36d7 Update module github.com/unistack-org/micro/v3 to v3.3.9 2021-03-30 00:26:56 +00:00
Renovate Bot
8a1b5b1130 Update module github.com/unistack-org/micro/v3 to v3.3.8 2021-03-29 02:40:13 +00:00
Renovate Bot
1048869e6c Update module github.com/unistack-org/micro/v3 to v3.3.4 2021-03-26 16:35:53 +00:00
Renovate Bot
35e9b9b77e Update module google.golang.org/grpc to v1.36.1 2021-03-26 02:51:13 +00:00
Renovate Bot
faeaff358d Update module github.com/unistack-org/micro/v3 to v3.3.2 2021-03-25 12:20:06 +00:00
Renovate Bot
3d7a5f6122 Update module github.com/unistack-org/micro/v3 to v3.3.1 2021-03-25 02:12:13 +00:00
9030637204 cleanup
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2021-03-24 15:32:19 +03:00
Renovate Bot
225cdfd469 Update module github.com/unistack-org/micro/v3 to v3.2.26 2021-03-23 17:56:29 +00:00
Renovate Bot
d3696a4bf8 Update module github.com/unistack-org/micro/v3 to v3.2.24 2021-03-21 15:26:48 +00:00
Renovate Bot
88432401ac Update module github.com/unistack-org/micro/v3 to v3.2.23 2021-03-16 19:02:09 +00:00
Renovate Bot
e3383bae9b Update module github.com/unistack-org/micro/v3 to v3.2.22 2021-03-15 00:52:26 +00:00
Renovate Bot
60c340cc86 Update module github.com/unistack-org/micro/v3 to v3.2.20 2021-03-06 22:58:20 +00:00
Renovate Bot
8d237e1423 Update module github.com/unistack-org/micro/v3 to v3.2.17 2021-03-05 18:23:32 +00:00
Renovate Bot
be27263047 Update module github.com/unistack-org/micro/v3 to v3.2.16 2021-03-04 12:11:09 +00:00
Renovate Bot
41a60a8a16 Update module google.golang.org/grpc to v1.36.0 2021-02-25 01:08:50 +00:00
2e09afca64
Merge pull request #10 from unistack-org/renovate/all
Update module unistack-org/micro/v3 to v3.2.14
2021-02-18 19:14:51 +03:00
Renovate Bot
aeb25fec3b
Update module unistack-org/micro/v3 to v3.2.14 2021-02-18 16:13:36 +00:00
a4518a12eb update workflows
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2021-02-18 18:44:13 +03:00
2a6e2c72c1 use incoming/outgoing metadata
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2021-02-12 20:34:14 +03:00
Renovate Bot
1d17c6c962 Update module unistack-org/micro/v3 to v3.2.11 2021-02-12 17:15:20 +00:00
Renovate Bot
11c265458c Update module unistack-org/micro/v3 to v3.2.9 2021-02-12 12:50:33 +00:00
8d34fe5dc0 update renovate.json
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2021-02-12 12:38:40 +03:00
8c480b5f0e
Merge pull request #6 from unistack-org/renovate/all
Update all deps
2021-02-10 20:00:07 +03:00
c1e03ca61d
Merge pull request #7 from unistack-org/renovate/major-all
Update all deps to v2 (major)
2021-02-10 18:09:04 +03:00
Renovate Bot
22dc300099
Update all deps to v2 2021-02-10 10:18:59 +00:00
Renovate Bot
8584261b44
Update all deps 2021-02-10 10:18:53 +00:00
4d31515547 move renovate.json
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2021-02-10 13:17:42 +03:00
9f36491023
Merge pull request #1 from unistack-org/renovate/configure
Configure Renovate
2021-02-10 00:35:08 +03:00
Renovate Bot
1378d624be
Add renovate.json 2021-02-08 23:37:58 +00:00
0fe6470260 update for latest micro
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2021-01-29 16:12:28 +03:00
db1148c1d1 update micro to v3.1.1
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2021-01-16 01:56:21 +03:00
bbd07bb091 fixup for never micro codec changes
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-12-28 15:33:19 +03:00
067cf68d23 fix stream wrapping
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-11-26 01:45:58 +03:00
7ef49b03ba codec rewrite
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-11-26 01:18:35 +03:00
60ad0903b9 fix license
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-11-18 22:40:06 +03:00
2ed58a202b update metadata
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-11-18 12:24:58 +03:00
15a5d7d2cd lint fix
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-10-28 10:07:30 +03:00
131916baca not use internal protobuf to transfer error
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-10-08 13:19:30 +03:00
3aa3132caa fix proto types
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-10-08 12:37:06 +03:00
854839ba45 fix proto
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-09-29 10:42:45 +03:00
5350b6ec2b fix proto
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-09-29 10:33:48 +03:00
c59d400857 move errors to internal
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-09-28 12:14:53 +03:00
28 changed files with 1796 additions and 1189 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"

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@v1 uses: actions/setup-go@v3
with: with:
go-version: 1.15 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@v1 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@v1 uses: actions/setup-go@v3
with: with:
go-version: 1.15 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@v1 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

192
LICENSE Normal file
View File

@ -0,0 +1,192 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
Copyright 2015-2020 Asim Aslam.
Copyright 2019-2020 Unistack LLC.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@ -1,25 +0,0 @@
# GRPC Client
The grpc client is a [micro.Client](https://godoc.org/github.com/micro/go-micro/client#Client) compatible client.
## Overview
The client makes use of the [google.golang.org/grpc](google.golang.org/grpc) framework for the underlying communication mechanism.
## Usage
Specify the client to your micro service
```go
import (
"github.com/micro/go-micro"
"github.com/micro/go-plugins/client/grpc"
)
func main() {
service := micro.NewService(
micro.Name("greeter"),
micro.Client(grpc.NewClient()),
)
}
```

240
codec.go
View File

@ -1,231 +1,127 @@
package grpc package grpc
import ( import (
b "bytes" "io"
"encoding/json"
"fmt"
"strings"
oldjsonpb "github.com/golang/protobuf/jsonpb" "go.unistack.org/micro/v3/codec"
oldproto "github.com/golang/protobuf/proto"
bytes "github.com/unistack-org/micro-codec-bytes"
"github.com/unistack-org/micro/v3/codec"
"google.golang.org/grpc" "google.golang.org/grpc"
"google.golang.org/grpc/encoding" "google.golang.org/grpc/encoding"
jsonpb "google.golang.org/protobuf/encoding/protojson"
"google.golang.org/protobuf/proto"
) )
type jsonCodec struct{}
type protoCodec struct{}
type bytesCodec struct{}
type wrapCodec struct{ encoding.Codec }
var jsonpbMarshaler = &jsonpb.MarshalOptions{}
var oldjsonpbMarshaler = &oldjsonpb.Marshaler{}
var useNumber bool
var ( var (
defaultGRPCCodecs = map[string]encoding.Codec{ _ encoding.Codec = &wrapMicroCodec{}
"application/json": jsonCodec{}, _ codec.Codec = &wrapGrpcCodec{}
"application/proto": protoCodec{},
"application/protobuf": protoCodec{},
"application/octet-stream": protoCodec{},
"application/grpc": protoCodec{},
"application/grpc+json": jsonCodec{},
"application/grpc+proto": protoCodec{},
"application/grpc+bytes": bytesCodec{},
}
) )
// UseNumber fix unmarshal Number(8234567890123456789) to interface(8.234567890123457e+18) type wrapStream struct{ grpc.ClientStream }
func UseNumber() {
useNumber = true func (w *wrapStream) Write(d []byte) (int, error) {
n := len(d)
err := w.ClientStream.SendMsg(&codec.Frame{Data: d})
return n, err
} }
func (w wrapCodec) String() string { func (w *wrapStream) Read(d []byte) (int, error) {
m := &codec.Frame{}
err := w.ClientStream.RecvMsg(m)
copy(d, m.Data)
return len(d), err
}
type wrapMicroCodec struct{ codec.Codec }
func (w *wrapMicroCodec) Name() 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 }
func (w *wrapGrpcCodec) String() string {
return w.Codec.Name() return w.Codec.Name()
} }
func (w wrapCodec) 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 *bytes.Frame:
return m.Data, nil return m.Data, nil
} }
return w.Codec.Marshal(v) return w.Codec.Marshal(v)
} }
func (w wrapCodec) Unmarshal(data []byte, v interface{}) error { func (w *wrapGrpcCodec) Unmarshal(d []byte, v interface{}, opts ...codec.Option) error {
if len(data) == 0 { if d == nil || v == nil {
return nil return nil
} }
if v == nil { if m, ok := v.(*codec.Frame); ok {
m.Data = d
return nil return nil
} }
switch m := v.(type) { return w.Codec.Unmarshal(d, v)
case *bytes.Frame:
m.Data = data
return nil
}
return w.Codec.Unmarshal(data, v)
}
func (protoCodec) Marshal(v interface{}) ([]byte, error) {
switch m := v.(type) {
case *bytes.Frame:
return m.Data, nil
case proto.Message:
return proto.Marshal(m)
case oldproto.Message:
return oldproto.Marshal(m)
}
return nil, fmt.Errorf("failed to marshal: %v is not type of *bytes.Frame or proto.Message", v)
}
func (protoCodec) Unmarshal(data []byte, v interface{}) error {
if len(data) == 0 {
return nil
}
if v == nil {
return nil
}
switch m := v.(type) {
case *bytes.Frame:
m.Data = data
return nil
case proto.Message:
return proto.Unmarshal(data, m)
case oldproto.Message:
return oldproto.Unmarshal(data, m)
}
return fmt.Errorf("failed to unmarshal: %v is not type of *bytes.Frame or proto.Message", v)
}
func (protoCodec) Name() string {
return "proto"
}
func (bytesCodec) Marshal(v interface{}) ([]byte, error) {
switch m := v.(type) {
case *[]byte:
return *m, nil
}
return nil, fmt.Errorf("failed to marshal: %v is not type of *[]byte", v)
}
func (bytesCodec) Unmarshal(data []byte, v interface{}) error {
if len(data) == 0 {
return nil
}
if v == nil {
return nil
}
switch m := v.(type) {
case *[]byte:
*m = data
return nil
}
return fmt.Errorf("failed to unmarshal: %v is not type of *[]byte", v)
}
func (bytesCodec) Name() string {
return "bytes"
}
func (jsonCodec) Marshal(v interface{}) ([]byte, error) {
switch m := v.(type) {
case *bytes.Frame:
return m.Data, nil
case proto.Message:
return jsonpbMarshaler.Marshal(m)
case oldproto.Message:
buf, err := oldjsonpbMarshaler.MarshalToString(m)
return []byte(buf), err
}
return json.Marshal(v)
}
func (jsonCodec) Unmarshal(data []byte, v interface{}) error {
if len(data) == 0 {
return nil
}
if v == nil {
return nil
}
switch m := v.(type) {
case *bytes.Frame:
m.Data = data
return nil
case proto.Message:
return jsonpb.Unmarshal(data, m)
case oldproto.Message:
return oldjsonpb.Unmarshal(b.NewReader(data), m)
}
dec := json.NewDecoder(b.NewReader(data))
if useNumber {
dec.UseNumber()
}
return dec.Decode(v)
}
func (jsonCodec) Name() string {
return "json"
} }
/*
type grpcCodec struct { type grpcCodec struct {
grpc.ServerStream
// headers // headers
id string id string
target string target string
method string method string
endpoint string endpoint string
s grpc.ClientStream
c encoding.Codec c encoding.Codec
} }
func (g *grpcCodec) ReadHeader(m *codec.Message, mt codec.MessageType) error { */
md, err := g.s.Header()
if err != nil { func (w *wrapGrpcCodec) ReadHeader(conn io.Reader, m *codec.Message, mt codec.MessageType) error {
return err /*
}
if m == nil { if m == nil {
m = new(codec.Message) m = codec.NewMessage(codec.Request)
} }
if md, ok := metadata.FromIncomingContext(g.ServerStream.Context()); ok {
if m.Header == nil { if m.Header == nil {
m.Header = make(map[string]string, len(md)) m.Header = meta.New(len(md))
} }
for k, v := range md { for k, v := range md {
m.Header[k] = strings.Join(v, ",") m.Header[k] = strings.Join(v, ",")
} }
}
m.Id = g.id m.Id = g.id
m.Target = g.target m.Target = g.target
m.Method = g.method m.Method = g.method
m.Endpoint = g.endpoint m.Endpoint = g.endpoint
*/
return nil return nil
} }
func (g *grpcCodec) ReadBody(v interface{}) error { func (w *wrapGrpcCodec) ReadBody(conn io.Reader, v interface{}) error {
switch m := v.(type) { // caller has requested a frame
case *bytes.Frame: if m, ok := v.(*codec.Frame); ok {
return g.s.RecvMsg(m) _, err := conn.Read(m.Data)
return err
} }
return g.s.RecvMsg(v) return codec.ErrInvalidMessage
} }
func (g *grpcCodec) Write(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 {
return g.s.SendMsg(v) b, err := w.Marshal(v)
if err != nil {
return err
}
m.Body = b
} }
// write the body using the framing codec // write the body using the framing codec
return g.s.SendMsg(&bytes.Frame{Data: m.Body}) _, err := conn.Write(m.Body)
} return err
func (g *grpcCodec) Close() error {
return g.s.CloseSend()
}
func (g *grpcCodec) String() string {
return g.c.Name()
} }

View File

@ -1,8 +1,7 @@
package grpc package grpc
import ( import (
pberr "github.com/unistack-org/micro-client-grpc/errors" "go.unistack.org/micro/v3/errors"
"github.com/unistack-org/micro/v3/errors"
"google.golang.org/grpc/status" "google.golang.org/grpc/status"
) )
@ -10,35 +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
} }
if verr, ok := err.(*pberr.Error); ok {
return &errors.Error{Id: verr.Id, Code: verr.Code, Detail: verr.Detail, Status: verr.Status}
}
// 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
} }

View File

@ -1,159 +0,0 @@
package errors
import (
"fmt"
)
func (e *Error) Error() string {
return fmt.Sprintf(`{"id":"%s","code":%d,"detail":"%s","status":"%s"}`, e.Id, e.Code, e.Detail, e.Status)
}
// New generates a custom error.
func New(id, detail string, code int32) error {
return &Error{
Id: id,
Code: code,
Detail: detail,
// Status: http.StatusText(int(code)),
}
}
// BadRequest generates a 400 error.
func BadRequest(id, format string, a ...interface{}) error {
return &Error{
Id: id,
Code: 400,
Detail: fmt.Sprintf(format, a...),
// Status: http.StatusText(400),
}
}
// Unauthorized generates a 401 error.
func Unauthorized(id, format string, a ...interface{}) error {
return &Error{
Id: id,
Code: 401,
Detail: fmt.Sprintf(format, a...),
// Status: http.StatusText(401),
}
}
// Forbidden generates a 403 error.
func Forbidden(id, format string, a ...interface{}) error {
return &Error{
Id: id,
Code: 403,
Detail: fmt.Sprintf(format, a...),
// Status: http.StatusText(403),
}
}
// NotFound generates a 404 error.
func NotFound(id, format string, a ...interface{}) error {
return &Error{
Id: id,
Code: 404,
Detail: fmt.Sprintf(format, a...),
// Status: http.StatusText(404),
}
}
// MethodNotAllowed generates a 405 error.
func MethodNotAllowed(id, format string, a ...interface{}) error {
return &Error{
Id: id,
Code: 405,
Detail: fmt.Sprintf(format, a...),
//Status: http.StatusText(405),
}
}
// Timeout generates a 408 error.
func Timeout(id, format string, a ...interface{}) error {
return &Error{
Id: id,
Code: 408,
Detail: fmt.Sprintf(format, a...),
//Status: http.StatusText(408),
}
}
// Conflict generates a 409 error.
func Conflict(id, format string, a ...interface{}) error {
return &Error{
Id: id,
Code: 409,
Detail: fmt.Sprintf(format, a...),
//Status: http.StatusText(409),
}
}
// InternalServerError generates a 500 error.
func InternalServerError(id, format string, a ...interface{}) error {
return &Error{
Id: id,
Code: 500,
Detail: fmt.Sprintf(format, a...),
//Status: http.StatusText(500),
}
}
// NotImplemented generates a 501 error
func NotImplemented(id, format string, a ...interface{}) error {
return &Error{
Id: id,
Code: 501,
Detail: fmt.Sprintf(format, a...),
//Status: http.StatusText(501),
}
}
// BadGateway generates a 502 error
func BadGateway(id, format string, a ...interface{}) error {
return &Error{
Id: id,
Code: 502,
Detail: fmt.Sprintf(format, a...),
// Status: http.StatusText(502),
}
}
// ServiceUnavailable generates a 503 error
func ServiceUnavailable(id, format string, a ...interface{}) error {
return &Error{
Id: id,
Code: 503,
Detail: fmt.Sprintf(format, a...),
//Status: http.StatusText(503),
}
}
// GatewayTimeout generates a 504 error
func GatewayTimeout(id, format string, a ...interface{}) error {
return &Error{
Id: id,
Code: 504,
Detail: fmt.Sprintf(format, a...),
//Status: http.StatusText(504),
}
}
// Equal tries to compare errors
func Equal(err1 error, err2 error) bool {
verr1, ok1 := err1.(*Error)
verr2, ok2 := err2.(*Error)
if ok1 != ok2 {
return false
}
if !ok1 {
return err1 == err2
}
if verr1.Code != verr2.Code {
return false
}
return true
}

View File

@ -1,176 +0,0 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0-devel
// protoc v3.6.1
// source: errors.proto
package errors
import (
proto "github.com/golang/protobuf/proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
type Error struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Code int32 `protobuf:"varint,2,opt,name=code,proto3" json:"code,omitempty"`
Detail string `protobuf:"bytes,3,opt,name=detail,proto3" json:"detail,omitempty"`
Status string `protobuf:"bytes,4,opt,name=status,proto3" json:"status,omitempty"`
}
func (x *Error) Reset() {
*x = Error{}
if protoimpl.UnsafeEnabled {
mi := &file_errors_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Error) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Error) ProtoMessage() {}
func (x *Error) ProtoReflect() protoreflect.Message {
mi := &file_errors_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Error.ProtoReflect.Descriptor instead.
func (*Error) Descriptor() ([]byte, []int) {
return file_errors_proto_rawDescGZIP(), []int{0}
}
func (x *Error) GetId() string {
if x != nil {
return x.Id
}
return ""
}
func (x *Error) GetCode() int32 {
if x != nil {
return x.Code
}
return 0
}
func (x *Error) GetDetail() string {
if x != nil {
return x.Detail
}
return ""
}
func (x *Error) GetStatus() string {
if x != nil {
return x.Status
}
return ""
}
var File_errors_proto protoreflect.FileDescriptor
var file_errors_proto_rawDesc = []byte{
0x0a, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x25,
0x6f, 0x72, 0x67, 0x2e, 0x75, 0x6e, 0x69, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x6d, 0x69, 0x63,
0x72, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x65,
0x72, 0x72, 0x6f, 0x72, 0x73, 0x22, 0x5b, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x0e,
0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12,
0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f,
0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01,
0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74,
0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74,
0x75, 0x73, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x3b, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_errors_proto_rawDescOnce sync.Once
file_errors_proto_rawDescData = file_errors_proto_rawDesc
)
func file_errors_proto_rawDescGZIP() []byte {
file_errors_proto_rawDescOnce.Do(func() {
file_errors_proto_rawDescData = protoimpl.X.CompressGZIP(file_errors_proto_rawDescData)
})
return file_errors_proto_rawDescData
}
var file_errors_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_errors_proto_goTypes = []interface{}{
(*Error)(nil), // 0: org.unistack.micro.client.grpc.errors.Error
}
var file_errors_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_errors_proto_init() }
func file_errors_proto_init() {
if File_errors_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_errors_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Error); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_errors_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_errors_proto_goTypes,
DependencyIndexes: file_errors_proto_depIdxs,
MessageInfos: file_errors_proto_msgTypes,
}.Build()
File_errors_proto = out.File
file_errors_proto_rawDesc = nil
file_errors_proto_goTypes = nil
file_errors_proto_depIdxs = nil
}

View File

@ -1,21 +0,0 @@
// Code generated by protoc-gen-micro. DO NOT EDIT.
// source: errors.proto
package errors
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package

View File

@ -1,11 +0,0 @@
syntax = "proto3";
option go_package = ".;errors";
package org.unistack.micro.client.grpc.errors;
message Error {
string id = 1;
int32 code = 2;
string detail = 3;
string status = 4;
};

View File

@ -1,3 +0,0 @@
package grpc
//go:generate protoc -I./errors -I. --go-grpc_out=paths=source_relative:./errors --go_out=paths=source_relative:./errors --micro_out=paths=source_relative:./errors errors/errors.proto

15
go.mod
View File

@ -1,15 +1,8 @@
module github.com/unistack-org/micro-client-grpc module go.unistack.org/micro-client-grpc/v3
go 1.15 go 1.16
require ( require (
github.com/golang/protobuf v1.4.2 go.unistack.org/micro/v3 v3.10.22
github.com/google/go-cmp v0.5.1 // indirect google.golang.org/grpc v1.52.3
github.com/unistack-org/micro-codec-bytes v0.0.0-20200828083432-4e49e953d844
github.com/unistack-org/micro/v3 v3.0.0-gamma.0.20200920124807-9b11ea527aeb
golang.org/x/sys v0.0.0-20200803210538-64077c9b5642 // indirect
golang.org/x/text v0.3.3 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/grpc v1.31.1
google.golang.org/protobuf v1.25.0
) )

1097
go.sum

File diff suppressed because it is too large Load Diff

429
grpc.go
View File

@ -1,57 +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"
raw "github.com/unistack-org/micro-codec-bytes" "go.unistack.org/micro/v3/broker"
"github.com/unistack-org/micro/v3/broker" "go.unistack.org/micro/v3/client"
"github.com/unistack-org/micro/v3/client" "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"
) )
type grpcClient struct { const (
opts client.Options DefaultContentType = "application/grpc"
codecs map[string]encoding.Codec )
pool *pool
once atomic.Value
sync.RWMutex
}
func init() { type grpcClient struct {
encoding.RegisterCodec(wrapCodec{jsonCodec{}}) pool *ConnPool
encoding.RegisterCodec(wrapCodec{protoCodec{}}) opts client.Options
encoding.RegisterCodec(wrapCodec{bytesCodec{}}) 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
@ -69,37 +64,41 @@ 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 {
var header map[string]string var header map[string]string
header = make(map[string]string) if md, ok := metadata.FromOutgoingContext(ctx); ok {
if md, ok := metadata.FromContext(ctx); ok {
header = make(map[string]string, len(md)) header = make(map[string]string, len(md))
for k, v := range md { for k, v := range md {
header[strings.ToLower(k)] = v header[strings.ToLower(k)] = v
} }
} else { } else {
header = make(map[string]string) 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
@ -118,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(cf), grpc.CallContentSubtype((&wrapMicroCodec{cf}).Name()),
grpc.CallContentSubtype(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)
}() }()
@ -153,13 +169,20 @@ 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
} }
func (g *grpcClient) stream(ctx context.Context, addr string, req client.Request, rsp interface{}, opts client.CallOptions) error { func (g *grpcClient) stream(ctx context.Context, addr string, req client.Request, rsp interface{}, opts client.CallOptions) error {
var header map[string]string var header map[string]string
if md, ok := metadata.FromContext(ctx); ok { if md, ok := metadata.FromOutgoingContext(ctx); ok {
header = make(map[string]string, len(md)) header = make(map[string]string, len(md))
for k, v := range md { for k, v := range md {
header[k] = v header[k] = v
@ -170,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())
} }
@ -192,17 +216,34 @@ func (g *grpcClient) stream(ctx context.Context, addr string, req client.Request
} }
defer cancel() defer cancel()
wc := wrapCodec{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))
} }
@ -214,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(cf.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)
@ -230,19 +276,14 @@ 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))
} }
codec := &grpcCodec{
s: st,
c: wc,
}
// set request codec // set request codec
if r, ok := req.(*grpcRequest); ok { if r, ok := req.(*grpcRequest); ok {
r.codec = codec r.codec = cf
} }
// setup the stream response // setup the stream response
@ -254,23 +295,23 @@ func (g *grpcClient) stream(ctx context.Context, addr string, req client.Request
conn: cc, conn: cc,
stream: st, stream: st,
codec: cf, codec: cf,
gcodec: codec,
}, },
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
} }
@ -318,17 +359,35 @@ func (g *grpcClient) maxSendMsgSizeValue() int {
return v.(int) return v.(int)
} }
func (g *grpcClient) newGRPCCodec(contentType string) (encoding.Codec, error) { func (g *grpcClient) newCodec(ct string) (codec.Codec, error) {
g.RLock() g.RLock()
defer g.RUnlock() defer g.RUnlock()
if c, ok := g.codecs[contentType]; ok { if idx := strings.IndexRune(ct, ';'); idx >= 0 {
return wrapCodec{c}, nil ct = ct[:idx]
} }
return nil, fmt.Errorf("Unsupported Content-Type: %s", contentType)
if c, ok := g.opts.Codecs[ct]; ok {
return c, nil
}
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 {
return nil
}
size := g.opts.PoolSize size := g.opts.PoolSize
ttl := g.opts.PoolTTL ttl := g.opts.PoolTTL
@ -344,6 +403,27 @@ func (g *grpcClient) Init(opts ...client.Option) error {
g.pool.Unlock() g.pool.Unlock()
} }
if err := g.opts.Broker.Init(); err != nil {
return err
}
if err := g.opts.Tracer.Init(); err != nil {
return err
}
if err := g.opts.Router.Init(); err != nil {
return err
}
if err := g.opts.Logger.Init(); err != nil {
return err
}
if err := g.opts.Meter.Init(); err != nil {
return err
}
if err := g.opts.Transport.Init(); err != nil {
return err
}
g.init = true
return nil return nil
} }
@ -367,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)
} }
@ -415,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)
@ -441,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()
@ -532,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
@ -557,12 +632,29 @@ 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()
// make the call // make the call
stream := &grpcStream{} stream := &grpcStream{}
err = g.stream(ctx, node, req, stream, callOpts) err = gstream(ctx, node, req, stream, callOpts)
// record the result of the call to inform future routing decisions // record the result of the call to inform future routing decisions
if verr := g.opts.Selector.Record(node, err); verr != nil { if verr := g.opts.Selector.Record(node, err); verr != nil {
@ -574,7 +666,10 @@ func (g *grpcClient) Stream(ctx context.Context, req client.Request, opts ...cli
return nil, verr return nil, verr
} }
g.opts.Selector.Record(node, err) if rerr := g.opts.Selector.Record(node, err); rerr != nil {
return nil, rerr
}
return stream, err return stream, err
} }
@ -617,35 +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 {
var options client.PublishOptions 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
// fail early on connect error options := client.NewPublishOptions(opts...)
if !g.once.Load().(bool) {
if err := g.opts.Broker.Connect(); err != nil { // get proxy
return errors.InternalServerError("go.micro.client", err.Error()) exchange := ""
} if v, ok := os.LookupEnv("MICRO_PROXY"); ok {
g.once.Store(true) exchange = v
} }
for _, o := range opts { msgs := make([]*broker.Message, 0, len(ps))
o(&options)
}
md, ok := metadata.FromContext(ctx) omd, ok := metadata.FromOutgoingContext(ctx)
if !ok { if !ok {
md = make(map[string]string) omd = metadata.New(2)
} }
md["Content-Type"] = p.ContentType()
md["Micro-Topic"] = p.Topic() 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().(*raw.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())
} }
@ -658,78 +760,87 @@ 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(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 {
return "grpc" return "grpc"
} }
func (g *grpcClient) getGrpcDialOptions() []grpc.DialOption { func (g *grpcClient) Name() string {
if g.opts.CallOptions.Context == nil { return g.opts.Name
return nil }
func (g *grpcClient) getGrpcDialOptions(ctx context.Context) []grpc.DialOption {
var opts []grpc.DialOption
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
} }
func newClient(opts ...client.Option) client.Client { func NewClient(opts ...client.Option) client.Client {
options := client.NewOptions() 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
for _, o := range opts {
o(&options)
} }
rc := &grpcClient{ rc := &grpcClient{
opts: options, opts: options,
} }
rc.once.Store(false)
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
@ -737,25 +848,17 @@ func newClient(opts ...client.Option) client.Client {
c = options.Wrappers[i-1](c) c = options.Wrappers[i-1](c)
} }
rc.codecs = make(map[string]encoding.Codec, len(defaultGRPCCodecs))
for k, v := range defaultGRPCCodecs {
rc.codecs[k] = v
}
var codecs map[string]encoding.Codec
if rc.opts.Context != nil { if rc.opts.Context != nil {
if v := rc.opts.Context.Value(codecsKey{}); v != nil { if codecs, ok := rc.opts.Context.Value(codecsKey{}).(map[string]encoding.Codec); ok && codecs != nil {
codecs = v.(map[string]encoding.Codec) for k, v := range codecs {
rc.opts.Codecs[k] = &wrapGrpcCodec{v}
}
} }
} }
for k, v := range codecs { for _, k := range options.Codecs {
rc.codecs[k] = v encoding.RegisterCodec(&wrapMicroCodec{k})
} }
return c return c
} }
func NewClient(opts ...client.Option) client.Client {
return newClient(opts...)
}

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
@ -185,14 +180,13 @@ func (p *pool) release(addr string, conn *poolConn, err error) {
sp.idle++ sp.idle++
} }
p.Unlock() p.Unlock()
return
} }
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
} }
@ -203,10 +197,9 @@ func removeConn(conn *poolConn) {
conn.next = nil conn.next = nil
conn.in = false conn.in = false
conn.sp.count-- conn.sp.count--
return
} }
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 {
@ -215,5 +208,4 @@ func addConnAfter(conn *poolConn, after *poolConn) {
after.next = conn after.next = conn
conn.in = true conn.in = true
conn.sp.count++ conn.sp.count++
return
} }

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,
} }
} }
@ -74,7 +71,7 @@ func (g *grpcRequest) Endpoint() string {
return g.method return g.method
} }
func (g *grpcRequest) Codec() codec.Writer { func (g *grpcRequest) Codec() codec.Codec {
return g.codec return g.codec
} }

View File

@ -3,41 +3,39 @@ package grpc
import ( import (
"strings" "strings"
"github.com/unistack-org/micro/v3/codec" "go.unistack.org/micro/v3/codec"
"github.com/unistack-org/micro-codec-bytes" "go.unistack.org/micro/v3/metadata"
"google.golang.org/grpc" "google.golang.org/grpc"
"google.golang.org/grpc/encoding"
) )
type response struct { type response struct {
conn *poolConn conn *PoolConn
stream grpc.ClientStream stream grpc.ClientStream
codec encoding.Codec codec codec.Codec
gcodec codec.Codec
} }
// Read the response // Read the response
func (r *response) Codec() codec.Reader { func (r *response) Codec() codec.Codec {
return r.gcodec return r.codec
} }
// read the header // read the header
func (r *response) Header() map[string]string { func (r *response) Header() metadata.Metadata {
md, err := r.stream.Header() meta, err := r.stream.Header()
if err != nil { if err != nil {
return map[string]string{} return nil
} }
hdr := make(map[string]string, len(md)) md := metadata.New(len(meta))
for k, v := range md { for k, v := range meta {
hdr[k] = strings.Join(v, ",") md.Set(k, strings.Join(v, ","))
} }
return hdr return md
} }
// Read the undecoded response // Read the undecoded response
func (r *response) Read() ([]byte, error) { func (r *response) Read() ([]byte, error) {
f := &bytes.Frame{} f := &codec.Frame{}
if err := r.gcodec.ReadBody(f); err != nil { if err := r.codec.ReadBody(&wrapStream{r.stream}, f); err != nil {
return nil, err return nil, err
} }
return f.Data, nil return f.Data, nil

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()
}