Dear gfer, the wait is over. It's been over two months since the last release, and during this period, GoFrame has been continually iterating and improving. There are numerous details, and here is a general overview of the release log.
Additionally, GoFrame is participating in the 2019 Most Popular Chinese Open Source Software voting, which ends tomorrow. Feel free to vote for GoFrame: https://www.oschina.net/project/top_cn_2019. You can vote on the webpage and through WeChat.
New Features
WebServerNew Features:- Improved middleware and group routing implementation: https://goframe.org/net/ghttp/router/middleware
- Added file configuration management feature: https://goframe.org/net/ghttp/config
- Enhanced parameter acquisition: https://goframe.org/net/ghttp/request/index
- Improved file upload: https://goframe.org/net/ghttp/client/demo/upload
Sessionadds multiple built-inStorageimplementations:- Introduction: https://goframe.org/os/gsession/index
- File storage: https://goframe.org/os/gsession/file
- Memory storage: https://goframe.org/os/gsession/memory
Redisstorage: https://goframe.org/os/gsession/redis
- Added log component singleton object and optimized configuration management:
- Common
containercontainers addMarshal/UnMarshalinterface implementation forJSONdata format: - Added
guuidmodule for generalUUIDgeneration: https://goframe.org/util/guuid/index
Feature Improvements
net
ghttp- Enhanced request process handling performance;
Serveradds configuration forLoggerlog object;ServerexposesGetRouterMapmethod, enabling developers to more conveniently implement custom permission management;- Enhanced server configuration management;
- Major improvements on the
Clientobject; Clientobject adds multi-file upload functionality;Requestobject addsGetErrormethod to retrieve current processing errors;Requestobject adds independent view object and view variable binding, allowing independent view management for each request and the ability to switch request objects' views through middleware. This feature is disabled by default, with view parsing using theServerobject's view;- Refactored
CORSfunctionality for theResponseobject; - Added
Response.WriteTplDefaultmethod to parse and return default template content; - Added more unit test cases;
- Other improvements;
gipv4/gipv6- Some improvement work;
gtcp/gudp- Some improvement work;
database
gdb- Extensive details improvement work;
- Removed
sql.ErrNoRowserror return when query data is empty, retaining the error return forStruct/Structs/Scanmethods when data is empty; - Enhanced SQL statement output in debug mode to a complete SQL with parameters, for reference only;
Wheremethod adds support forgmapdata type, including sequentialListMap/TreeMap, etc.;- Cache time parameter type for query cache method
Cachechanged totime.Duration; - Renamed data type conversion methods for
Record/Result, marking original methods asdeprecated; Record/Resultquery result types addIsEmptymethod to determine if the result set is empty;Recordtype addsGMapmethod to convert query records togmaptype;- Added
Option/OptionOmitEmptymethods for input parameter filtering, includingDataandWhereparameters: https://goframe.org/database/gdb/empty - Added field exclusion method
FieldsEx: https://goframe.org/database/gdb/senior - Added logging feature: https://goframe.org/database/gdb/senior
- Improved database configuration management: https://goframe.org/database/gdb/config
- Added extensive unit testing;
gredis- Enhanced data type conversion: https://github.com/gogf/gf/issues/415
- Improved unit testing;
- Other enhancements;
os
gcache- Important note: Cache validity period parameter adjusted from
interface{}type totime.Durationtype, and no longer compatible with previousinttype to ensure better performance;
- Important note: Cache validity period parameter adjusted from
gfcache- Due to
gcachecomponent's cache time parameter type change, this component's time parameter also changed totime.Durationtype;
- Due to
gcfg- Added
Availablemethod to determine if configuration is valid;
- Added
gfile- Added
Chdirmethod for working directory switching;
- Added
gtime- Added
Marshal/UnMarshalinterface implementation forJSONdata format;
- Added
container
gmap- Added
MapStrAnymethod for commonmaptype conversion; - Added
MapCopymethod for underlyingmapdata copying; - Added
FilterEmptymethod formapempty value filtering; - Added
Pop/Popsmethods for randomly returning (and deleting) data items inmap; - Added
Replacemethod to cover the underlyingmapdata with givenmapdata; - Improved unit testing;
- Other enhancements;
- Added
garray- Added
Interfacesconversion method returning[]interface{}type; - For sorted arrays, added
SetComparatormethod for custom comparator modification; - Improved unit testing;
- Other enhancements;
- Added
glist- Added
NewFrommethod to create a list based on a given[]interface{}variable; - Added
Joinmethod to concatenate list items using a given string and return the string; - Improved unit testing;
- Other enhancements;
- Added
gset- Added
AddIfNotExistFunc/AddIfNotExistFuncLockmethods; - Improved unit testing;
- Other enhancements;
- Added
gtree- Added
Replacemethod for updating existing tree data items; - Other improvements;
- Added
gtype- Some detail improvement work, not listed one by one;
- Improved benchmark testing and unit testing;
gvar- Added
Ints/Uintstype conversion methods; - Other enhancements;
- Added
crypto
gmd5- Minor detail improvements;
gsha1- Minor detail improvements;
text
gstr- Improved
SplitAndTrimmethod, markedSplitAndTrimSpaceasdeprecated; - Added
TrimStrmethod; - Improved unit testing;
- Other enhancements;
- Improved
debug
gdebug- Added
CallerFileLineShort/FuncPath/FuncNamemethods; - Other improvements;
- Added
encoding
gbase64- Added
EncodeToString/EncodeFile/EncodeFileToString/DecodeToStringmethods; - Improved unit testing;
- Added
gjson- Improved unit testing;
frame
g/gins- https://goframe.org/frame/g/index
- Added
CreateVarmethod; - Improved unit testing;
- Other enhancements;
util
gconv- Improved and optimized performance for some type conversion methods;
- Added
Uints/SliceUinttype conversion methods; - Added high-performance type conversion methods
UnsafeStrToBytes/UnsafeBytesToStr; - Added support for
MapStrAnyinterface methods for commonmaptype conversion; - Other improvements;
gvalid- Improved ID card validation functionality for Chinese IDs;
- Added
luhnbank card number validation functionality;
grand- Some performance improvements;
Bug Fix
- Fixed
hijackederror issue upon WebSocket closure: https://github.com/gogf/gf/issues/381 - Resolved memory usage issue for large files during static file service;
- Fixed default
Cookiedomain setting issue when behindNginx; - Fixed
gconv.Structconversion failure issue when property is[]structand input property parameter is empty: https://github.com/gogf/gf/issues/405 - Other fixes;