1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-11-30 08:06:40 +02:00
Commit Graph

3623 Commits

Author SHA1 Message Date
helloword
ad532522ea
Config CORS (#2270)
* Added cors.config for CORS

* Added cors.config for CORS

* Added cors.config for CORS

Co-authored-by: 于海洋 <yhy@iothinking.com>
2021-09-17 10:17:12 +01:00
Christoffer Åström
4c7d2e28eb
test(api): fix randomly failing rpc test (#2268) 2021-09-13 21:56:36 +01:00
Branden Horiuchi
d78d35078c
Consul sync plugin (#2267)
* adding consul sync provider

* adding logging options

Co-authored-by: Branden Horiuchi <Branden.Horiuchi@blackline.com>
2021-09-13 19:08:05 +01:00
Johnson C
22409c8ff3
support hystrix filter (#2265) 2021-09-13 09:23:26 +01:00
binbin.zhang
6c3a5c161f
upgrade nacos sdk version (#2264)
Co-authored-by: binbin <binbin@didiglobal.com>
2021-09-12 22:16:46 +01:00
Niek den Breeje
fa27250605
Add generate kubernetes command (#2261) 2021-09-10 18:56:51 +01:00
Niek den Breeje
ac21bb5b19
Document Gomu's generator package (#2262) 2021-09-10 18:48:09 +01:00
Niek den Breeje
5b8d22a463
Add Kubernetes flag to new command (#2263)
To remain consistent with the Gomu's generate command, we add a
Kubernetes flag to Gomu's new command as well.
2021-09-10 18:47:55 +01:00
Niek den Breeje
56d5143557
Document Gomu's generate command (#2260) 2021-09-10 14:30:46 +01:00
Niek den Breeje
5772697752
Make generator package a first class citizen (#2259)
There's really no point in having the `generator` be embedded in a
`file` package so we remove the `file` package and make the `generator`
package a first class citizen instead.
2021-09-10 13:31:52 +01:00
Niek den Breeje
e23006b1a5
Generate Gomu files after the fact (#2258)
* Move file generation to new package

* Use text/template instead of html/template

* Make config variables more consistent

* Combine generate files and print comments there

* Add gomu generate command

* Refactor project templating to file library

* Determine client earlier
2021-09-10 13:20:57 +01:00
Niek den Breeje
01b7b4409b
Fix generating Dockerfile with Gomu (#2254)
Somehow I didn't test this and managed to forget to properly close a
template control structure. This change fixes that.
2021-09-08 14:43:52 +01:00
Niek den Breeje
0dd6afe128
Optimize Dockerfile generated by Gomu (#2253)
This change prevents having to rebuild the entire Docker image when your
source code changes.
2021-09-08 12:50:30 +01:00
Niek den Breeje
a36f52c6d2
Fix Gomu's call response (#2251)
Gomu expects a `map[string]string` type response back, but this isn't
always the case. When Gomu calls a service endpoint that responds with,
let's say, a key where its value is a map or a list, Gomu would be
unable to decode that response. By expecting a `map[string]interface{}`
type response, Gomu is able to decode those responses as well.
2021-09-08 08:30:53 +01:00
simon
440aa4a1ce
Add AuthCall wrapper func (#2250)
* Add grpc,memory,quic transport automatically discover

* Add grpc,memory,quic transport automatically discover

* Add jwt auth automatically discover

* Add jwt auth automatically discover

* Add config command option automatically discover

* Add AuthCall wrapper func
2021-09-07 07:13:56 +01:00
Niek den Breeje
f77c91b7ae
Simplify gomu cmd registering (#2249)
* Use internal runtime package for gomu run

This change refactors the `gomu run` command to use Go Micro's internal
runtime package in order to run services. Not only does this clean up
duplicate functionality between Go Micro and Gomu, but also adds the
feature to Gomu to run remote projects. For example, the following
command pulls in a remote project and runs it locally.

```bash
gomu run github.com/auditemarlow/helloworld
```

The `gomu run` command remains backwards compatible. By invoking `gomu
run` in a Go Micro project directory, Gomu will simply run that project.

* Simplify Gomu's command registering

By leveraging Go's `init()` function, we can simplify registering
commands just a tad.
2021-09-06 14:12:27 +01:00
Niek den Breeje
a58b8883f8
Use internal runtime package for gomu run (#2248)
This change refactors the `gomu run` command to use Go Micro's internal
runtime package in order to run services. Not only does this clean up
duplicate functionality between Go Micro and Gomu, but also adds the
feature to Gomu to run remote projects. For example, the following
command pulls in a remote project and runs it locally.

```bash
gomu run github.com/auditemarlow/helloworld
```

The `gomu run` command remains backwards compatible. By invoking `gomu
run` in a Go Micro project directory, Gomu will simply run that project.
2021-09-06 14:01:29 +01:00
simon
270d910b73
Add config command option automatically discover (#2246)
* Add grpc,memory,quic transport automatically discover

* Add grpc,memory,quic transport automatically discover

* Add jwt auth automatically discover

* Add jwt auth automatically discover

* Add config command option automatically discover
2021-09-04 07:17:21 +01:00
Niek den Breeje
77bf39f2cd
Fix client gRPC plugin (#2245)
The helloworld examples found in the `google.golang.org/grpc/examples`
package were imported multiple times as different versions, resulting in
package conflicts. By running `go mod tidy`, these conflicts are
resolved and the gRPC client plugin can now be imported again.
2021-09-03 14:16:56 +01:00
Niek den Breeje
c45073a308
Fix Skaffold pipelines for client projects (#2244)
* Update greeter references to helloworld

* Add new client command

With this change, Gomu users will be able to generate template projects
for clients to services. Additionally vendor support has been built in
so Gomu users can now generate projects using fully qualified package
names, for example:

```bash
gomu new service github.com/auditemarlow/helloworld
```

This will create a new service project `helloworld` with its module name
already set to `github.com/auditemarlow/helloworld`. Likewise, Gomu
users can then generate client projects in the same manner:

```bash
gomu new client github.com/auditemarlow/helloworld
```

This will create a `helloworld-client` project that uses the protobufs
found in the `github.com/auditemarlow/helloworld` service. This removes
at least some strain in configuring these module dependencies yourself;
you can just scaffold them outright from the start.

Although the default client project is highly opinionated, it works
straight out of the box and has Skaffold in mind. Gomu users should be
able to get going in a matter of seconds.

* Update README

* Fix Skaffold pipeline for generated client projects
2021-09-03 13:26:34 +01:00
Niek den Breeje
86de031adc
[WIP] Add new client cmd (#2243)
* Update greeter references to helloworld

* Add new client command

With this change, Gomu users will be able to generate template projects
for clients to services. Additionally vendor support has been built in
so Gomu users can now generate projects using fully qualified package
names, for example:

```bash
gomu new service github.com/auditemarlow/helloworld
```

This will create a new service project `helloworld` with its module name
already set to `github.com/auditemarlow/helloworld`. Likewise, Gomu
users can then generate client projects in the same manner:

```bash
gomu new client github.com/auditemarlow/helloworld
```

This will create a `helloworld-client` project that uses the protobufs
found in the `github.com/auditemarlow/helloworld` service. This removes
at least some strain in configuring these module dependencies yourself;
you can just scaffold them outright from the start.

Although the default client project is highly opinionated, it works
straight out of the box and has Skaffold in mind. Gomu users should be
able to get going in a matter of seconds.

* Update README
2021-09-03 12:33:10 +01:00
simon
80dbe51077
Add jwt auth automatically discover (#2242)
* Add grpc,memory,quic transport automatically discover

* Add grpc,memory,quic transport automatically discover

* Add jwt auth automatically discover

* Add jwt auth automatically discover
2021-09-03 07:49:49 +01:00
Johnson C
f444dadd50
fixing #2235 win10 install failed issue (#2239) 2021-09-03 07:49:39 +01:00
Christoffer Åström
e080791787
chore(gomu): tweak makefile template (#2238) 2021-09-02 18:24:28 +01:00
simon
a159598f36
Add grpc,memory,quic transport automatically discover (#2237)
* Add grpc,memory,quic transport automatically discover

* Add grpc,memory,quic transport automatically discover
2021-09-02 18:10:24 +01:00
Niek den Breeje
993e2f55bd
Add Kubernetes resources (#2236)
* Refact new command implementation

Everytime I want to add or modify files in the new command, I will have
to do so in 2 places. This change will consolidate functionality so
there's only a single place to modify.

* Move Kubernetes resources to its own file

* Add Kubernetes resources
2021-09-02 13:35:00 +01:00
Niek den Breeje
ed9053ed94
Add cache example (#2232) 2021-09-01 10:08:43 +01:00
Niek den Breeje
05a299b76c
Add simple in-memory cache (#2231)
* Add simple in-memory cache

* Support configuring cache expiration duration

* Support preinitializing cache with items

* Register cache
2021-08-31 15:31:16 +01:00
Asim Aslam
dd0a7746ff update the gomu gomod 2021-08-31 15:19:45 +01:00
Asim Aslam
088ccb5001
Update README.md 2021-08-31 09:27:36 +01:00
Niek den Breeje
4363678e48
Exit when help flag is provided on service run (#2225) 2021-08-31 09:13:35 +01:00
Niek den Breeje
9a77c06b44
Move from micro/cli/v2 to urfave/cli/v2 (#2224)
* Use urfave/cli/v2 instead of micro/cli/v2

Wherever possible we may want to eliminate the use of github.com/micro
imports.

* Fix broken cli test
2021-08-31 09:05:08 +01:00
Niek den Breeje
78bea87690
Add gomu CLI tool (#2223) 2021-08-30 15:48:57 +01:00
Johnson C
49eccbc85a
fixing proto3 optional unsupported error (#2213)
add supported features
2021-08-24 08:14:33 +01:00
Asim Aslam
7f1ebaa572
Update README.md 2021-08-23 16:45:04 +01:00
Qiu Yu
c7195aae98
Grpc server injection (#2208)
* plugin: update grpc server readme

* plugin: refactor gprc server test

This is a no-op change to enable test logic reuse for different
combinations.

* plugin: grpc server test Init after New

* plugin: allow grpc.Server to be injected
2021-08-12 18:26:26 +01:00
Arsen
ffb0a2f896
grpc client: fix grpc code to micro http status conversion for the fallback case with empty Details (#2206) 2021-08-12 12:15:49 +01:00
Qiu Yu
b977a51253
Examples: fix grpc config (#2207)
This change fixes grpc config example code which is currently broken.

Several pieces in the change:
- use yaml encoder to read config files
- rename *.yml to *.yaml to fix format (file suffix) for encoder lookup
- replace util/log package with logger as the former one is deprecated
2021-08-12 06:27:04 +01:00
dependabot[bot]
046d0785c9
Bump github.com/gin-gonic/gin from 1.6.3 to 1.7.0 in /examples (#2205)
Bumps [github.com/gin-gonic/gin](https://github.com/gin-gonic/gin) from 1.6.3 to 1.7.0.
- [Release notes](https://github.com/gin-gonic/gin/releases)
- [Changelog](https://github.com/gin-gonic/gin/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gin-gonic/gin/compare/v1.6.3...v1.7.0)

---
updated-dependencies:
- dependency-name: github.com/gin-gonic/gin
  dependency-type: direct:production
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-11 13:57:15 +01:00
Qiu Yu
828d3f2b74
loader: avoid overwriting values if error happens (#2204) 2021-08-11 13:33:58 +01:00
Qiu Yu
a46dc0b856
Add yaml config example (#2203)
* examples: add yaml config

* examples: update go mod for yaml plugin
2021-08-11 13:31:29 +01:00
Johnson C
3e0411a3f6
fixing mem.pprof issue: (#2198)
parsing profile: concatenated profiles detected
fixing web service not start profile issue
fixing no default profile options issue
2021-08-04 09:39:01 +01:00
bacndcmc
c3107e6843
fix code proto return invalid message (#2196)
Co-authored-by: ben <norton0395@gmail.com>
2021-07-26 06:25:21 +01:00
Asim Aslam
e1bc7e3028
Update README.md 2021-07-21 09:06:34 +01:00
Asim Aslam
992418236e
Update README.md 2021-07-21 09:05:38 +01:00
Asim Aslam
27a792790b
Update README.md 2021-07-21 09:05:20 +01:00
Asim Aslam
bd9821111e remove tidy file 2021-07-19 17:57:33 +01:00
Asim Aslam
dbba07e7ed
Delete tidy.md 2021-07-19 17:55:08 +01:00
xshytikx
753022d2ae
fix: imported and not used (log, os) (#2195)
github.com/asim/go-micro/plugins/registry/consul/v3@v3.0.0-20210716165540-546225f1d8db/watcher.go:5:2: imported and not used: "log"
github.com/asim/go-micro/plugins/registry/consul/v3@v3.0.0-20210716165540-546225f1d8db/watcher.go:5:2: imported and not used: "log"
2021-07-18 07:18:11 +01:00
JeffreyBool
546225f1d8
Not Recommended Function Correction (#2194)
* Update http.go

Exit before deregister is executed

* Create http.go

Exit before deregister is executed

* Solve the problem that the resources have not been fully released due to early exit

* Optimize some code

* Optimize some code

* Optimize some code

* fix service default logger

* Not Recommended Function Correction
2021-07-16 17:55:40 +01:00