* fix: remove deprecated rand.Seed calls
Go 1.20+ automatically seeds the global random number generator.
These calls are no-ops and generate warnings with newer Go versions.
Removed from:
- selector/strategy.go
- registry/cache/cache.go
- broker/memory.go
- broker/http.go
- cmd/cmd.go
- transport/memory.go
Co-authored-by: Shelley <shelley@exe.dev>
* fix: handle previously ignored errors
- MySQL store: properly handle prepared statement errors in initDB()
- Consul registry: handle client creation errors in Client() method
These silent failures could cause hard-to-debug issues in production.
Co-authored-by: Shelley <shelley@exe.dev>
* feat(genai): improve provider interface with context and streaming
Breaking changes:
- Generate() and Stream() now require context.Context as first parameter
- Stream.Close() added for proper resource cleanup
Improvements:
- Proper context support for cancellation and timeouts
- Real SSE streaming for OpenAI and Gemini text generation
- Better error handling with wrapped errors and API error responses
- Thread-safe provider registry with sync.RWMutex
- New options: WithMaxTokens, WithTemperature, WithTimeout
- Stream has proper Close() method for cleanup
- Results can include Error field for per-chunk errors
Provider updates:
- OpenAI: true streaming with SSE parsing, proper HTTP client with timeout
- Gemini: true streaming with streamGenerateContent endpoint
- Default model updated to gpt-4o-mini (OpenAI) and gemini-2.0-flash (Gemini)
Co-authored-by: Shelley <shelley@exe.dev>
* feat(tls): make TLS secure by default, configurable via environment
BREAKING: TLS now verifies certificates by default. Set MICRO_TLS_INSECURE=true
to restore previous behavior (NOT recommended for production).
Changes:
- Add util/tls.Config(), SecureConfig(), InsecureConfig(), ConfigFromEnv() helpers
- Update all components to use ConfigFromEnv() instead of hardcoded InsecureSkipVerify
- Set MinVersion to TLS 1.2 for all TLS configs
Affected components:
- broker/http
- broker/rabbitmq
- registry/etcd
- registry/consul
- transport/grpc
This improves security posture while allowing opt-out for development environments.
Co-authored-by: Shelley <shelley@exe.dev>
* feat(tls): add TLS helpers with opt-in secure mode
NOT a breaking change - keeps InsecureSkipVerify=true as default for
local development compatibility.
New util/tls helpers:
- Config() - returns config based on MICRO_TLS_SECURE env var
- SecureConfig() - certificate verification enabled
- InsecureConfig() - certificate verification disabled (dev only)
For production security, use one of:
- Set MICRO_TLS_SECURE=true with proper CA-signed certs
- Use a service mesh (Istio, Linkerd) for automatic mTLS
- Configure TLSConfig directly with your certificates
Also: Changed CLI alias from 'g' to 'gen' for clarity
- micro generate handler -> micro gen handler
Co-authored-by: Shelley <shelley@exe.dev>
* refactor(cli): rename generate directory to gen for consistency
Directory name now matches the command alias:
cmd/micro/cli/gen/ -> micro gen handler
Co-authored-by: Shelley <shelley@exe.dev>
---------
Co-authored-by: Shelley <shelley@exe.dev>
* genai interface
* x
* x
* text to speech
* Re-add events package (#2761)
* Re-add events package
* run redis as a dep
* remove redis events
* fix: data race on event subscriber
* fix: data race in tests
* fix: store errors
* fix: lint issues
* feat: default stream
* Update file.go
---------
Co-authored-by: Brian Ketelsen <bketelsen@gmail.com>
* .
* copilot couldn't make it compile so I did
* copilot couldn't make it compile so I did
* x
---------
Co-authored-by: Brian Ketelsen <bketelsen@gmail.com>
* Re-add events package
* run redis as a dep
* remove redis events
* fix: data race on event subscriber
* fix: data race in tests
* fix: store errors
* fix: lint issues
* feat: default stream
* Update file.go
---------
Co-authored-by: Brian Ketelsen <bketelsen@gmail.com>
* feat: more plugins
* chore(ci): split out benchmarks
Attempt to resolve too many open files in ci
* chore(ci): split out benchmarks
* fix(ci): Attempt to resolve too many open files in ci
* fix: set DefaultX for cli flag and service option
* fix: restore http broker
* fix: default http broker
* feat: full nats profile
* chore: still ugly, not ready
* fix: better initialization for profiles
* fix(tests): comment out flaky listen tests
* fix: disable benchmarks on gha
* chore: cleanup, comments
* chore: add nats config source
- Removed existing mDNS test file and replaced it with a new implementation.
- Added a new `mdns_registry.go` file that contains the MDNS registry logic.
- Updated the default registry to use the new MDNS registry.
- Refactored tests to accommodate the new MDNS registry implementation.
- Implemented service registration, deregistration, and service discovery using mDNS.
- Added encoding and decoding functions for mDNS TXT records.
- Implemented a watcher for monitoring service changes in the MDNS registry.
* [fix] etcd config source prefix issue (#2389)
* http transport data race issue (#2436)
* [fix] #2431 http transport data race issue
* [feature] Ability to close connection while receiving.
Ability to send messages while receiving.
Icreased r channel limit to 100 to more fluently communication.
Do not dropp sent request if r channel is full.
* [fix] Use pool connection close timeout
* [fix] replace Close with private function
* [fix] Do not close the transport client twice in stream connection , the transport client is closed in the rpc codec
* [fix] tests
---------
Co-authored-by: Johnson C <chengqiaosheng@gmail.com>
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