v0.14.0
This Release Includes Breaking Changes
This release includes breaking changes. The changes are introduced in order to extend the framework to add more implementation options for service discovery and distributed lock. In addition, support for go-kit is dropped.
What's Changed
New Features
- Consul become an optional package. When initialized (
consul.Use()), Consul is registered withappconfigas a source of application properties - Vault become an optional package. When initialized (
vault.Use()), Vault is registered withappconfigas a source of application properties. - Added
dnssdfor DNS SRV based service lookup.dnssdalso support static service discovery as "fallback" - Added Redis based distributed lock implementation
Breaking Changes
- Breaking change in
discoverypackage:- consul backed service discovery is moved to a separate package. To use it,
consulsd(formally known asdiscoveryinit) package need to be initialized withconsulsd.Use().consul.Use()is also a prerequisite for using Consul based service discovery - Properties for
consulsdis relocated to tocloud.discovery.consulfromcloud.consul.discovery
- consul backed service discovery is moved to a separate package. To use it,
- Breaking change in
integrate/httpclientpackage:httpclient.Client.WithService(...)is changed to take optionalSDOptions. Options includes default HTTP scheme and context-path, SD error handling and SD selector- The client now supports retry back-off period and custom retry logic
- go-kit interfaces are removed
- Breaking change in
integrate/securitypackage:- Property
integrate.security.service-namemoved tointegrate.security.endpoints.service-name - Added properties
integrate.security.endpoints.schemeandintegrate.security.endpoints.context-path
- Property
- Breaking change due to dropping usage and compatibility support of go-kit:
log.Loggerno longer implements go-kit'sLoggerinterface.discovery.Instancerconcrete implementations no longer implement go-kit'ssd.Instancerinterface.webpackage interfaces re-organized to remove usage of go-kit's abstraction and server implementation.
- Breaking change due to
dsyncpackage refactoring:- dsync package is refactored to three packages
dsync,consuldsyncandredisdsync dsync.Use()is removed,consuldsync.Use()orredisdsync.Use()should be used instead.- Removed
web.Registrar.RegisterWithLifecycle()
- dsync package is refactored to three packages
Bug Fixes
- Fixed: When using go 1.21 or later, lanai-cli's
initcommand would fail if the service's go.mod file contains a replace directive that pointed to a none-existent location. - Fixed: a bug in
make init-cliwhen go-lanai is not replaced by a local copy in the go.mod file. - Fixed: a typo causing
datapackages fail to build when CGO_ENABLED=0 - Fixed: a bug in
errorutilswhereerrorutils.CodedErrordoes not correctly implementerrorutils.NestedError - Fixed: a bug in bootstrap where
bootstrap.AddOptions()was actually adding options tobootstrap.Module.PriorityOptionsinstead ofbootstrap.Module.Options - Fixed: a bug where
httpclientpackage's error was not well formatted (#408).
Others
- Updated make files in examples to match the latest make file template.
- Updated main README.md and restructured documentation locations.
- Tracing package refactored to reduce unnecessary indirect dependencies. Instrument implementations are moved to their corresponding feature packages.
Full Changelog: v0.13.0...v0.14.0