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
GoFrametoolchain updates: https://goframe.org/toolchain/cli- Added
gf runhot compilation and run command; - Added
gf dockerDocker image compilation command; - Added
gf gen modelpowerful model auto-generation command; gf buildcommand now supports configuration file settings;- Numerous command-line tool improvements;
- Added automatic proxy setting feature;
- Added
- New features in Database
ORM:- Added
prefixsupport for data table prefixes: https://goframe.org/database/gdb/config - Added
Schemadatabase object and improved database switching feature: https://goframe.org/database/gdb/model/schema - Added
WherePrimethod 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*ArrayRangemethod 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,MapStrStrDeepmethods.
- Improved the implementation of
net
ghttp- Improved HTTP client to automatically recognize
Content-Typefor submitted parameters. Requestobject addedParsemethod for easy object transformation and parameter validation.- All
Request.GetPost*methods marked asdeprecated, standardize client parameter submission toQueryString,Form,Body. - Removed
Get/Postbuilt-in variables duringResponsetemplate parsing, addedQuery,Form,Requestbuilt-in variables: https://goframe.org/net/ghttp/response/template - Improved
Response.WriteJson*andResponse.WriteXml*methods, supportingstring,[]bytetype parameters. ServeraddedGetRouterArraymethod for exposing and obtaining the route list to the application layer.ServeraddedUsemethod, alias ofBindMiddlewareDefault, for global middleware registration.ServeraddedRouteOverWriteoption to control automatic overwriting when registering route conflicts, disabled by default with a warning.ServeraddedGracefuloption 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
30seconds to10seconds. - Enhanced unit tests.
database
-
gdb-
Added
Asdata table alias method. -
Improved automatic recognition and addition of safe characters for tables and fields.
-
Added
DBmethod for switching database objects. -
Added
TXmethod for supporting chain operations within transactions. -
Enhanced unit tests.
-
os
-
gcfg- Added
GetMapStrStrmethod.
- Added
-
gcmd- Added
strictparameter for strict argument parsing, default is strict parsing, errors if specified parameter/option name does not exist.
- Added
-
genv- Improved
Removemethod to support deletion of multiple environment variables.
- Improved
-
gfile- Improved
TempDirmethod for getting temporary directory, default is/tmpin*nixsystems. - Added
ReadLines,ReadByteLinesmethods 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
Shellcommand file search logic. - Improved experimental inter-process communication design.
-
gtime- Marked timestamp methods
Second,Millisecond,Microsecond,Nanosecondin package methods andTimeobjects 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,decodeHTML encoding/decoding template functions. - Added
concatstring joining template function. - Added
dumptemplate function, similar tog.Dumpmethod. - Added
AutoEncodeoption for automatic HTML content encoding, useful for preventingXSS, disabled by default. Note that this feature does not affect theincludebuilt-in function: https://goframe.org/os/gview/xss - Enhanced unit tests.
crypto
gmd5- Added
MustEncrypt,MustEncryptBytes,MustEncryptString,MustEncryptFilemethods.
- Added
gsha1- Added
MustEncryptFilemethod.
- Added
encoding
gbase64- Added
MustEncodeFile,MustEncodeFileToString,MustDecode,MustDecodeToStringmethods.
- Added
gjson/gparser- Added
GetMapStrStrmethod. - Added
Must*methods to triggerpanicerror on failure to convert specified data format, instead of returning anerrorparameter.
- Added
util
gconv- Improved
Convertmethod to add conversion support for[]int32,[]int64,[]uint,[]uint32,[]uint64,[]float32,[]float64data types. - Improved
Stringmethod support for converting pointer parameters. - Improved code structure and performance of
Map*map conversion methods. - Added
Floats,Float32s,Float64smethods for conversion to[]float32,[]float64types. - Added
Ints,Int32s,Int64smethods for conversion to[]int,[]int32,[]int64types. - Added
Uints,Uint32s,Uint64smethods for conversion to[]uint,[]uint32,[]uint64types. - Enhanced unit tests.
- Improved
frame
gins- All singleton objects trigger
panicerror 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/gfsnotifypackages. - Fixed blocking issue with
gproc.Killmethod onwindows. - Fixed array overflow issue in
gstr.TrimLeftStr/gstr.TrimRightStrwhen the replaced string length was less than the replacement string length.