Hello everyone, the GoFrame framework has officially released version v2.4.0 today! 👏👏👏👏
The biggest highlight of this version is the provision of features for microservices development, development tools, and project scaffolding, along with comprehensive microservices development documentation!! The design of microservices components continues to focus primarily on interface design to ensure good flexibility and extensibility. The interfaces are maintained in the main repository of the framework, while specific interface implementations are pragmatic and provided within community components.
In fact, the feature functionality of this version has long been Ready, but due to the significant workload of documentation, it took about a month to complete it relatively thoroughly, thus adjusting the release date of the version accordingly. We believe that documentation is as important as code and is an integral part of a milestone release. We know how to use it well and hope to tell everyone how to use it well, to more pragmatically help more developers. This is one reason why GoFrame framework documentation has been able to accumulate abundantly over time. Furthermore, complete source code comments are primarily in English to assist overseas users. The official website documentation remains predominantly in Chinese to support major development teams in the Greater China region.
Come and check out what we've updated! Enjoy! 🍺🍺🍺🍺🍺🍺🍺🍺
Full code changes: v2.3.0...v2.4.0, thanks to all the contributing developers for this release:
New Features
Official release of microservices development features and addition of a complete microservices development section on the official website: Microservice Development
Functional Improvements
Database Component
gdb- Fixed the issue of automatic table structure query failure during cross-database operations: https://github.com/gogf/gf/issues/2338
- Fixed the
Namespaceconfiguration issue not taking effect underpgsql. - Fixed the issue of being unable to open
sqlitedatabase files when using the new unified configuration: https://github.com/gogf/gf/issues/2435 - Improved underlying database operation return logic, returning underlying errors through
gerror.Wrapto ensure that the upper layer can obtain underlying custom error objects. - Fixed the issue of unsigned integer fields being converted to signed integer types when querying data tables: https://github.com/gogf/gf/issues/2356
- Fixed parsing issue of multi-level
Modelbeing used as subquery parameters during subqueries: https://github.com/gogf/gf/issues/2339 - Improved time maintenance feature, enabling the writing of full time (granularity down to nanoseconds) for write/update/delete operations.
- Fixed unlimited execution issue under soft delete scenarios when given an empty
Wherecondition: https://github.com/gogf/gf/issues/2427 gredis- Fixed configuration handling and object initialization issues when creating objects.
Container Component
garray- Added
Filtermethod for customizing traversal and filtering of array elements. - Added
RemoveValuesmethod to support batch deletion of elements by parameter value. - Improved
InsertBeforemethod to support batch parameter insertion capability. gmap- Added
IsSubOfmethod to determine if the currentmapis a subset of the specifiedmap. gqueue- Fixed
Len/Sizelength calculation issue: https://github.com/gogf/gf/issues/2509 - Fixed concurrent safety issue with
Closemethod: https://github.com/gogf/gf/issues/2015
Network Component
gclient- Added
SetDiscoveryandSetBuildermethods to allow callers to customize client service discovery and load balancing interface implementations. ghttp- Improved support for reading specified parameters from
Header/Cookiewhen receiving parameters, supporting the specification of readingHeader/Cookiein the route'sintag (in:header/cookie). - Improved
ResponseWriterto implement thehttp.Flusherinterface, simplifying the user'sStreamoutput development logic: Response - Streaming - Improved link tracing implementation logic to prevent issues from being ignored when an error occurs in reading submitted content internally.
- Improved parameter reading logic to prevent
r.GetRequestMap()from returning content that includesform-dataformbodyinformation: https://github.com/gogf/gf/issues/2261 - Improved internal context reception logic:
- Original logic: Removed ignoring of the underlying
Requestctxand created a newctxsupporting link tracing. - Latest logic: Inherits the
ctxobject of the underlyingRequestand extends thisctxto support link tracing features.
- Original logic: Removed ignoring of the underlying
- Improved graceful shutdown logic to allow customizing the timeout of graceful shutdown.
- Improved configuration feature to allow developers to configure custom service registration interface implementation objects.
System Component
gcmd- Improved
AddObjectmethod to allow directly adding specified*Commandor standardizedObjectobjects as subcommands. gctx- Fixed missing
TraceIDissue inGetInitCtxmethod: Context gfile- Improved
Tempmethod to align basic logic implementation with standard libraryos.TempDir, avoiding temporary directory conflict issues during single-machine collaboration. gtimer- Added
Quickoption when creating timers to trigger the specified callback method upon adding timers.
Utility Component
gconv- Fixed
Scanmethod conversion failure issue in certain scenarios when fields are integer/floating point arrays: https://github.com/gogf/gf/issues/2391 - Fixed issue of
Interfacesmethod directly returning[]when attribute is 0: https://github.com/gogf/gf/issues/2395 - Fixed conversion issue when
json tagis,omitemptywithout variable name. - Fixed conversion failure issue when target type is a pointer to a custom basic type.
- Fixed conversion failure issue of
gvar.Vartype to common third-party packagedecimal.Decimaltype: https://github.com/gogf/gf/issues/2584 - Improved
Structmethod to resolve conversion failure issue when field type istime.Time/*time.Timeand provided conversion value is a non-standard library-supported string like2022-12-15 16:11:34: https://github.com/gogf/gf/issues/2371 gtag- Added
SetGlobalEnums/GetEnumsByTypemethods for automatedGolang Enumsmanagement. Requiresgf gen enumscommand to work. gutil- Fixed null pointer error issue in
Dumpmethod under certain scenarios: https://github.com/gogf/gf/issues/2487 gvalid- Added
Fieldfield in custom validation method parameters to address field missing issues in custom validation error prompts: https://github.com/gogf/gf/issues/2499
Community Component
Database Driver
- Improved
dm/mysqlcomponent to resolveQueryEscapeissue when special characters (e.g.,/) exist in timezone configuration.
NoSQL Adapter
- Fixed missing connection pool configuration parameters in
rediscomponent configuration.
Service Registration Discovery
- Added
fileregistration discovery component for file-based service registration discovery locally, typically used for single-node testing. - Improved implementation details of
etcd/polaris/zookeeperand refined single test cases.
Microservice Scaffolding
- Added
grpcxmicroservice component for microservice development using thegrpccommunication protocol: Microservice Development
Development Tools
- Added
gf gen pbcommand for compilingprotofiles to generatego pbfiles: Protobuf Compilation - Added
gf gen pbentitycommand for automatically generatingprotodata structure definition files for database tables: DB Table To Protobuf - Added
gf gen enumscommand for parsing specified directorygofiles and automatically generatingenumsdata files based on enumeration definition specifications, mainly used forOpenAPIinterface documentation display (experimental feature): Enums Maintenance - Improved
gf upcommand by adding toolCLIautomatic upgrade feature. - Improved
gf gen servicecommand to stop auto-generating methods into the interface definition file after the method's comment. - Improved
gf buildcommand by addingDumpENVoption to control whether to print environment information used during compilation, with default setting off. - Improved
gf dockercommand by addingTagoption to ensure compatibility with older versions.
