Hello everyone! From late autumn to deep winter, we haven't been idle since the last release. We've brought you a heartwarming GoFrame v1.15
version this time. In addition, there are two other things:
GoFrame
was selected byOSC
Open Source China as one of theTOP30
open source projects of2020
: https://www.oschina.net/question/2918182_2320114. Thank you for your recognition and support! Meanwhile,GoFrame
is also aGitee GVP
Most Valuable Project.- The official website of
GoFrame
has been redesigned. You only need to experience it for a few minutes, and you'll be like me, loving this framework: https://goframe.org. Thanks to Atlassian for the sponsorship, providing full product line license codes!
After years of dedicated development and stable growth, GoFrame
has gradually grown into an enterprise-level Golang
basic development framework, offering project development standards, development toolchains, complete basic modules, rich development documentation, high code quality, and an active community. To ensure the quality of the framework, we've conducted extensive unit testing across components to ensure logical correctness (2534
test units, 9097
test assertions), while maintaining high-quality documentation. To date, many large, medium, and small internet companies have used GoFrame
in production environments.
Open source is not easy, and with your understanding and support, happiness is abundant! Thank you to all the partners involved in the project development, love you all! GoFrame, YES!
GoFrame
GF(Go Frame)
is a modular, high-performance, enterprise-level Go
basic development framework. It provides a complete infrastructure and development toolchain, offering commonly used basic development modules such as caching, logging, queues, arrays, sets, containers, timers, command lines, memory locks, configuration management, resource management, data validation, scheduled tasks, database ORM
, TCP/UDP
components, process management/communication, etc. It also provides a series of core components for Web
service development, such as Router
, Cookie
, Session
, Middleware
, service registration, template engine, and supports hot restart, hot update, domain binding, TLS/HTTPS
, Rewrite
, and other features.
If you are new to the
Go
language, you can compareGoFrame
toLaravel
inPHP
,SpringBoot
inJava
, orDjango
inPython
.
Features
- Modular, loosely coupled design;
- Rich modules, ready to use;
- Simple and easy to use, easy to maintain;
- High code quality, high unit test coverage;
- Active community, humble and low-key experts;
- Detailed development documentation and examples;
- Comprehensive local Chinese support;
- Designed for team and enterprise use;
Change Logs
-
ghttp
- Improved
HTTPClient
GET
request methods, automatically constructing parameters asQueryString
instead ofBody
to ensure compatibility with other servers. - Added default value setting feature to
Request
objects: Request - Default Value - Added
Request.SetCtx
method for custom context variables, commonly used in middleware/interceptors: Request - Context - Added
Request
variable in template parsing to get client request parameters regardless ofQueryString/Form
type: Response - Template Parsing - Improved
Cookie
functionality. For settingCookies
with the same expiration asSession
, refer to: Cookie#Cookie Session Expiry - Added
ALLMap
method in group route registration for bulk route registration: Group Route#Bulk Registration - Introduced
CRSF
plugin documentation: CSRF - Other feature and detail improvements.
- Improved
-
gdb
- Added
Ctx
method for asynchronousIO
control or custom context information transmission, especially for tracing: ORM - Context - Added
Raw
type for embedding rawSQL
statements which will directly submit to the underlying database driver without any processing: Writing#RawSQL Statement Embedding, Updating#RawSQL Statement Embedding - Improved
Fields/Fields/Data
methods with automatic mapping detection and filtering for inputmap/struct
parameters to database fields: ORM - Senior Features - Configurable
InsertedAt/UpdatedAt/DeletedAt
field names andTimeMaintainDisabled
setting added to disable time filling and soft delete features: ORM Model - Time Fields - Added
Counter
update feature for incrementing/decrementing field values: Updating#Counter Update Feature - Improved
ORM
timezone processing; see: ORM - Timezone - Other performance and usability detail improvements.
- Improved some detail issues.
- Enhanced unit tests.
- Added
-
gerror
- Added
Newf/NewSkipf
methods for creating error objects: Error Handling - Added support for error code features: Error Code - Example
- Enhanced unit tests.
- Added
-
gvalid
- Added
phone-loose
loose mobile number verification rule, allowing any11
-digit number starting with13/14/15/16/17/18/19
. - Validation errors implement the
gerror
Current() error
interface, allowing the use ofgerror.Current
to get the current first validation error: Data Validation - Result - Other detail improvements.
- Enhanced unit tests.
- Added
-
gvar
- Added
IsNil/IsEmpty
methods to check if data isnil/empty
. - Added
IsInt/IsUint/IsFloat/IsSlice/IsMap/IsStruct
common type checking methods. - Deprecated
StructDeep/StructDeep
methods, recommending to useStruct/Structs
directly. - Enhanced unit tests.
- Added
-
ghtml
- Added
SpecialCharsMapOrStruct
method for automatically convertingHTML
code inmap/struct
keys/attributes to preventXSS
.
- Added
-
gjson
- Deprecated
To*
conversion methods, recommendingStruct
method instead ofToStruct
. - Some detail improvements.
- Enhanced unit tests.
- Deprecated
-
internal
- Improved and refined
internal/empty
package's null value judgment. - Due to performance issues https://github.com/gogf/gf/issues/1004, temporarily removed the dependency of the
internal/json
package on the third-party package github.com/json-iterator/go, reverting to using the standard libraryencoding/json
. - Improved
internal/structs
package by removing the dependency on the third-party package github.com/gqcn/structs, simplifying the reflection processing logic, improving performance and usability, and enhancing long-term maintainability. - Added
RemoveSymbols
method in theinternal/utils
package for removing special characters in a string. ImprovedEqualFoldWithoutChars
method by removing regex filtering of substrings, greatly enhancing method performance. These small functions contribute to improving the performance of other complex type conversion modules in the framework. Although theinternal
package does not expose methods directly, it impacts the performance of some core components within the framework.
- Improved and refined
-
gcfg
- Improved singleton instance configuration object retrieval with auto-detect file type feature: Configuration Management - Singleton Object#Auto-Retrieval Feature
- Other detail improvements.
-
gcmd
- Improved default parameter parsing retrieval method: Command
- Added
GetWithEnv
method to retrieve from environment variables if a specified parameter is absent in the command line: Command
genv
- Added
SetMap
method for batch setting environment variables. - Added
GetWithCmd
method to retrieve from command line parameters if a specified parameter is absent in environment variables: Environment
gfile
- Deprecated
ReadByteLines
method; addedReadLinesBytes
method. - Adjusted callback function definition of
ReadLines/ReadLinesBytes
methods to includeerror
return.
glog
- Improved rolling update functionality.
- Other detail improvements.
gsession
- Added
SetMap
method for batch setting key-value pair data.
gtimer
- Improved constant naming to use PascalCase style.
gview
- Added built-in template function
map
to convert parameters tomap[string]interface{}
type. - Added built-in template function
maps
to convert parameters to[]map[string]interface{}
type. - Added built-in template function
json
to convert parameters toJSON
string type. - Documented updates: Template Funcs - Built-In
- Other detail improvements.
gconv
- Performance improvements.
- Functionality improvements (many small detail improvements).
- More robust code.
- Enhanced unit tests.
gutil
- Added
Keys
method to get keys/attribute names ofmap/struct
and return as an array. - Added
Values
method to get values/attributes ofmap/struct
and return as an array. - Added
MapToSlice
method, for example:{"K1": "v1", "K2": "v2"} => ["K1", "v1", "K2", "v2"]
- Added
StructToSlice
method, for example:{"K1": "v1", "K2": "v2"} => ["K1", "v1", "K2", "v2"]
- Added
SliceToMap
method, for example:["K1", "v1", "K2", "v2"] => {"K1": "v1", "K2": "v2"}
- Enhanced unit tests.
- Other detail improvements.
Bug Fix
- Fixed concurrency safety issue in
Clone
method ofgarray/gmap/gtree
. - Fixed issue where
gpool
did not automatically invoke expiration method for expired elements when expiration method was set. - Fixed duplication issue in
gfile.ReadLines/ReadLineBytes
when reading large amounts of data. - Other bug fixes.