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
WebServer
New 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
Session
adds multiple built-inStorage
implementations:- Introduction: https://goframe.org/os/gsession/index
- File storage: https://goframe.org/os/gsession/file
- Memory storage: https://goframe.org/os/gsession/memory
Redis
storage: https://goframe.org/os/gsession/redis
- Added log component singleton object and optimized configuration management:
- Common
container
containers addMarshal
/UnMarshal
interface implementation forJSON
data format: - Added
guuid
module for generalUUID
generation: https://goframe.org/util/guuid/index
Feature Improvements
net
ghttp
- Enhanced request process handling performance;
Server
adds configuration forLogger
log object;Server
exposesGetRouterMap
method, enabling developers to more conveniently implement custom permission management;- Enhanced server configuration management;
- Major improvements on the
Client
object; Client
object adds multi-file upload functionality;Request
object addsGetError
method to retrieve current processing errors;Request
object 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 theServer
object's view;- Refactored
CORS
functionality for theResponse
object; - Added
Response.WriteTplDefault
method 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.ErrNoRows
error return when query data is empty, retaining the error return forStruct
/Structs
/Scan
methods when data is empty; - Enhanced SQL statement output in debug mode to a complete SQL with parameters, for reference only;
Where
method adds support forgmap
data type, including sequentialListMap
/TreeMap
, etc.;- Cache time parameter type for query cache method
Cache
changed totime.Duration
; - Renamed data type conversion methods for
Record
/Result
, marking original methods asdeprecated
; Record
/Result
query result types addIsEmpty
method to determine if the result set is empty;Record
type addsGMap
method to convert query records togmap
type;- Added
Option
/OptionOmitEmpty
methods for input parameter filtering, includingData
andWhere
parameters: 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.Duration
type, and no longer compatible with previousint
type to ensure better performance;
- Important note: Cache validity period parameter adjusted from
gfcache
- Due to
gcache
component's cache time parameter type change, this component's time parameter also changed totime.Duration
type;
- Due to
gcfg
- Added
Available
method to determine if configuration is valid;
- Added
gfile
- Added
Chdir
method for working directory switching;
- Added
gtime
- Added
Marshal
/UnMarshal
interface implementation forJSON
data format;
- Added
container
gmap
- Added
MapStrAny
method for commonmap
type conversion; - Added
MapCopy
method for underlyingmap
data copying; - Added
FilterEmpty
method formap
empty value filtering; - Added
Pop
/Pops
methods for randomly returning (and deleting) data items inmap
; - Added
Replace
method to cover the underlyingmap
data with givenmap
data; - Improved unit testing;
- Other enhancements;
- Added
garray
- Added
Interfaces
conversion method returning[]interface{}
type; - For sorted arrays, added
SetComparator
method for custom comparator modification; - Improved unit testing;
- Other enhancements;
- Added
glist
- Added
NewFrom
method to create a list based on a given[]interface{}
variable; - Added
Join
method to concatenate list items using a given string and return the string; - Improved unit testing;
- Other enhancements;
- Added
gset
- Added
AddIfNotExistFunc
/AddIfNotExistFuncLock
methods; - Improved unit testing;
- Other enhancements;
- Added
gtree
- Added
Replace
method 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
/Uints
type conversion methods; - Other enhancements;
- Added
crypto
gmd5
- Minor detail improvements;
gsha1
- Minor detail improvements;
text
gstr
- Improved
SplitAndTrim
method, markedSplitAndTrimSpace
asdeprecated
; - Added
TrimStr
method; - Improved unit testing;
- Other enhancements;
- Improved
debug
gdebug
- Added
CallerFileLineShort
/FuncPath
/FuncName
methods; - Other improvements;
- Added
encoding
gbase64
- Added
EncodeToString
/EncodeFile
/EncodeFileToString
/DecodeToString
methods; - Improved unit testing;
- Added
gjson
- Improved unit testing;
frame
g
/gins
- https://goframe.org/frame/g/index
- Added
CreateVar
method; - Improved unit testing;
- Other enhancements;
util
gconv
- Improved and optimized performance for some type conversion methods;
- Added
Uints
/SliceUint
type conversion methods; - Added high-performance type conversion methods
UnsafeStrToBytes
/UnsafeBytesToStr
; - Added support for
MapStrAny
interface methods for commonmap
type conversion; - Other improvements;
gvalid
- Improved ID card validation functionality for Chinese IDs;
- Added
luhn
bank card number validation functionality;
grand
- Some performance improvements;
Bug Fix
- Fixed
hijacked
error issue upon WebSocket closure: https://github.com/gogf/gf/issues/381 - Resolved memory usage issue for large files during static file service;
- Fixed default
Cookie
domain setting issue when behindNginx
; - Fixed
gconv.Struct
conversion failure issue when property is[]struct
and input property parameter is empty: https://github.com/gogf/gf/issues/405 - Other fixes;