Hello everyone, the GoFrame framework has officially released version v2.7.0 today! 👏👏👏👏👏👏👏👏👏
The highlight of this version is the provision of the metric monitoring component. The main library offers an interface-based metric design, and the community component provides an OpenTelemetry-based metric interface implementation. This feature is disabled by default and only enabled by default when specific interface implementations or community implementations are introduced. The current version also provides implementations for monitoring metrics of HTTP Client&Server, and metrics for other components will be provided in subsequent versions. For details, please refer to the documentation: Service Metrics.
Additionally, this version implements support for the Save operation for dm/mssql/oracle/pgsql/sqlite databases, thanks to community member https://github.com/oldme-git 💖.
Moreover, it is worth mentioning that in this version, we have added an ignore symbol # for the second-level field of the gcron scheduled task component, used to convert the 6-segment cron pattern into a 5-segment Linux crontab pattern, addressing the issue of task execution inaccuracy due to delay at the second-level granularity: Cron Job - Expressions.
Due to the numerous changes in this version, below is an introduction to some important improvements in Chinese. For the detailed ChangeLog, please refer to: https://github.com/gogf/gf/releases/tag/v2.7.0.
For the complete code changes, please refer to: https://github.com/gogf/gf/compare/v2.6.0...v2.7.0.
Thanks to all the contributors who participated in this version 💖!

Component Improvements
gdb- Added
Statsinterface definition and implementation for obtaining connection pool information maintained by the current databaseormobject: ORM Senior - Connection Pool - Added
FormatUpsertinterface definition and implementation, used for writing/updating operations for different database types, i.e.,Saveoperation. - Added
SqlTypetype, changing the existingsql typetype definition fromstringtoSqlTypetype. - Added
Model.OnConflictmethod for implementing update policy when field unique key conflicts for some database types, particularly forSaveoperation. - Fixed the issue where the
ClearTableFieldsAllmethod was not effective.
- Added
ghttp- Added
MiddlewareNeverDoneCtxmiddleware, which developers can choose to use to avoid issues related tocontext cancelon the server side when clients cancel requests: FAQ - Added monitoring metric implementation for
http server, which is disabled by default and does not affect performance, unless themetricsfeature is enabled: HTTPServer - Metrics - Improved
tracingrecords, changing thespanname fromquery uritoroute urifor easier aggregation when viewing. - Changed the type of
EnterTimeandLeaveTimeproperties in theRequestobject fromint64to*gtime.Time. - Marked the
WebSocketmethod as deprecated, it will be removed in future major versions, along with the removal ofhttp server'sbuilt-in coupling support forwebsocket. It is recommended to use other open-sourcewebsocketcomponents withhttp serverfor more decoupled flexibility in the future. - Fixed a memory issue caused by large file uploads due to the
Request Bodybeing readable multiple times by default. - Fixed the issue where the
patternparameter of theStartPProfServermethod was ineffective. - Added the
Access-Control-Expose-Headers Headerreturn to theRequest.ServeFileDownloadmethod to supportajaxfile requests. - Added
SwaggerUITemplateconfiguration option to the service configuration for quickly configuring theHTMLcontent of theSwaggerUIpage. - The
http serverno longer prints built-in middleware when starting route printing.
- Added
gclient- Fixed the issue that forced all
httprequests to go through service discovery domain name resolution when service discovery is enabled. - Added monitoring metric implementation for
http client, which is disabled by default and does not affect performance, unless themetricsfeature is enabled: HTTPClient - Metrics
- Fixed the issue that forced all
gcron- Added an ignore symbol
#, using it as a placeholder for the second-level field in thecron pattern, indicating the ignore of the second-level field, converting a6-segmentcron patternto a5-segmentlinux crontab pattern: Cron Job - Expressions - Fixed an issue where specified second-level tasks (for example
2 * * * * *) might execute twice if there is inaccurate time at the underlying level.
- Added an ignore symbol
gerror- Fixed an issue with the recursive logic being ineffective in the
gerror.HasCodemethod.
- Fixed an issue with the recursive logic being ineffective in the
g- Improved the
DumpJsonmethod for printing any variables inJSONformat.
- Improved the
gcache- Fixed an issue caused by excessive
goroutinedue to the creation of a large number ofCacheobjects.
- Fixed an issue caused by excessive
gcmd- Added
RunWithSpecificArgsmethod, used to run command objects with customarguments. - Fixed the issue of parameter loss due to conflicts between parameter struct names and struct tag names in some scenarios.
- Added
gfsnotify- Fixed a
panicissue that might occur when thegfsnotifyobject is closed.
- Fixed a
glog- Fixed the redundant
rotateissue of.gzsuffix log compressed files related to therotatefeature.
- Fixed the redundant
gmetric- Added
gmetriccomponent using a decoupled design, only providing the interface definition andNoopimplementation, with the real implementation in community components. Themetricfeature will only be enabled when specific implementations are introduced: Service Metrics
- Added
gproc- Fixed an issue where process parameter parsing might fail under
windows. - Improved
Signalsignal listening implementation, allowing adding signal handling methods at runtime.
- Fixed an issue where process parameter parsing might fail under
gview- Fixed a robustness issue caused by the
os.Getwdmethod execution failure.
- Fixed a robustness issue caused by the
gconvjson.RawMessagesupports receiving parameter conversions for theslicetype.- Fixed a recursive conversion failure issue caused by missing the
Deepparameter in theMapDeepinternal conversion. - Improved the internal
Maptraversal logic usingMapRange, enhancing execution performance.
Community Components
- Improvements to the community
contrib/driversdatabase components:- Added support for the
Saveoperation to thecontrib/drivers/dmcomponent. - Added support for the
Saveoperation to thecontrib/drivers/mssqlcomponent. - Added support for the
Saveoperation to thecontrib/drivers/oraclecomponent and fixed an issue with write parameters not supporting thegdb.Rawtype. - Added support for the
Saveoperation to thecontrib/drivers/pgsqlcomponent. - Added support for the
Saveoperation to thecontrib/drivers/sqlitecomponent. - Added support for the
Saveoperation to thecontrib/drivers/sqlitecgocomponent.
- Added support for the
- Added the
contrib/metric/otelmetriccomponent to supportOpenTelemetry Metric: Service Metrics - Improvements to the
contrib/nosql/rediscomponent:- Added
SentinelUsernameandSentinelPasswordparameter configurations to expand support for theRedis Sentinelmode: Redis - Configuration - Improved the
Redisinterface implementation, allowing developers to flexibly customize and extend the implementation of the community component objectredis.Redistype: Redis - Interface
- Added
- Improved the
contrib/registry/etcdcomponent, allowing developers to configure verification information foretcdconnections. - Improvements to the
contrib/rpc/grpcxcomponent:- Safely truncate request content when the
tracingfeature is enabled. - Added support for the
loggerconfiguration option, allowing configuration of thegrpc serverlog object through theloggerconfiguration option in the configuration file: GRPC Server Configuration
- Safely truncate request content when the
- Improvements to the
contrib/trace/otlphttpandcontrib/trace/otlpgrpccomponents, fixing data loss issues oftracethat may occur even with normalShutDownin short process scenarios.
Development Tools
- Improved
gen daogeneratedentitysource file by addingormtags to enhance the efficiency of converting database query results intoentityobjects. - Improved the
gen servicecommand, fixing the inconsistent method order issue in the generated source files. - Improved the
buildcommand, changing the default value of the generated binary file storage directorypathparameter from./tempto.to address the invalidation issue of the custom parameter. - Improved the
initcommand by adding the-module/gparameter to explicitly specify thego modulename when initializing a project. - Fixed an issue with
gen daodeleting generateddaosource files when using theclearparameter in multiple database generation configuration. - Fixed an issue with the
gen pbentitycommand where the customjsonCaseparameter was invalid. - Fixed an issue with the
runcommand's-wspecified listening directory parameter being ineffective.