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

3766 Commits

Author SHA1 Message Date
Eng Zer Jun
cbd45b12dc
Avoid allocations with (*regexp.Regexp).MatchString (#2679)
We should use `(*regexp.Regexp).MatchString` instead of
`(*regexp.Regexp).Match([]byte(...))` when matching string to avoid
unnecessary `[]byte` conversions and reduce allocations.

func BenchmarkMatch(b *testing.B) {
	for i := 0; i < b.N; i++ {
		if match := versionRe.Match([]byte("v1")); !match {
			b.Fail()
		}
	}
}

func BenchmarkMatchString(b *testing.B) {
	for i := 0; i < b.N; i++ {
		if match := versionRe.MatchString("v1"); !match {
			b.Fail()
		}
	}
}

goos: linux
goarch: amd64
pkg: go-micro.dev/v4/api/handler/event
cpu: AMD Ryzen 7 PRO 4750U with Radeon Graphics
BenchmarkMatch-16          	11430127	       127.4 ns/op	       2 B/op	       1 allocs/op
BenchmarkMatchString-16    	12220628	        97.54 ns/op	       0 B/op	       0 allocs/op
PASS
ok  	go-micro.dev/v4/api/handler/event	3.822s

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2023-12-04 16:00:01 +00:00
guangwu
252385e39c
chore: replace for loop with call to copy (#2678) 2023-11-30 11:18:05 +00:00
ChengDaqi2023
68c026c5d8
update golang.org/x/net v0.8.0 to 0.17.0 (#2677) 2023-11-29 10:24:36 +00:00
Elmut
ca6190f5f2
append to subscribers (#2640)
* append to subscribers

* Update rpc_router.go

error correction log
2023-11-26 11:08:28 +01:00
Guillaume Bour
674b9822e0
util/addr: Fixes findIP to return public IP if present. (#2673) 2023-11-26 11:06:55 +01:00
Christian Richter
7392705af8
bump urfave cli & fix race condition (#2659)
* bump urfave cli

Signed-off-by: Christian Richter <crichter@owncloud.com>

* Fix race condition

Co-authored-by: André Duffeck <andre.duffeck@firondu.de>

Signed-off-by: Christian Richter <crichter@owncloud.com>

---------

Signed-off-by: Christian Richter <crichter@owncloud.com>
2023-10-09 10:33:57 +01:00
Asim Aslam
27c488712e
Update README.md (#2652) 2023-08-07 09:46:15 +01:00
Asim Aslam
c3d7c65c88
Update README.md (#2650) 2023-07-20 07:49:53 +01:00
Asim Aslam
384814c885
Update README.md (#2648) 2023-07-17 09:33:34 +01:00
Asim Aslam
8a3a98a8b8
Update README.md (#2647) 2023-07-16 12:02:53 +01:00
asim
416f65e814 rename test dir 2023-07-11 09:25:35 +01:00
clearcode
8020303017
Update README.md (#2635) 2023-05-06 21:39:24 +02:00
mamadeusia
67d48b205e
Add Context in event options (#2634)
Co-authored-by: mamadeusia <timadues7775@gmail.com>
2023-05-03 13:24:36 +01:00
dependabot[bot]
31135d4696
Bump github.com/docker/docker from 20.10.7+incompatible to 20.10.24+incompatible (#2625)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-26 02:22:47 +02:00
Coder
1478a8e46d
fix(config/source/cli): mergo.Map error, src and dst must be of same … (#2628) 2023-04-26 02:21:08 +02:00
Mohamed MHAMDI
ad8fca255b
fix(config): fix file source watcher stop behavior when Stop is called (#2630)
Co-authored-by: Mohamed MHAMDI <mmhamdi@hubside.com>
2023-04-26 02:19:52 +02:00
Lukasz Raczylo
a7522e7d6c
fix: struct field alignment (#2632) 2023-04-26 02:16:34 +02:00
Asim Aslam
0f9b2f00c9
Update README.md 2023-04-12 11:09:56 +01:00
Asim Aslam
7fe95e8732
Update README.md 2023-04-12 11:09:40 +01:00
Asim Aslam
d44ed328d1
Add Handle option (#2627) 2023-04-11 10:29:03 +01:00
Thomas Chandelle
d392e72021
fix(api/handler): avoid zombie goroutine when connection unexpectedly closes (#2624) 2023-04-05 22:50:24 +02:00
dependabot[bot]
683e2729b4
Bump github.com/opencontainers/runc from 1.1.4 to 1.1.5 (#2623)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-30 20:19:21 +02:00
asim
6f8930926f gofmt 2023-03-22 16:42:54 +00:00
Asim Aslam
2117672933
Update FUNDING.yml 2023-03-21 20:51:42 +00:00
Asim Aslam
d7e692b5d1
Update README.md 2023-03-21 15:19:07 +00:00
asim
d949258b2f update the logo 2023-03-20 16:48:44 +00:00
fuyou
d376656528
fix(sec): upgrade github.com/containerd/containerd to 1.6.18 (#2617)
* update github.com/containerd/containerd v1.4.3 to 1.6.18

* fix(sec): upgrade containerd

* fix(sec): go mod tidy

---------

Co-authored-by: Davincible <david.brouwer.99@gmail.com>
2023-03-07 17:28:22 +01:00
dependabot[bot]
415b3e3a2f
Bump golang.org/x/net from 0.0.0-20210510120150-4163338589ed to 0.7.0 (#2615)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.0.0-20210510120150-4163338589ed to 0.7.0.
- [Release notes](https://github.com/golang/net/releases)
- [Commits](https://github.com/golang/net/commits/v0.7.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-07 17:11:10 +01:00
Hellis
e337eb2c3d
fix(api): add WithRegistry option for api (#2618) 2023-03-07 17:05:25 +01:00
dependabot[bot]
521e6b644c
Bump golang.org/x/crypto from 0.0.0-20210513164829-c07d793c2f9a to 0.1.0 (#2619)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.0.0-20210513164829-c07d793c2f9a to 0.1.0.
- [Release notes](https://github.com/golang/crypto/releases)
- [Commits](https://github.com/golang/crypto/commits/v0.1.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-07 17:04:20 +01:00
Stanislav
ad0b4f103d
feat(errors): append errors use variadic arguments (#2606) 2023-01-03 12:58:03 +01:00
Davincible
68a6425ad8
fix(service): profile stop error scope 2022-11-16 05:07:41 +01:00
leoujz
0a91ba7b5d
api gateway handing http request adds Content-Type application/x-www-form-urlencoded, and extract endpoints from path if no endpoint matched (#2592)
Co-authored-by: l <l@x>
2022-11-09 04:28:39 +01:00
645775992
a17eaf64da
update gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b to 3.0.0 (#2589) 2022-11-04 12:06:13 +01:00
645775992
6df085fd6d
update github.com/opencontainers/runc v0.1.1 to 1.1.2 (#2590) 2022-11-04 12:05:41 +01:00
David Brouwer
697ea1b21e
Update README.md 2022-11-02 21:45:35 +01:00
JellyTony
b442dbb56b
fix: fix configuration version data competition (#2586)
Co-authored-by: JeffreyBool <zhanggaoyuan@mediatrack.cn>
2022-10-26 12:12:44 +02:00
Sagan Yaroslav
b988a78bae
fix: store table initialization (#2584) 2022-10-20 14:59:08 +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
keepstep
c25dee7c8a
fix(registry/cache): do not watch when ttl=0 eg: some custom registry no s… (#2580)
Co-authored-by: keep <keep@pa.com>
2022-10-08 15:19:48 +02:00
Rene Jochum
24dfcef49a
fix(transport/memory): Improve the memory transport, 4x speed (#2581) 2022-10-07 23:54:09 +02:00
Rene Jochum
065f9714e9
fix: easy lint fixes to api/ (#2567) 2022-10-01 10:50:11 +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
David Brouwer
47e6a8d725
feat(CI): add linting and pretty test output (#2562) 2022-09-30 02:08:42 +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
David Brouwer
57a0ef5a0f
docs: update README shields (#2558)
* docs: add badges to README.md

* docs: new discord badge

* docs: update discord badge

* docs: update discord badge

* docs: remove shield
2022-09-24 03:40:48 +02:00
Mohamed MHAMDI
39e00f11a8
feat(config): add withFs option to file source (#2557)
Co-authored-by: Mohamed MHAMDI <mmhamdi@hubside.com>
2022-09-24 02:46:18 +02:00
David Bereza
34b6434791
fix: prevent returning empty strings for list (#2553) 2022-09-06 20:03:23 +01:00
Asim Aslam
a702a1b097
Update README.md 2022-08-17 10:02:52 +01:00