New Features and Improvements
- The framework currently has
69development modules (excluding internal modules), with native code of65302lines (excluding third-party dependency packages), and unit test coverage reaching77%; - Added
gerrorerror handling module: https://goframe.org/errors/gerror/index - Improved
gcharsetcharacter encoding conversion module, supporting more character sets: https://goframe.org/encoding/gcharset/index - Added
gmutexmodule, an advanced mutex module based onchannel, supporting more rich mutex features: https://goframe.org/os/gmutex/index - Improved
gloglogging module:- Added asynchronous logging output feature: https://goframe.org/os/glog/async
- Added
Flagsextra feature: https://goframe.org/os/glog/flags - Added
Jsondata format output: https://goframe.org/os/glog/json - Added custom
Writerinterface feature: https://goframe.org/os/glog/writer - Renamed
BacktracetoStackand improved call stack output format; - Added
Exposemethod to expose the internal defaultLoggerobject;
- Improved
gdbdatabase ORM module:- Improved error handling, returning
sql.ErrNoRowswhen no data is found in a database operation: https://goframe.org/database/gdb/error - Improved
Update/Deletemethods to supportOrder BYandLIMITfeatures; - In database chain operations, the parameter supports
sliceparameters: https://goframe.org/database/gdb/model/model - Renamed
Priorityweight configuration toWeight; - Added
Debugconfiguration to enable/disable debugging feature: https://goframe.org/database/gdb/config - Added
Offsetmethod, an optional chain operation method, withpgsqldatabase directly recognizing the second parameter ofLimitmethod asOffsetsyntax; - Improved database dynamic switching feature to switch between different database types;
- Simplified configuration file structure: https://goframe.org/database/gdb/config
- Improved error handling, returning
- Improved
gconvdata conversion module:- Supported more tags during struct object conversion:
gconv/c/json; - Supported
*struct/[]struct/[]*structautomatic initialization and creation: https://goframe.org/util/gconv/struct - Added
Strusts/StrctsDeepmethods for recursive conversion of struct arrays; - Added
StructDeepmethod for recursive conversion of struct objects; - Added
MapDeepmethod for recursive conversion of struct properties;
- Supported more tags during struct object conversion:
- Improved
ghttpmodule:- Improved the group routing function of
ghttpmodule with more robust logic handling; - Improved
ghttp.Request.Get*ToStructmethods to supportparams/param/ptags and recursive struct conversion, with automatic initialization for**structparameters; - Adjusted
ghttp.CORSDefaultcross-origin settings, withAllowOriginset to*;
- Improved the group routing function of
- Improved
gvaliddata validation module:- Added support for validation tags
gvalid/valid/v; - Improved
CheckStructto support recursive validation of struct objects: https://goframe.org/util/gvalid/checkstruct
- Added support for validation tags
- Improved
gtcpTCP communication module:- Improved communication packet protocol design for more lightweight and efficient packages: https://goframe.org/net/gtcp/conn/pkg
- Added
TLSsupport toTCP Server: https://goframe.org/net/gtcp/tls - Added
Server.Cloceserver closing method;
- Improved
gprocmodule communication data structure, usinggtcplightweight packet protocol to optimize message sending logic; - Improved
gqueuemodule with data synchronization buffer mechanism to address memory usage and latency issues under large data volumes; - Improved
gmlockmodule, replacing internal mutexes usinggmutex, and added more operation methods; - Improved
gaesencryption module by addingCBCencryption/decryption methods; - Improved
garray.Range/SubSlicemethods for better design and performance; - Improved
gjson/gparsermodules to implementMarshalJSONinterface for customJSONdata format conversion; - Added
errorvariables to return method results incryptoclassification to ensure more rigorous interface design style; - Changed input/output types in
gbase64module, adding several related methods; - Changed
UnLocktoUnlockingflock, and addedIsRLockedmethod; - Added
gfile.CopyFile/CopyDirmethods for file and directory copying; - Added more type conversion methods to
gjson/gparser/gvar/gcfgmodules; - Improved
gcachemodule, with expiration time parameter supportingtime.Durationtype; - Added
internal/structs, a powerful and convenient struct parser, optimizing all modules involving struct reflection processing; - Improved
gbinary, adding support forBigEndianwith encapsulated methods;
Bug Fixes
- Fixed
garray.Searchreturn value issue; - Fixed logic issues in
garray.Contains,garray.New*ArrayFromCopymethods; - Fixed
gjson.Removeslice parameter issue; - Fixed
gtree.AVLTree.Removemethod return value issue; - Fixed inaccurate size issue in
gqueue.Size; - Fixed
queue.Closeissue; - Fixed deadlock issue in
gcache.GetOrSetLockFuncwhen callback function returnsnilresult; - Fixed default recursive monitoring addition issue in
gfsnotify.Addmethod; - Fixed issues with
gdb.Model.Scanfor certain parameter types;
Notes
Please pay attention to the bold parts above, as you may encounter incompatibilities when upgrading.