Changelog¶
All notable changes to this project are documented here.
[Unreleased]¶
[1.0.14] - 2026-07-16¶
Added¶
- WebSocket Accept option functions: Added option functions for all fields in
AcceptOptions, allowing fluent configuration of WebSocket accept behavior (e.g.,SetInsecureSkipVerify,SetOriginPatterns,SetCompressionMode). - WebSocket
AcceptOptionsfield parity: All fields from the underlyingwebsocket.AcceptOptionsare now mirrored in the framework'sAcceptOptionsstruct for complete configuration support.
Refactored¶
- WebSocket lazy initialization: WebSocket connections are now lazily initialized on first read/write using
sync.Once, preventing unnecessary resource allocation and fixing connection handoff inOpenStream. - WebSocket wrapper: Introduced
WebSocketStreamwrapper around WebSocket connections with proper connection lifecycle management and thread-safe initialization. - Component independent modules: All packages under
component/are now independent Go modules with their owngo.modand version tags —auth,cache,captcha,cors,localcache,qrcode,ratelimit,schedule,validatoreach havecomponent/<name>/v1.0.14tags.
Fixed¶
- Nil pointer in
AddHandles: Added nil check to prevent panic when route handles are missing. - WebSocket data race and context leak: Fixed a race condition in lazy connection initialization and a context leak from uncanceled background goroutines.
- WebSocket retry loop: Stopped infinite retrying after the first
Acceptfailure — now returns the error immediately. - Unsynchronized fast path in
getConn: Removed the unsynchronized fast path that could cause concurrent read/write races on WebSocket connections. - Empty slice initialization in
AcceptOptions: Slice fields inAcceptOptionsare now properly initialized to empty slices instead of nil. - GORM Model on Joins: The GORM
Model()clause is now set whenJoinsare used, not justPreloads, fixing association resolution in join queries. Query.One()error handling: When no record is found,Query.One()now returns a zero value and nil error instead of wrappinggorm.ErrRecordNotFound. Callers should check the return value for zero/nil to determine if a record exists.
[1.0.12] - 2026-07-15¶
Added¶
MemFileSystem.ExistsFile(): Checks whether a path exists as a file (not a directory) with a singleStatcall, used in SPA 404 fallback to avoid matching directories.Table.Model(): NewModel(value)method ondb.Tablewrapping GORM's Model, required for Preload to resolve associations correctly.Server.ServerConfig(): Exposes the Server's configuration object for external access.Server.Listen()/Server.ListenTLS(): HTTP/TLS listen logic moved from Runner to Server for independent usage.Server.AddFilters(): Convenience method for adding multiple filters at once.- Access logging: Debug-level request logging in
optionsMiddlewareprinting HTTP method and path. util.DefaultPage(): Centralized pagination defaults (PageNo=1, PageSize=10), replacing duplicate validation across query methods.
Refactored¶
core/server.go: RemovedInit()phase — servers are now created on demand duringRun(); addedAddIRunner/AddRestGroup.core/context.go:NewContextno longer takes*web.Server; removed server field from root Context.core/rest.go:Handlesflows throughRestGroupto Server;Build()constructs the struct directly.web/runner.go: Listen logic delegated toServer.Listen/ListenTLS; removed duplicate implementations and deadlogTLSListen.web_frame.go: No longer pre-creates Server; handles passed through RestGroup; simplified init flow.component/cors/cors.go: ExtractedcrosHandlerFunc, added nil guard inHandle.model/clause.go:ListPage/ExecPage/Pageall useDefaultPage, eliminating duplicate validation.
Fixed¶
- SPA 404 fallback now uses
ExistsFileinstead ofExiststo avoid matching directories. initServerproperly propagates server creation errors witherrors.WithStackIfinstead of swallowing nil.- Runner
Initmoved fromRun()toweb_frame.init()to avoid runners depending on uninitialized REST routes. optionsMiddlewareregistered beforejustInitRoutefor correct middleware ordering.
[1.0.11] - 2026-07-11¶
Added¶
- Self-Signed Certificate Generation: When no wildcard certificate matches a host, the framework now automatically generates an in-memory ECDSA P-256 self-signed certificate (valid for 1 year) and caches it. Eliminates the need for external certs in development.
- IPv6 TLS Support: Self-signed certificates correctly handle IPv6 addresses, including bracketed format (
[::1],[::1]:8443) from HTTP Host headers. Servers.GetHandler(): Returns anhttp.Handlerthat dispatches requests to the correctServerengine based on the port in the Host header. Each server's routes, filters, and ContextPath remain fully independent.WebFrame.GetHandler(): Initializes the full application (DB, services, routes) and returns anhttp.Handlerfor use withhttptest.NewServer().core.Server.GetHandler(): Exposes the underlyingServers.GetHandler()for test and embedding scenarios.- Multi-domain server listening — all matched domains now log their own URL on startup.
Fixed¶
certStore.init()now collects all certificate errors instead of failing on the first one, ensuring as many certs as possible are loaded.- Certificate loading failures no longer block HTTP server startup — errors are logged and the server continues without TLS.
- Various MkDocs 2.0 compatibility fixes (removed deprecated plugins, empty overrides, invalid icons).
Changed¶
core.NewServer()now accepts an external*web.Serversparameter, ensuring builder-registered routes are available throughGetHandler().- Docs rewritten with standard markdown for MkDocs 2.0 compatibility.
[1.0.0] - 2026-04-07¶
Added¶
- Initial release of Go Web Frame
- Core Features
- Dependency injection with Context-based DI container
- MVC-like architecture with clear separation of concerns
- Type-safe generic ORM with zero boilerplate CRUD operations
-
Built-in support for SQLite, MySQL, PostgreSQL, Redis
-
Web Layer
- REST controller support with automatic route registration
- Filter/middleware chain for cross-cutting concerns
- Route metadata support via
.WithMeta() - Static file serving with SPA fallback support
- Reverse proxy support
- WebSocket and Server-Sent Events (SSE)
-
Automatic HTTPS with Let's Encrypt certificates
-
Data Access
- Generic
Model[T]for type-safe database operations EntryModel[T, PK]for entities with primary key support- Fluent query builder with chain API
- Transaction support
-
Connection pool configuration
-
Components
- Cache component (Redis-based)
- Local cache component (Otter-based)
- Rate limiting component
- Captcha generation
- QR code generation
- Cron scheduled tasks
- Input validation
- Authentication filter
-
CORS filter
-
Infrastructure
- Auto-loading configuration (JSON/YAML/TOML/INI)
- Structured logging with Zap + log rotation
-
Builder pattern for application construction
-
Documentation
- Multi-language README (English, Chinese, Traditional Chinese, Japanese)
- MkDocs documentation site (English + Chinese)
- Example applications for common use cases
Version History¶
| Version | Date | Highlights |
|---|---|---|
| 1.0.14 | 2026-07-16 | WebSocket AcceptOptions, lazy init, data race fixes, component modules |
| 1.0.13 | 2026-07-16 | WebSocket AcceptOptions, lazy init, data race fixes, Query.One() fix |
| 1.0.12 | 2026-07-15 | ExistsFile, Model/Preload associations, core refactor, DefaultPage |
| 1.0.11 | 2026-07-11 | Self-signed certs, GetHandler for testing, TLS error resilience |
| 1.0.0 | 2026-04-07 | Initial release with core features |
Next Steps¶
- Home — Back to home
- Quick Start — Installation guide