1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-12-12 08:23:58 +02:00
Commit Graph

180 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
Johnson C
7f1de77e8c
try fixing staticcheck warning (#2190)
https://github.com/golang/protobuf/issues/1077
package github.com/golang/protobuf/proto is deprecated: Use the "google.golang.org/protobuf/proto" package instead.  (SA1019)
2021-07-06 12:51:28 +01:00
Jerry
93ba8cd0df
continue fix pre version go get bug that unknown v3.5.1 (#2188)
* 1.fix plugins go get bug.
2.update all mode.
3.add tidy tools

* continue fix pre version go get bug that unknown v3.5.1
2021-06-30 09:24:00 +01:00
Jerry
c13bb07171
1.fix plugins go get bug. (#2187)
2.update all mode.
3.add tidy tools
2021-06-30 07:21:03 +01:00
Jerry
4929a7c16e
update etcd version (#2186)
Remove missing gRPC example from README.md (#2112)

Delete docker.yml

Delete Dockerfile

update plugins version & remove replace (#2118)

* update memory registry plugins version & remove replace

* update plugins version & remove replace

Co-authored-by: 申法宽 <shenfakuan@163.com>

update client/grpc plugins version & remove replace (#2119)

* update memory registry plugins version & remove replace

* update plugins version & remove replace

* update plugins/client/grpc/v3 version

Co-authored-by: 申法宽 <shenfakuan@163.com>

update etcd version (#2120)

update mod version

update

update pulgin registry mod version (#2121)

* update etcd version

* update mod version

* update

fix store delete

support for tls on http plugin (#2126)

improve code quality (#2128)

* Fix inefficient string comparison

* Fix unnecessary calls to Printf

* Canonicalize header key

* Replace `t.Sub(time.Now())` with `time.Until`

* Remove unnecessary blank (_) identifier

* Remove unnecessary use of slice

* Remove unnecessary comparison with bool

Update README.md

Update README.md

remove network package

update quic go mod

remove indirects

update etcd mod version

Update registry plugins mod version (#2130)

* update etcd version

* update mod version

* update

* update etcd mod version

Update README.md

Update README.md

Update README.md

fixing etcd stack in getToken (#2145)

when provide username and password, etcd will try to get auth token from server
if server is unavailble, etcd client will stack in
when dial timeout is set, it will return err instead of stack in

Update README.md

add http demo; http client can call http server; http client can call rpc server (#2149)

Add etcd to default registries when plugin is loaded (#2150)

Co-authored-by: Andrew Jones <andrew@gotoblink.com>

Update README.md

make rpcClient compatible with 32bit arm systems (#2156)

On ARM, 386, and 32-bit MIPS, it is the caller's responsibility to
arrange for 64-bit alignment of 64-bit words accessed
atomically. Only the first word in an allocated struct can
be relied upon to be 64-bit aligned.

optimize the process of switching grpc error to micro error (#2158)

Fix util/log/log.Infof format didn't work (#2160)

Co-authored-by: Cui Gang <cuigang@yunpbx.com>

fixing string field contains invalid UTF-8 issue (#2164)

fix k8s api memory leak (#2166)

fix http No release Broker (#2167)

* Update http.go

Exit before deregister is executed

* Create http.go

Exit before deregister is executed

fix: "Solve the problem that the resources have not been fully released due to early exit" (#2168)

* 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

fix service default logger (#2171)

* 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

Update README.md

get k8s pod (#2173)

Update README.md

fix:field (#2176)

* get k8s pod

* fix: filed

* field

Update README.md

add rmq message properties (#2177)

Co-authored-by: dtitov <dtitov@might24.ru>

Update README.md

grpc server add RegisterCheck (#2178)

fix 404 bug (#2179)

fix undefined: err (#2181)

Add registry and config/source plugins based on nacos/v2 (#2182)

* Add registry plugins implement by nacos/v2

* Add config/source plugins implement by nacos/v2

support hystrix fallback (#2183)

Windows event log plugin (#2180)

* add rmq message properties

* eventlog start

* start eventlog

* windows event logger

* readme

* readme

Co-authored-by: dtitov <dtitov@might24.ru>

support etcd auth with env args (#2184)

* support etcd auth with env args
set default registry address with env arg instead of 127.0.0.1

* fixing MICRO_REGISTRY_ADDRESS may empty issue

update mod version
2021-06-29 13:40:54 +01:00
Asim Aslam
60010e82e2 update protoc-gen-micro 2021-01-20 21:36:17 +00:00
Asim Aslam
d94936f6c9
v3 (#2104)
* v3

* revert plugins

* fixup some issues
2021-01-20 13:54:31 +00:00
Asim Aslam
a7c31a0d2b refactor all the things 2020-12-29 15:49:26 +00:00
Asim Aslam
f44b832bac
Update README.md 2020-12-26 15:23:06 +00:00
Asim Aslam
f8fc9d0304 Add protoc-gen-micro 2020-12-26 15:13:09 +00:00
Asim Aslam
4ce77373c0 remove auth cruft 2020-12-12 20:44:32 +00:00
Asim Aslam
df687fe5d4 move selector 2020-12-12 20:14:50 +00:00
Asim Aslam
0ec2399a2c fix command 2020-12-12 19:39:04 +00:00
Asim Aslam
4977aca09c move router 2020-12-12 19:04:19 +00:00
Asim Aslam
43ff2a540d move proxy 2020-12-12 19:02:04 +00:00
Asim Aslam
dbe8c93e20
remove service implementations (#2094) 2020-12-11 11:12:44 +00:00
Asim Aslam
e761aa1940 move cmd 2020-12-09 18:07:01 +00:00
Asim Aslam
c350e19552 Move cmd => config/cmd 2019-06-21 13:36:11 +01:00
Asim Aslam
97cf2cd7c3 go fmt 2019-06-18 11:04:06 +01:00
Asim Aslam
ed4bce3285 check in this cruft 2019-06-08 19:40:44 +01:00
Asim Aslam
eec9a95a42
Merge pull request #485 from micro/grpc
Add grpc transport
2019-06-03 18:48:13 +01:00
Asim Aslam
aeeb2b0010
Merge pull request #489 from micro/nats
Add nats broker as a default
2019-05-31 13:12:38 +01:00
Asim Aslam
4035ab5c7b Change go-log links 2019-05-31 00:38:05 +01:00
Asim Aslam
1200386097 Add nats broker as a default 2019-05-29 16:46:57 +01:00
Asim Aslam
25a0d05ac9 Add grpc transport 2019-05-24 17:15:59 +01:00
tongjichao
fd2ca3a13a
fix: client retries will be 0 when not set
fix: client retries will be 0 when not set
2019-04-19 00:05:02 +08:00
Asim Aslam
539b8c1a3b Move RegisterInterval into the server 2019-01-24 13:22:17 +00:00
Asim Aslam
7314af347b Set MDNS as default registry 2019-01-15 16:50:37 +00:00
Asim Aslam
39c24baca9 rename mock things to memory 2019-01-14 15:27:25 +00:00
Asim Aslam
4cb41721f1 further codec changes 2019-01-08 15:38:25 +00:00
Asim Aslam
d519180806
Merge branch 'master' into dns 2019-01-07 13:52:37 +00:00
Asim Aslam
f9da55e8a9 Add dns selector 2019-01-07 07:41:26 +00:00
Asim Aslam
4692af4393 Add static selector 2019-01-06 21:12:02 +00:00
Asim Aslam
5cae330732 Update selector race, rename cache selector 2018-12-29 15:44:51 +00:00
Asim Aslam
b343420af6 update the gossiper 2018-12-06 18:19:05 +00:00
Asim Aslam
72d8dc89fb add cmd and bug fix 2018-12-04 17:22:20 +00:00
Anton Kucherov
156a51ab10 fix bug with go-config panic
See: https://github.com/micro/go-config/issues/49
2018-09-13 19:02:08 +03:00
Asim Aslam
9968c7d007 Add Init to all things, use init in cmd package to initialise 2018-08-08 18:57:29 +01:00
武新飞
39be61685c client_retries can be 0 2018-07-20 14:20:23 +08:00
Asim Aslam
5372707d0e Strip flag setting 2018-05-30 11:49:50 +01:00
Asim Aslam
956b1c6867 set register ttl and interval by default 2018-05-29 12:28:55 +01:00
Asim Aslam
56735b4427 add flags for register ttl and interval 2018-04-06 14:03:39 +01:00
Asim Aslam
c9b40cb33b switch to stdlib context 2018-03-03 11:53:52 +00:00
Asim Aslam
8fd8d9bd35 Enable connection pooling and selector caching by default 2017-10-24 15:35:25 +01:00
xueyun.liu
4edb8650e5 fix version option in cmd 2017-05-09 15:49:59 +08:00
Asim Aslam
71d717a06d strip doc.go files 2016-12-14 15:41:48 +00:00
Asim
20feb95e18 Add the ability to switch out client/server 2016-11-18 17:29:26 +00:00
Asim
3d922b82d1 MQTT broker has been moved to go-plugins 2016-10-01 16:56:09 +01:00
Asim
7640a76d88 Change help messages 2016-06-28 22:41:44 +01:00
Asim
89401cbb95 Make pool configurable 2016-06-07 00:46:14 +01:00
Asim
1254a87286 Add package comments 2016-05-24 22:22:46 +01:00
Asim
63c6e82192 Strip blacklist 2016-05-06 23:18:47 +01:00
Asim
ba391e228c Add default to selector list 2016-05-05 21:14:57 +01:00
Asim
818d500f98 Fix compile error 2016-05-03 22:11:42 +01:00
Asim
5b94e4672d Failed to gofmt 2016-04-30 00:20:05 +01:00
Asim
6c108d95b2 First attempt at mdns 2016-04-27 18:21:05 +01:00
Asim
04e0864df4 Add the link to cmd 2016-04-26 18:54:35 +01:00
Asim
e8b5cebb52 Remove that link 2016-04-26 18:52:17 +01:00
Asim
3d3044404e Don't add to defaults in func init, just add them to cmd 2016-04-26 18:49:02 +01:00
Asim
eecdeaae99 Fix the mqtt broker connect. Add to default brokers in cmd 2016-04-23 00:38:45 +01:00
Asim
844979be06 Add flags client request timeout and client retries 2016-03-29 17:18:39 +01:00
Asim
5a6ff655db Transport init 2016-03-15 22:25:32 +00:00
Asim
f088074f29 Registry init 2016-03-15 22:20:21 +00:00
Asim
64220dc0c5 Broker init 2016-03-15 22:12:28 +00:00
Asim
d1eae8fabe remove use of glog 2016-03-14 11:01:10 +00:00
Asim
ef1b9bfe50 Allow setting registry address, broker address and transport address without specifying registry flag 2016-01-27 01:13:31 +00:00
Asim
8724e68ae4 Initialise registry for broker 2016-01-20 15:22:44 +00:00
Asim
8bf72a3325 Replace map[string]string with Context for extra options. map[string]string is essentially useless. Context can store anything 2016-01-06 16:25:12 +00:00
Asim
bdab0cc18f Fuck my life, why do I even do this to myself 2016-01-04 23:27:54 +00:00
Asim
897115ed31 Fix some issues with initialisation 2016-01-04 23:07:56 +00:00
Asim
9ecbf0d71b Let me do some stuff with the global command 2016-01-04 11:25:58 +00:00
Asim
3b56a62589 Update the way flags are used 2016-01-02 19:12:17 +00:00
Asim
1f1bc27421 Make command internal 2016-01-02 00:38:57 +00:00
Asim
59a667130c Update help printer 2016-01-01 02:45:15 +00:00
Asim
0d50b2eb32 Update top level init 2016-01-01 01:16:21 +00:00
Asim
c2154fd5cc Remove the ping 2015-12-31 18:11:26 +00:00
Asim
4f15d823c9 go fmt 2015-12-25 01:06:32 +00:00
Asim
8f3f0ed4b6 Merge pull request #33 from iheitlager/master
Reverse the ping option
2015-12-24 11:48:17 +00:00
Asim
c3e9ba6b85 Allow setting of actions 2015-12-23 22:45:40 +00:00
Ilja Heitlager
d747e9b435 Reverse the ping option 2015-12-23 21:43:49 +01:00
Asim
2753520ee4 Add command option 2015-12-09 19:32:10 +00:00