GF(Go Frame)
https://goframe.org is a modular, high-performance, production-grade Go development framework. It provides a comprehensive infrastructure including commonly used core development components such as caching, logging, files, timing, queues, arrays, collections, strings, timers, command-line, file locks, memory locks, object pools, connection pools, resource management, data validation, data encoding, file monitoring, scheduled tasks, database ORM, TCP/UDP components, process management/communication, concurrency-safe containers, etc. It offers core components for web service development, such as Router, Cookie, Session, Middleware, service registration, configuration management, template engine, and supports features like hot restart, hot update, multi-domain, multi-port, multi-service, HTTPS, Rewrite, and more.
GoFrame
has a rich set of foundational modules, a complete toolchain, and detailed documentation. In the nearly two years since its open-source release, GoFrame
has gained increasing recognition and support, evolving from obscurity to widespread application in enterprise-grade production projects such as microservices, IoT, blockchain, e-commerce systems, and banking. It has been tested in projects with hundreds of thousands to millions of users and was awarded the GVP
Most Valuable Open-Source Project by Gitee in 2019. GoFrame
is rapidly growing, with release iterations every 1-2 months, and an active community welcomes you to join the GoFrame
family.
Finally, I wish everyone a Happy New Year 2020, the Year of the Rat!
New Features
- New year, new updates, a lot of updates to official documentation: https://goframe.org/index
GoFrame
toolchain updates: https://goframe.org/toolchain/cli- Added
gf run
hot compilation and run command; - Added
gf docker
Docker image compilation command; - Added
gf gen model
powerful model auto-generation command; gf build
command now supports configuration file settings;- Numerous command-line tool improvements;
- Added automatic proxy setting feature;
- Added
- New features in Database
ORM
:- Added
prefix
support for data table prefixes: https://goframe.org/database/gdb/config - Added
Schema
database object and improved database switching feature: https://goframe.org/database/gdb/model/schema - Added
WherePri
method for automatic primary key condition methods: https://goframe.org/database/gdb/model/select - Significant updates to documentation and examples, covering over 95% of functional features;
- Added
Feature Improvements
container
garray
- Added
New*ArrayRange
method for initializing arrays with specified number ranges. - Added
Iterator*
method for callback iteration of array elements. - Enhanced unit tests.
- Added
gvar
- Improved the implementation of
MapStrStr
,MapStrStrDeep
methods.
- Improved the implementation of
net
ghttp
- Improved HTTP client to automatically recognize
Content-Type
for submitted parameters. Request
object addedParse
method for easy object transformation and parameter validation.- All
Request.GetPost*
methods marked asdeprecated
, standardize client parameter submission toQueryString
,Form
,Body
. - Removed
Get
/Post
built-in variables duringResponse
template parsing, addedQuery
,Form
,Request
built-in variables: https://goframe.org/net/ghttp/response/template - Improved
Response.WriteJson*
andResponse.WriteXml*
methods, supportingstring
,[]byte
type parameters. Server
addedGetRouterArray
method for exposing and obtaining the route list to the application layer.Server
addedUse
method, alias ofBindMiddlewareDefault
, for global middleware registration.Server
addedRouteOverWrite
option to control automatic overwriting when registering route conflicts, disabled by default with a warning.Server
addedGraceful
option to control the activation/deactivation of graceful restart features in a single service scenario, enabled by default.- Enhanced unit tests.
- Improved HTTP client to automatically recognize
gtcp
- Improved data packet sending and receiving functionality under a simple protocol.
- Changed the default cache expiration time of the connection pool from
30
seconds to10
seconds. - Enhanced unit tests.
database
gdb
Added
As
data table alias method.Improved automatic recognition and addition of safe characters for tables and fields.
Added
DB
method for switching database objects.Added
TX
method for supporting chain operations within transactions.Enhanced unit tests.
os
gcfg
- Added
GetMapStrStr
method.
- Added
gcmd
- Added
strict
parameter for strict argument parsing, default is strict parsing, errors if specified parameter/option name does not exist.
- Added
genv
- Improved
Remove
method to support deletion of multiple environment variables.
- Improved
gfile
- Improved
TempDir
method for getting temporary directory, default is/tmp
in*nix
systems. - Added
ReadLines
,ReadByteLines
methods for line-by-line callback file reading. - Added
Copy*
methods for file/directory copying, supports recursion. - Added
Replace*
methods for replacing file contents within directories, supports recursion. - Improved
Scan*
methods for retrieving all files/directories under a specified directory, supports file mode specification, supports recursion. - Enhanced unit tests.
- Improved
gproc
- Improved command-line running methods.
- Improved
Shell
command file search logic. - Improved experimental inter-process communication design.
gtime
- Marked timestamp methods
Second
,Millisecond
,Microsecond
,Nanosecond
in package methods andTime
objects as deprecated, replaced withTimestamp
,TimestampMilli
,TimestampMicro
,TimestampNano
. - Note that these changes may have compatibility issues with previous versions.
- Marked timestamp methods
gview
- Improved parsing functionality and cache design.
- Added
encode
,decode
HTML encoding/decoding template functions. - Added
concat
string joining template function. - Added
dump
template function, similar tog.Dump
method. - Added
AutoEncode
option for automatic HTML content encoding, useful for preventingXSS
, disabled by default. Note that this feature does not affect theinclude
built-in function: https://goframe.org/os/gview/xss - Enhanced unit tests.
crypto
gmd5
- Added
MustEncrypt
,MustEncryptBytes
,MustEncryptString
,MustEncryptFile
methods.
- Added
gsha1
- Added
MustEncryptFile
method.
- Added
encoding
gbase64
- Added
MustEncodeFile
,MustEncodeFileToString
,MustDecode
,MustDecodeToString
methods.
- Added
gjson
/gparser
- Added
GetMapStrStr
method. - Added
Must*
methods to triggerpanic
error on failure to convert specified data format, instead of returning anerror
parameter.
- Added
util
gconv
- Improved
Convert
method to add conversion support for[]int32
,[]int64
,[]uint
,[]uint32
,[]uint64
,[]float32
,[]float64
data types. - Improved
String
method support for converting pointer parameters. - Improved code structure and performance of
Map*
map conversion methods. - Added
Floats
,Float32s
,Float64s
methods for conversion to[]float32
,[]float64
types. - Added
Ints
,Int32s
,Int64s
methods for conversion to[]int
,[]int32
,[]int64
types. - Added
Uints
,Uint32s
,Uint64s
methods for conversion to[]uint
,[]uint32
,[]uint64
types. - Enhanced unit tests.
- Improved
frame
gins
- All singleton objects trigger
panic
error when retrieval fails.
- All singleton objects trigger
Bug Fix
- Added compatibility support for common erroneous route formats like
/user//index
. - Fixed issue with interval time units for data reception in
gtcp
/gudp
. - Fixed issue with imprecise file existence checks in
gfile
/gspath
/gfsnotify
packages. - Fixed blocking issue with
gproc.Kill
method onwindows
. - Fixed array overflow issue in
gstr.TrimLeftStr
/gstr.TrimRightStr
when the replaced string length was less than the replacement string length.