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

366 Commits

Author SHA1 Message Date
Elmut
ca6190f5f2
append to subscribers (#2640)
* append to subscribers

* Update rpc_router.go

error correction log
2023-11-26 11:08:28 +01:00
Lukasz Raczylo
a7522e7d6c
fix: struct field alignment (#2632) 2023-04-26 02:16:34 +02:00
David Brouwer
a3980c2308
feat: add test framework & refactor RPC server (#2579)
Co-authored-by: Rene Jochum <rene@jochum.dev>
2022-10-20 13:00:50 +02:00
Rene Jochum
010b1d9f11
fix: linting issues (#2566) 2022-09-30 20:32:55 +02:00
David Brouwer
85c0b0b8eb
fix: some linting issues (#2563) 2022-09-30 16:27:07 +02:00
Mohamed MHAMDI
1db36357d5
feat(logger): add logger option to all micro components (override DefaultLogger) closes #2556 (#2559)
* feat(logger): add logger option to all components

* fix: refactor api/rpc.go

* fix: refactor api/stream.go

* fix: api/options.go comment

* fix(logger): do not use logger.Helper internally

* fix(logger): fix comments

* fix(logger): use level.Enabled method

* fix: rename mlogger to log

* fix: run go fmt

* fix: log level

* fix: factories

Co-authored-by: Mohamed MHAMDI <mmhamdi@hubside.com>
Co-authored-by: Davincible <david.brouwer.99@gmail.com>
2022-09-29 16:44:53 +02:00
Arvin
63a9b94820
support use of listen options (#2536)
* feat: support use of listen options

* style: Adjust the import order of packages.
2022-07-30 10:56:14 +01:00
David Brouwer
107bd74187
fix: allow event subscribers to use pointers (#2514)
When a subscriber would use a pointer as event type, panics would occur.
2022-06-22 09:01:13 +08:00
bosima
1919048c8f
Support direct generation of grpc method (#2474)
* Support direct generation of grpc method when package and service names of proto files are different.
* fix req.Interface() return nil.
2022-04-10 22:12:39 +08:00
Johnson C
a40f6e8fae
[fix] fixing f.IsExported undefined issue (#2382)
IsExported needs go1.17, replace with PkgPath
2021-12-07 17:30:48 +08:00
Johnson C
90b3e4af0b
[fix] ignore unexported field (#2354)
ignore unexported field when register endpoints
2021-11-18 17:07:00 +08:00
Asim Aslam
0c2041e439
add events package (#2341)
* add events package

* update go version
2021-11-08 08:52:39 +00:00
Asim Aslam
1cd7cfaa6c
go-micro.dev/v4 (#2305) 2021-10-12 12:55:53 +01:00
JeffreyBool
acc3f5479f
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
2021-05-23 08:38:20 +01:00
Asim Aslam
d94936f6c9
v3 (#2104)
* v3

* revert plugins

* fixup some issues
2021-01-20 13:54:31 +00:00
Asim Aslam
eb1e22bd10 strip grpc 2020-12-30 08:21:30 +00:00
Asim Aslam
a7c31a0d2b refactor all the things 2020-12-29 15:49:26 +00:00
Asim Aslam
35c59042bf refactor network 2020-12-12 18:59:40 +00:00
Di Wu
3e6ac73cfe Fix invalid usage for sync.WaitGroup (#1752)
* Custom private blocks

* Fix invalid usage for sync.WaitGroup

Co-authored-by: Asim Aslam <asim@aslam.me>
2020-07-03 11:30:59 +01:00
ben-toogood
8dfd93e915 util/wrapper: Add Static Client wrapper (#1685)
* util/wrapper: Add Static Client wrapper

* util/wrapper/static: pass address to stream too

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* add static client wrapper tests

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* server: fix error message spaces between words

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* server/{rpc,grpc}: replace log.Error with log.Errorf

* server/grpc: fix log typo

* server/rpc: fix log typo

Co-authored-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-06-12 10:42:52 +01:00
Ben Toogood
2729569f66 Add Debug.Cache method 2020-05-24 18:45:57 +01:00
Asim Aslam
a29676b86a
Registration Retry / Interval (#1651)
* Change the default ttl to 90 seconds

* add retries to registration

* Add retry to web register
2020-05-20 11:49:09 +01:00
Asim Aslam
19a03babc4
Update server.go 2020-05-12 11:32:01 +01:00
Janos Dobronszki
1eb63635b5
Adding file upload and download capabilities (#1610) 2020-05-11 14:08:27 +02:00
Ben Toogood
506006f0fa Auth Options 2020-05-11 11:47:59 +01:00
Socket
46d09ec2bc
unsubscribe can async (#1596)
Co-authored-by: huangshaojie <huangshaojie@corp.netease.com>
Co-authored-by: Asim Aslam <asim@aslam.me>
2020-04-30 10:42:13 +01:00
Vasiliy Tolstov
d44adafca5
api/router: avoid unneeded loops and fix path match (#1594)
* api/router: avoid unneeded loops and fix path match

* if match found in google api path syntax, not try pcre loop
* if path is not ending via $ sign, append it to pcre to avoid matching other strings like
  /api/account/register can be matched to /api/account
* api: add tests and validations

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-04-29 15:23:10 +03:00
Asim Aslam
7345ce9192 change logging for service startup 2020-04-23 11:24:39 +01:00
Vasiliy Tolstov
bea092f082
server: set registered only after configuring subscribers (#1557)
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-04-21 23:01:59 +03:00
Janos Dobronszki
075d7d4fef
Renaming ShutdownSignals -> Shutdown (#1553) 2020-04-21 14:14:20 +02:00
Janos Dobronszki
e5c215556e
Add SIGKILL to shutdown signals (#1552)
* Add SIGKILL to shutdown signals

* go mod tidy

* Add missing file
2020-04-21 14:00:12 +02:00
Vasiliy Tolstov
4d177a782e
vendor proto files from google (#1536)
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-04-15 13:22:32 +03:00
Vasiliy Tolstov
268651df18
regenerate all proto based files (#1531)
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-04-14 16:25:09 +03:00
Asim Aslam
1768958af7 fix typo 2020-04-08 22:50:56 +01:00
Vasiliy Tolstov
1fbc056dd4
minimize allocations (#1472)
* server: minimize allocations on re-register

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* server: stop old instance before Init()

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* client/grpc: fix allocations in protobuf marshal

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* codec/json: fix allocations in protobuf marshal

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* remove stop from init

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* codec/grpc: expose MaxMessageSize

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* codec: use buffer pool

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* metadata: minimize reallocations

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* util/wrapper: use metadata helper

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* registry/cache: move logs to debug level

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* server: move logs to debug level

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* server: cache service only when Advertise is ip addr

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* server: use metadata.Copy

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-04-08 10:50:19 +01:00
Ben Toogood
a9c0e043d2 Fix nil grpc server auth bug 2020-04-03 12:50:50 +01:00
Ben Toogood
49a568e9c0 Set default server auth 2020-04-03 12:33:19 +01:00
Vasiliy Tolstov
9e6db79860
regenerate all proto (#1440)
* regenerate all proto

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* regenerate from proto

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* regenerate from proto

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-03-30 21:58:32 +01:00
Vasiliy Tolstov
3d7d5ce6b4
api: add static router and improve path parser in rpc handler (#1437)
* api: add static router and improve path parser in rpc handler

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* expose metadata context key to be able to get unmodified map keys

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* server/grpc: fix jsonpb codec for protobuf msg

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* api/handler/rpc: write 204 status code when rsp is nil

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* api/handler/rpc: add check for nil response for non javascript

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-03-30 09:04:59 +01:00
Asim Aslam
7182ca1fd0
fix server logging (#1417) 2020-03-26 13:08:06 +00:00
0987363
87617be227
Add client header to rpcRequest header; issue #957 (#1378)
Co-authored-by: Asim Aslam <asim@aslam.me>
2020-03-21 23:25:23 +00:00
Vasiliy Tolstov
ab73127063
grpc client/server fixes (#1355)
* grpc client/server fixes

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-03-17 14:27:20 +03:00
Vasiliy Tolstov
609f4826b3
server: remove duplicate code (#1346)
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-03-13 22:15:09 +00:00
Vasiliy Tolstov
fbde872e7f
Revert "server/grpc: fix ordering of register and check for registered (#1338)" (#1341)
This reverts commit 62a644ddd8.
2020-03-13 09:30:44 +00:00
Vasiliy Tolstov
62a644ddd8
server/grpc: fix ordering of register and check for registered (#1338)
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-03-12 22:04:11 +00:00
Vasiliy Tolstov
7b385bf163
minimize allocations in logger and tunnel code (#1323)
* logs alloc

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* fix allocs

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* fix allocs

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* tunnel allocs

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* try to fix tunnel

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* cache cipher for send

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* more logger

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* more logger

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* more logger

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* more logger

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* more logger

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* more logger

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* more logger

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-03-11 17:55:39 +00:00
Vasiliy Tolstov
8ee5607254
[WIP]: broker ErrorHandler option (#1296)
* broker ErrorHandler option

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* rewrite Event interface, add error

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* implement new interface

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* change ErrorHandler func to broker.Handler

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* fix

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-03-06 21:25:16 +00:00
Jake Sanders
a851b9db7a
Comment typo in gRPC subscriber (#1304) 2020-03-05 14:55:46 +00:00
Vasiliy Tolstov
d807dac2a7
server/grpc: avoid panic in case of nil Header (#1303)
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-03-05 17:45:31 +03:00
Vasiliy Tolstov
ce2ba71002
server: subscribe to topic with own name if router not nil (#1295)
* server: subscribe to topic with own name if router not nil

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-03-05 10:29:50 +03:00