This version is actually the major release of v2.0
. To avoid the strict requirement of go module
mechanism for v2
and above versions needing to modify import
and add v2
suffix, it was released using v1.9
.
New Features
- Added
gf
command line development assistant tool: https://goframe.org/toolchain/cli - Added
gres
resource manager module: https://goframe.org/os/gres/index - Refactored
Session
functionality, addedgsession
module, andWebServer
defaults to file storageSession
: https://goframe.org/net/ghttp/session WebServer
added middleware feature, retaining the original HOOK design, both can achieve request interception, pre-processing, etc.: https://goframe.org/net/ghttp/router/middleware- Added
gi18n
localization management module: https://goframe.org/i18n/gi18n/index - Added
gini
module: https://goframe.org/encoding/gini/index WebServer
added more convenient hierarchical routing registration method: https://goframe.org/net/ghttp/group/levelgcmd
command line parameter parsing module refactored, addedParser
parsing object: https://goframe.org/os/gcmd/index- Added
gdebug
module for stack information retrieval/printing: https://goframe.org/debug/gdebug/index
Major Adjustments
- Removed methods marked as
deprecated
in1.x
versions; - Adjusted container classification modules to default to non-concurrent safety;
- Directory adjustments:
- Removed
third
directory, unified management of package dependencies withgo module
; - Moved original modules in
g
directory to framework main directory, originalg
module moved toframe/g
directory; - Changed original
geg
sample code directory name to.example
;
- Removed
Functional Improvements
ghttp
- Improved
Request
parameter parsing method: https://goframe.org/net/ghttp/request - Improved cross-domain request functionality, added
Origin
setting and verification feature: https://goframe.org/net/ghttp/cors - Changed
TTL
configuration data type ofCookie
andSession
totime.Duration
; - Added simultaneous transmission of
SessionId
throughHeader/Cookie
; - Added
ConfigFromMap/SetConfigWithMap
methods to configure WebServer withmap
parameter; - Improved default
CORS
configuration with default support for commonHeader
parameters; - Added
IsExitError
method for developers to customizerecover
error handling, filtering non-exception errors defined by the framework; - Added
SetSessionStorage
configuration method for customSession
storage; ghttp.Request
added more parameter retrieval methods;
- Improved
gdb
- Added automatic escape (
Quote
) feature for some SQL fields; - Added support for
slice
parameters in method operations and chain operations; - Added
SetLogger
method for custom database log printing; - Added
Master/Slave
method for selecting master-slave nodes for database operations; - Added unit tests for
mssql/pgsql/oracle
; - Supported full integration parameterized SQL statement debugging printing in
debug
mode; - Added more functional methods;
- Added automatic escape (
glog
- Added
Default
method to get the defaultLogger
object; - Added
StackWithFilter
method for custom stack printing filtering; - Added more functional methods;
- Added
gfile
- Renamed some methods:
Get/PutBinContents
changed toGet/PutBytes
; - Added
ScanDirFile
method for retrieving file directories only, supporting recursive search; - Added more functional methods;
- Renamed some methods:
gview
- Added
SetI18n
method for setting customgi18n
localization objects for view objects; - Added built-in support for
gres
resource manager;
- Added
gcompress
- Added file/directory compression/decompression methods for
zip
algorithm; - Compression parameters support multiple paths for file/directory;
- Added file/directory compression/decompression methods for
gconv
- Improved support for
[]byte
data type parameters; - Added
Unsafe
conversion method for increased conversion efficiency in specific scenarios; - Added
MapDeep/StructDeep/StructsDeep
methods for recursivestruct
conversion;
- Improved support for
gjson/gparser
- Improved automatic type recognition functionality;
- Added
LoadJson/LoadXml/LoadToml/LoadYaml/LoadIni
methods for custom data type content loading; - Added more functional methods;
gerror
- Improved error stack retrieval logic;
- Added more functional methods;
gmap/garray/gset/glist/gvar
- Improved concurrent safety benchmarking scripts;
- Changed
garray.StringArray
togarray.StrArray
; - Added more functional methods;
gdes
- Standardized method name changes;
gstr
- Added
Camel/Snake
naming conversion methods; - Added more functional methods;
- Added
genv
- Added more functional methods;
Bug Fix
- Fixed issue with
gvalid
customizationtag
errors not working when validatingstruct
; - Fixed automatic content type recognition failure in
gcfg
configuration management module under specific conditions; - Fixed concurrent safety issue in
gqueue
when the user actively closes the queue; - Fixed integer overflow issue in
session
when developer sets excessively largeTTL
.