kataras/iris
62.9
Weak · 6 August 2026
76.3k
lines of production code
Go
primary language
3
measurements over time
What this system is
This system is a comprehensive example suite for the Iris Go web framework, serving as a practical reference for developers. It demonstrates a wide range of capabilities including authentication, routing, MVC architecture, session management, and static file serving. The examples cover diverse use cases such as REST APIs, WebSocket communication, gRPC, and template rendering, providing concrete templates for building Go web applications.
How it got here
2016–2017 — API consolidation and modernization
79 changes.
This period focused on streamlining the framework's architecture by removing legacy packages, deprecated plugins, and internal utilities in favor of a more modular and consistent API. Key changes include the introduction of a unified view engine interface, a rewritten sessions subsystem with pluggable backends, and the adoption of functional options for configuration. The work also expanded the framework's capabilities with new middleware, caching, and gRPC support while providing comprehensive examples for modern usage patterns.
2018–2020 — Comprehensive example expansion
127 changes.
This period focused on significantly expanding the project's example suite to cover a wide array of features, including MVC patterns, WebSocket and Socket.IO integrations, database connections, and authentication mechanisms. The work emphasized practical demonstrations of template engines, routing strategies, and middleware usage, providing developers with extensive reference implementations for common and advanced use cases.
2021–2024 — Comprehensive example expansion and utility packages
27 changes.
This period was defined by a massive expansion of the project's example suite, covering diverse topics such as authentication, streaming, and third-party integrations. Concurrently, new utility packages were introduced to standardize error handling, HTTP client management, and validation across the framework.
Features
Add 'repository' MVC example demonstrating layered architecture
A new 'repository' example is added to the MVC examples, showcasing a layered architecture with separate packages for data models, data sources, repositories, services, and web controllers. The example includes a memory-based movie repository, a service layer for business logic, and controllers that interact with the service. It also includes basic authentication middleware for the /movies endpoint.
_\examples/mvc/repository · high confidence
Add API deprecation support and versioned route grouping
The versioning package now includes a 'Deprecated' feature that allows developers to mark specific API handlers or route groups as deprecated. This is achieved through the new 'deprecation.go' file, which provides a 'Deprecated' wrapper function and 'WriteDeprecated' helper to inject standard deprecation headers (X-Api-Warn, X-Api-Deprecation-Date, X-Api-Deprecation-Info) into responses. Additionally, the 'group.go' file introduces a 'Group' type that implements the 'Party' interface, enabling developers to register routes that are only active for specific semantic version ranges. The 'version.go' file supports this by providing version extraction from headers and query parameters, along with aliasing capabilities to map logical version names to concrete versions.
versioning · high confidence
Add Ace template engine example
Added a new example demonstrating the integration of the Ace template engine with the Iris framework. The example includes a Go main file that registers the Ace view engine and serves templates, along with corresponding .ace template files for the index page, a main layout, and header/footer partials.
_\_examples/view/template\_ace\0 · high confidence
Add Badger KV store backend for session persistence
A new example demonstrates how to use the Badger key-value store for session storage. The example initializes a Badger database, configures the session manager with \AllowReclaim: true\ to handle session reclamation, and registers the database with the session manager via \UseDatabase\. This provides users with a concrete template for persisting session data using Badger.
_\examples/sessions/database/badger · high confidence
Add BasicAuth middleware example to MVC login demo
The MVC login example now includes a BasicAuth middleware implementation, providing a sample configuration for HTTP basic authentication with a default admin user.
_\examples/mvc/login/web/middleware · high confidence
Add BoltDB session database example
A new example demonstrates how to use the BoltDB session database with the Iris framework. The example shows how to initialize a BoltDB store, configure the session manager with 'AllowReclaim: true', and integrate the database with the application's session handling.
_\examples/sessions/database/boltdb · high confidence
Add CORS example demonstrating third-party middleware integration
A new example at \_examples/auth/cors demonstrates how to integrate the 'rs/cors' third-party net/http middleware with the Iris framework. The example shows using app.WrapRouter to inject the CORS handler before the Iris router, allowing for custom pre-routing logic. The example includes a simple HTML/JS client that fetches data from a /data endpoint, illustrating the CORS headers in action.
_\examples/auth/cors · high confidence
Add CSV access log example with structured headers
The accesslog-csv example now includes a sample CSV file (access\_log.csv.sample) and a Go implementation (main.go) that demonstrates logging HTTP requests in CSV format. The example configures the access log to write to a CSV file with headers, including fields for timestamp, latency, status code, HTTP method, path, IP address, request values, in/out bytes, and request/response bodies. This provides a concrete example of how to use the accesslog middleware's CSV formatter for structured logging.
_\examples/logging/request-logger/accesslog-csv · high confidence
Add Django-style template example with custom functions and filters
A new example demonstrates using Django-style templates with the Iris framework. The example registers a custom template function (greet) and utilizes a timesince filter, illustrating how to configure and render templates with dynamic data.
_\_examples/view/template\_django\0 · medium confidence
Add Docker support and automated tests to the basic routing example
The basic routing example now includes a Dockerfile, .dockerignore, and docker-compose.yml, enabling users to build and run the application in a containerized environment. Additionally, a comprehensive test suite (main\_test.go) has been added to verify the behavior of all defined routes, including path parameters, subdomains, and admin groups.
_\examples/routing/basic · high confidence
Add Docker-based example for Redis session storage
The Redis session database example now includes Dockerfiles and a docker-compose configuration, enabling users to easily spin up a Redis server and two application instances to demonstrate session scaling-out across multiple servers.
_\examples/sessions/database/redis · high confidence
Add Go URL Shortener example using Iris and Bolt
A new URL shortener example has been added to the repository, demonstrating how to build a service using the Iris web framework and the BoltDB key-value store. The example includes a factory for generating unique short URLs, a database abstraction layer for storing and retrieving links, and a web interface that allows users to shorten URLs and view their count. The implementation also includes automated tests to verify the core shortening and redirection logic.
_\examples/url-shortener · high confidence
Add Go WebAssembly example for client-side rendering
A new example demonstrating how to serve and run a Go WebAssembly application in the browser. The change adds a client-side Go program (hello\_go116.go) that renders a message to the DOM, along with the necessary JavaScript runtime (go-wasm-runtime.js) and loader (main.js) to bootstrap the WASM module, and an HTTP handler to serve the HTML entry point.
_\examples/webassembly · high confidence
Add GraphQL example using schema-first approach
Added a new GraphQL example in the \_examples/graphql/schema-first directory that demonstrates a schema-first workflow using gqlgen. The example includes a GraphQL schema definition (schema.graphqls), generated Go code (generated.go, models\_gen.go), resolver implementations (schema.resolvers.go), and a server entry point (server.go) that serves the GraphQL API on port 8080.
_\examples/graphql · high confidence
Add HTML template example with layout support
A new example demonstrating the Iris framework's HTML template engine is added, showcasing how to configure a layout file (layout.html) and render multiple views (home, about, user/index) with distinct head and body sections.
_\_examples/view/template\_html\5 · high confidence
Add HTTP error handling and Problem Details examples
A new example at \_examples/routing/http-errors demonstrates how to handle HTTP error codes using app.OnErrorCode and how to return structured Problem Details responses via ctx.Problem. The example shows configuring error responses with JSON or XML, setting custom fields, and using ProblemOptions to include a Retry-After header.
_\examples/routing/http-errors · high confidence
Add HTTP error view example for subdomains
A new example demonstrates rendering HTTP error pages (404, 500) with HTML minification for a specific subdomain (test.mydomain.com). The example includes the application code, a corresponding test, and the associated HTML templates and layouts.
_\examples/routing/subdomains/http-errors-view · high confidence
Add JSON logger example for structured logging
A new example at \_examples/logging/json-logger demonstrates how to configure the Iris application to output logs in JSON format. The example shows how to set the logger format to 'json', use the golog library for structured logging with fields, and includes a corresponding test to verify the JSON output structure.
_\examples/logging/json-logger · high confidence
Add JWT authentication example for the Iris framework
A new example is added at \_examples/auth/jwt/middleware/main.go demonstrating how to implement JWT-based authentication in the Iris web framework. The example shows how to create a token signer and verifier, protect API routes using middleware, and handle token generation, verification, and invalidation (logout).
_\examples/auth/jwt/middleware · high confidence
Add JWT authentication tutorial with Go client example
A new tutorial example was added to demonstrate JWT-based authentication using the Iris framework. The example includes a Go client that authenticates, retrieves, and creates TODO items. The server-side implementation uses the \kataras/iris/v12\ framework and the \kataras/iris/v12/middleware/jwt\ package to handle token verification and user claims. The tutorial also provides in-memory repositories for users and todos, along with utility functions for password hashing and UUID generation.
_\examples/auth/jwt/tutorial · high confidence
Add JWT blocklist example with Redis support
A new example at \_examples/auth/jwt/blocklist demonstrates how to implement JWT token revocation using a Redis-backed blocklist. The example shows how to configure the JWT verifier with a Redis blocklist to handle logout scenarios where tokens need to be invalidated before their natural expiration.
_\examples/auth/jwt/blocklist · high confidence
Add Jet template engine example with URL path generation
A new example demonstrates using the Jet template engine with the Iris framework, showcasing route registration, named routes, and URL path generation using the 'urlpath' template function. The example includes various route patterns with parameters and static paths, illustrating how to generate URLs for different route configurations.
_\_examples/view/template\_jet\2 · medium confidence
Add Jet template engine example with custom rendering
The example at \_examples/view/template\_jet\_0 now demonstrates how to use the Iris built-in Jet view engine. It includes a README explaining the setup and a main.go that registers the Jet template engine, adds a custom base64 function, and implements custom rendering for TODO items using the jet.Renderer interface.
_\_examples/view/template\_jet\0 · medium confidence
Add Jet template engine examples for layouts and todo views
Introduced new Jet template files for the example application, including a shared layout (application.jet) and specific views for listing and showing todos (index.jet, show.jet). These templates demonstrate the use of Jet's block and yield directives for layout inheritance and content injection.
_\_examples/view/template\_jet\0/views · high confidence
Add Jet template example with dynamic view builder functions
A new example at \_examples/view/template\_jet\_3 demonstrates how to register custom template functions (Asset, Style, Script) using reflection to dynamically add methods from a ViewBuiler struct to the Jet template engine. The example also shows how to use these custom functions in a .jet template file.
_\_examples/view/template\_jet\3 · medium confidence
Add MVC HTTP error handling example
A new example demonstrates how to handle HTTP errors in an MVC controller by implementing a \HandleHTTPError\ method. This allows customizing error responses for specific status codes, such as 404 and 500, using dedicated view templates.
_\examples/mvc/error-handler-http · high confidence
Add MVC Hello World example with custom path and test coverage
A new MVC example at \_examples/mvc/hello-world demonstrates how to register controllers using the mvc package, including a standard controller and one with a custom path word function. The example also shows how to add custom routes and handlers within a controller's BeforeActivation phase. A corresponding test file validates the HTTP responses for all registered routes.
_\examples/mvc/hello-world · high confidence
Add MVC error handling example demonstrating global and per-controller error handling
A new example at \_examples/mvc/error-handler demonstrates how to implement custom error handling in the MVC package. It shows how to register a global error handler using mvcApp.HandleError, and how to override it on a per-controller basis by defining a HandleError method on the controller struct. The example also updates the server startup to use app.Listen for simplicity.
_\examples/mvc/error-handler · medium confidence
Add MVC error handling examples
Added two new MVC error handling examples: one demonstrating result hijacking via a custom ResultHandler to map error responses to specific HTML views, and another showcasing the Preflight method to intercept and customize JSON responses before they are sent, including automatic timestamp injection and error code handling.
_\examples/mvc/error-handler-preflight · high confidence
Add MVC example for regex-based routing
A new example at \_examples/mvc/regexp demonstrates how to use regular expressions in MVC routing. The example shows how to match a file path with a specific pattern (e.g., ending in .json) using the \regexp\ constraint in the route definition.
_\examples/mvc/regexp · high confidence
Add MVC example with access logging and session support
A new example at \_examples/mvc/basic demonstrates how to configure an MVC application with access logging and session management. The example registers the accesslog and recover middlewares, sets up session and logger dependencies, and shows how to use HandleMany for multiple routes and BeforeActivation for route registration.
_\examples/mvc/basic · high confidence
Add MVC login example with user and admin routes
The \_examples/mvc/login/main.go file was added to demonstrate an MVC application structure. It sets up an Iris web server with HTML templating, static file serving, and error handling. The example registers repositories and services, then configures two MVC applications: one for '/users' with basic authentication middleware, and another for '/user' with session management. Controllers for users and individual users are bound to their respective routes.
_\examples/mvc/login · high confidence
Add MVC session controller example with automated session binding
A new example at \_examples/mvc/session-controller demonstrates how to use the MVC pattern with session management. The example shows how to automatically bind the current session to a controller field and increment a visit counter. A corresponding test verifies the session behavior by checking the visit count in the response body.
_\examples/mvc/session-controller · high confidence
Add MVC singleton controller example
A new example in \_examples/mvc/singleton demonstrates how to implement a singleton MVC controller in the Iris framework. The example shows a globalVisitorsController that shares state across all clients using atomic operations for thread-safe access, illustrating the singleton pattern where all clients share the same controller instance.
_\examples/mvc/singleton · high confidence
Add MVC wildcard path parameter example
A new example demonstrating how to handle wildcard path parameters in the MVC pattern is added to \_examples/mvc/basic/wildcard. The example shows how to register a controller to handle requests with dynamic path segments, specifically illustrating the use of a wildcard parameter in the route definition.
_\examples/mvc/basic/wildcard · high confidence
Add MongoDB example with Docker support
A new example application demonstrating a RESTful API built with the official MongoDB Go driver and the Iris framework. The example includes a complete project structure with environment configuration, a Dockerfile for containerized builds, and a docker-compose.yml to run the application alongside a MongoDB container. The API provides standard CRUD operations for a 'Movie' resource, handling JSON serialization and error responses via a custom httputil package.
_\_examples/database/mongodb, \examples/kafka-api · medium confidence
Add Pug (Jade) template example
A new example demonstrating the integration of the Pug (Jade) template engine with the Iris framework is added to the \_examples/view/template\_pug\_0 directory. The example shows how to register a Pug view engine and render a template that iterates over slices and nested structs.
_\_examples/view/template\_pug\0 · high confidence
Add Pug (Jade) template example with custom functions
A new example in the \_examples/view directory demonstrates how to use the Pug template engine with the Iris framework. The example registers a custom template function (bold) and shows how to include partials (header and footer) within a main template, illustrating the framework's support for this view engine.
_\_examples/view/template\_pug\1 · medium confidence
Add Quicktemplate and Herotemplate examples
Added new example applications for the quicktemplate and herotemplate view engines. The quicktemplate example demonstrates rendering HTML templates using the valyala/quicktemplate library, including generated Go code for base, hello, and index templates. The herotemplate example provides an alternative implementation using the shiyanhui/hero library, showcasing how to render templates with context writers. Both examples include corresponding test files to verify the rendered output.
_\examples/view/quicktemplate · high confidence
Add REST response writer example demonstrating JSON, XML, YAML, and other content types
A new example at \_examples/response-writer/write-rest demonstrates how to handle various response formats in the Iris framework. It shows how to read JSON requests, write JSON responses (including secure, ASCII-only, and raw HTML variants), and serialize to XML, YAML, MsgPack, and Markdown. The example also includes a custom error handler to demonstrate error handling in the context of RESTful responses.
_\examples/response-writer/write-rest · high confidence
Add ReadParams example for URL parameters
A new example demonstrates how to use the ReadParams method to bind URL path parameters to a struct, as shown in the \_examples/request-body/read-params directory. The example includes both the implementation and an accompanying test to verify the parameter binding behavior.
_\examples/request-body/read-params · high confidence
Add SQLx database example with query helpers
A new example at \_examples/database/sqlx demonstrates integrating the x/sqlx sub-package with the Iris web framework. The example provides a complete CRUD-style application that connects to a PostgreSQL database, creates an 'events' table, and exposes HTTP endpoints for inserting, listing, and retrieving events. It showcases the sqlx.Query helper for fetching single records and sqlx.Bind for mapping query results to structs, illustrating how to use the x/sqlx utilities in a real-world context.
_\examples/database/sqlx · high confidence
Add Server-Sent Events (SSE) example
Added a new example in \_examples/response-writer/sse demonstrating how to implement Server-Sent Events using the Iris framework. The example includes a Go server that broadcasts JSON events to connected clients via a broker pattern, along with an HTML/JavaScript client that listens for and displays these events.
_\examples/response-writer/sse · high confidence
Add Socket.IO example
Added a new example demonstrating how to integrate Socket.IO with the Iris framework. The change introduces a Go server implementation in \_examples/websocket/socketio/main.go that uses the go-socket.io library and Iris's FromStd adapter to handle WebSocket connections, along with a corresponding HTML client in \_examples/websocket/socketio/asset/index.html that connects to the chat and notice events.
_\examples/websocket/socketio · high confidence
Add Viper-based configuration example
A new example demonstrating how to use the Viper library to load and unmarshal YAML configuration files into a Go struct. The example includes a YAML config file, a Go module that reads the config, and a main entry point that applies the loaded settings to the Iris web server.
_\examples/configuration/viper · high confidence
Add Vue Router example for single-page applications
A new example demonstrating how to serve a Vue.js single-page application with client-side routing using the Iris framework. The addition includes the necessary frontend assets (HTML, CSS, and JavaScript) along with a Go server that serves the static files, illustrating the integration of Vue Router with the backend.
_\examples/file-server/spa-vue-router · high confidence
Add Vue.js TodoMVC example using Iris and Neffos
A new example demonstrating a TodoMVC application built with the Iris web framework and Vue.js. The example includes a Go backend using Iris's MVC and WebSocket (Neffos) support for real-time synchronization, alongside the corresponding Vue.js frontend and static assets.
_\examples/mvc/vuejs-todo-mvc · high confidence
Add WeatherAPI client example
Added a new example application in \_examples/http-client/weatherapi that demonstrates how to use the kataras/iris/v12/x/client package to interact with the WeatherAPI. The change introduces a client implementation (client.go) that configures the HTTP client with an API key and provides a method to fetch current weather data by city, along with the corresponding response struct (response.go) and a main entry point (main.go) that calls the API and prints the temperature.
_\examples/http-client · high confidence
Add WebSocket MVC example with automatic event registration
A new example at \_examples/mvc/websocket demonstrates an MVC-based WebSocket controller. It registers a controller that automatically maps methods like OnChat, OnNamespaceConnected, and OnNamespaceDisconnect to WebSocket events. The example also shows how to register dependencies (e.g., a logger) and use the websocket package's namespace connection handling.
_\examples/mvc/websocket · high confidence
Add accesslog broker example with real-time log streaming
An example application is added that demonstrates the accesslog broker feature, allowing users to stream access logs in real-time via a /logs endpoint using Server-Sent Events-like chunked responses. The example configures the accesslog middleware to capture request bodies and panic information, and registers a listener to output logs as JSON chunks to the client.
_\examples/logging/request-logger/accesslog-broker · high confidence
Add accesslog middleware example with customizable fields and log rotation
The \_examples/logging/request-logger/accesslog directory now includes a complete example of the accesslog middleware. The example demonstrates how to configure the logger with custom fields (such as session values, authentication headers, and job latency), change the output delimiter, and use file rotation via the file-rotatelogs library. The sample log file (access.log.sample) shows the resulting output format, which includes time, latency, status code, method, path, IP, custom fields, and byte counts.
_\examples/logging/request-logger/accesslog · high confidence
Add accesslog-proxy example demonstrating separate logging for proxied requests
A new example application was added to \_examples/logging/request-logger/accesslog-proxy, demonstrating how to configure separate access logs for a main application and a reverse proxy. The example uses the accesslog middleware to log requests to distinct files (access.log and proxy\_access.log) and includes a target server (target/main.go) to simulate a backend service.
_\examples/logging/request-logger/accesslog-proxy · high confidence
Add auth example with role-based access control and token management
The \_examples/auth/auth directory now contains a complete example of an authentication system built on the Iris framework. This example demonstrates how to implement single sign-on (SSO) with role-based access control, allowing users to sign in, refresh tokens, and sign out. The implementation includes a configurable YAML-based setup for managing access and refresh tokens, a memory-based user provider for validation and invalidation, and specific route handlers for /signin, /refresh, /signout, and /signout-all. Additionally, the example showcases how to enforce secure cookie attributes and manage user roles (Owner, Member) to restrict access to specific endpoints.
_\examples/auth/auth · high confidence
Add authenticated-controller example demonstrating route overlap and dependency-based authentication
A new example at \_examples/mvc/authenticated-controller shows how to secure MVC controllers using a custom \Authenticated\ type as a dependency. The example registers both an \UnauthenticatedUserController\ and a \UserController\ on the same \/user\ path by enabling \iris.RouteOverlap\, allowing the framework to execute the appropriate controller based on authentication state. A test verifies the full flow: accessing \/user\ without a session returns a redirect message, logging in sets the session, and subsequent requests to \/user\ return the authenticated user's data.
_\examples/mvc/authenticated-controller · high confidence
Add basic JWT authentication example
A new example demonstrating basic JWT authentication has been added to the project. The example, located at \_examples/auth/jwt/basic, showcases how to generate and verify JSON Web Tokens using the Iris framework's JWT middleware. It includes a simple token generation endpoint and a protected route that validates incoming tokens, illustrating the standard workflow for securing API endpoints with JWTs.
_\examples/auth/jwt/basic · high confidence
Add basic SPA serving example using HandleDir
A new example demonstrates how to serve a Single Page Application (SPA) using the HandleDir method with DirOptions.SPA enabled, simplifying the setup for routing all requests to index.html.
_\examples/file-server/single-page-application/basic · high confidence
Add basic WebSocket example with multi-client support and JWT authentication
A new basic WebSocket example has been added to the repository, demonstrating a Go server and clients for Go, Browser, Browserify, and Node.js. The example showcases how to handle WebSocket connections, broadcast messages, and implement JWT-based authentication during the handshake process using the iris-contrib/middleware/jwt package.
_\examples/websocket/basic · high confidence
Add basic cookie management example
A new basic example demonstrates how to set, retrieve, and delete cookies using the Iris framework. The example shows using \ctx.SetCookieKV\ to store a cookie, \ctx.GetCookie\ to read it, and \ctx.RemoveCookie\ to delete it, providing a simple reference for cookie handling in applications.
_\examples/cookies/basic · high confidence
Add basic session management example
A new example demonstrating basic session management using the Iris framework's sessions package. The example shows how to configure a session handler, set and retrieve session data (such as authentication status), and manage login/logout flows with cookie-based session IDs.
_\examples/sessions/basic · medium confidence
Add bootstrapper example with session, websocket, and error handling setup
A new bootstrapper example is added to the \_examples/bootstrapper directory, providing a complete application template that configures HTML templating, in-memory sessions with secure cookie encoding, WebSocket support, and custom HTTP error handlers. The example includes route handlers for index, follower, following, and like endpoints, along with corresponding HTML templates and a test suite to verify the application's behavior.
_\examples/bootstrapper · high confidence
Add browser client example for MVC WebSocket demo
Added a new HTML file for the MVC WebSocket example, providing a complete client-side implementation using the neffos.js library. This enables users to test the MVC framework's automatic event registration and handle real-time updates for online visitor counts and chat messages directly in the browser.
_\examples/mvc/websocket/browser · high confidence
Add browser-based WebSocket client example with JWT authentication
A new browser-based client example has been added to the WebSocket basic example, demonstrating how to connect to the server using the neffos.js library. The example includes a simple chat interface and supports JWT authentication via a query parameter, allowing users to test secure WebSocket connections directly from the browser.
_\examples/websocket/basic/browser · high confidence
Add browserify example for WebSocket client with JWT authentication
Added a new browserify-based JavaScript client example for the WebSocket service, demonstrating how to connect to the server and handle chat events. The example includes support for JWT-based authentication during the handshake, allowing users to test secure connections. This addition provides a concrete reference for implementing browser-side WebSocket clients with authentication.
_\examples/websocket/basic/browserify · high confidence
Add compression example with client implementations
The \_examples/compression directory now includes a complete example of using the Iris compression middleware. This includes a server-side example (main.go) that enables compression for JSON responses and request bodies, along with two client examples (client/main.go and client-using-iris/main.go) demonstrating how to send and receive compressed data using standard Go libraries and the Iris context helpers respectively. A corresponding test file (main\_test.go) verifies the compression behavior, including edge cases with the request recorder.
_\examples/compression · high confidence
Add content-negotiation example demonstrating response format selection
The \_examples/response-writer/content-negotiation directory now includes a Go example and its corresponding test. The example demonstrates how to use the Iris framework's negotiation API to serve JSON, XML, and HTML responses based on the client's Accept header. The test verifies that the server correctly returns the appropriate content type and, for HTML responses, supports gzip encoding.
_\examples/response-writer/content-negotiation · high confidence
Add context-view-data example using Iris v12
A new example demonstrates how to use the Iris v12 framework to manage view context data. The example shows how to set view data and layout in a middleware, and then render templates with route-specific data, illustrating the MVC features available in the latest version.
_\examples/view/context-view-data · medium confidence
Add desktop app examples using Blink, Lorca, and webview
Three new examples are added to demonstrate building desktop applications with Iris by embedding a web server and a native window. The 'blink' example uses the blink library, 'lorca' uses the Lorca library, and 'webview' uses the webview library. Each example runs an Iris HTTP server in the background and displays its content in a native OS window, providing templates for creating hybrid desktop apps.
_\examples/desktop · high confidence
Add embedded file server example using go-bindata
A new example at \_examples/file-server/http2push-embedded demonstrates serving static files from an embedded file system using go-bindata. The example includes a generated bindata.go file that embeds assets like CSS, JS, and HTML files into the binary, and a main.go that configures the Iris framework to serve these embedded files via a custom http.FileSystem implementation, allowing the application to run without external asset directories.
_\examples/file-server/http2push-embedded · medium confidence
Add embedded template example with layout support
The \_examples/view/embedding-templates-into-app example now demonstrates how to embed HTML templates into a Go binary using the embed package. It includes layout templates (layout.html, mylayout.html), page templates (page1.html), and partials (page1\_partial1.html) to show how to apply global and route-specific layouts, as well as how to disable layouts for specific routes.
_\examples/view/embedding-templates-into-app · high confidence
Add embedded template examples for Jet and Pug view engines
Introduces new example applications for the Jet and Pug view engines that demonstrate how to embed template files directly into the binary using go-bindata. These examples show how to load embedded assets via the \http.FileSystem\ interface, allowing the application to serve templates without relying on external file system access.
_\_examples/view/template\_jet\_1\embedded · high confidence
Add example configuration for Iris server settings
A new TOML configuration file (iris.tml) is added to the examples, demonstrating how to set server options such as path correction, path escape, method not found handling, body consumption, time format, charset, and remote address headers.
_\examples/configuration/from-toml-file/configs · high confidence
Add example demonstrating third-party JSON encoder integration
A new example at \_examples/response-writer/json-third-party demonstrates how to replace the default JSON serialization in the Iris framework with a third-party library (bytedance/sonic). The example uses iris.Patches() to globally override the context's JSON writer, allowing users to leverage alternative encoders without modifying individual handlers.
_\examples/response-writer/json-third-party · high confidence
Add example for HTML template rendering with layouts and partials
A new example demonstrates how to configure the Iris framework's HTML template engine with global and per-route layouts, as well as the use of template partials and custom template functions. The example shows how to register a view engine, apply a layout to all routes, remove the layout for specific routes, and apply layouts to route groups.
_\_examples/view/template\_html\2 · high confidence
Add example for HTTP/2 push with embedded, pre-compressed static assets
A new example at \_examples/file-server/http2push-embedded-gzipped demonstrates serving embedded static files with HTTP/2 push. The example uses go-bindata to embed assets and configures DirOptions with a Cache setting that enables in-memory caching and pre-compression (gzip, deflate, brotli, snappy) for faster static file serving.
_\examples/file-server/http2push-embedded-gzipped · medium confidence
Add example for MVC done handlers without ctx.Next()
A new example is added at \_examples/mvc/middleware/without-ctx-next/main.go that demonstrates how to execute Done handlers in an MVC application without explicitly calling ctx.Next() in controller methods. The example uses SetExecutionRules to automatically trigger the Done handler, showing users a cleaner way to handle request completion in the Iris MVC framework.
_\examples/mvc/middleware/without-ctx-next · medium confidence
Add example for URL path template function
A new example at \_examples/view/template\_html\_3 demonstrates how to use the 'url path' template function with the HTML template engine. The example registers an HTML view, defines multiple routes with various path patterns including named parameters and wildcards, and shows how to resolve route paths and perform redirects using route names.
_\_examples/view/template\_html\3 · high confidence
Add example for configurable route handler execution rules
Added a new example demonstrating how to use the \Party\#SetExecutionRules\ API to modify the default execution flow of route handlers. The example shows how to force the execution of \Done\ handlers regardless of whether \ctx.Next()\ is called, allowing for more flexible control over the handler chain.
_\examples/routing/route-handlers-execution-rules · medium confidence
Add example for context-based dependency registration
Added a new Go example demonstrating how to register a request-scoped dependency using the Iris framework's context. The example shows how a middleware can store a value in the request context and then register it as a dependency, allowing handlers to receive it as an input argument. This illustrates a pattern for dependency injection where the dependency is resolved from the request context rather than a global container.
_\examples/dependency-injection/context-register-dependency · high confidence
Add example for custom context wrapper in routing
Added a new example at \_examples/routing/custom-context that demonstrates how to use Iris's ContextWrapper to wrap handlers with a custom context type. The example shows how to implement a context pool and override methods like HTML to add custom behavior, providing a template for users who need to extend the default context.
_\examples/routing/custom-context · high confidence
Add example for custom fast Accesslog Formatter
A new example at \_examples/logging/request-logger/accesslog-formatter demonstrates how to create a custom, high-performance access log formatter in Go. The example implements a custom formatter that writes to a file, uses a sync.Pool for buffer reuse, and formats log entries with specific delimiters and blank placeholders for missing request IDs.
_\examples/logging/request-logger/accesslog-formatter · high confidence
Add example for custom macro parameter types and functions
The \_examples/routing/macros/main.go file was added to demonstrate how to register a custom parameter type (slice) and a custom macro function (contains) using the Iris framework's macro system. The example shows registering a custom type resolver for \[\]string and using it in both Hero handlers and standard HTTP handlers, allowing users to define complex path parameter parsing and validation logic.
_\examples/routing/macros · medium confidence
Add example for custom query parameter decoding
A new example demonstrates how to register a custom decoder for the MongoDB ObjectID type when using the ReadQuery method, addressing issue \#1671.
_\examples/request-body/form-query-headers-params-decoder · high confidence
Add example for custom router wrapping
A new example demonstrates how to use the .WrapRouter method to intercept HTTP requests and execute custom logic before the router processes the request. The example shows how to handle specific paths (like /other) with a custom handler while allowing other routes to proceed normally. A corresponding test verifies the behavior of the wrapped router.
_\examples/routing/custom-wrapper · high confidence
Add example for dynamic subdomain routing with custom URL generation
Added a new example in \_examples/view/template\_html\_4 that demonstrates dynamic subdomain routing using the Iris framework. The example configures wildcard subdomains and registers a custom 'url' template function to generate links with specific hosts and schemes. It includes a hosts file and template files to showcase route generation for various path patterns, including static and dynamic parameters.
_\_examples/view/template\_html\4 · high confidence
Add example for embedding static files into the application binary
An example demonstrating how to embed static assets (CSS, JS, images) into the Go binary using the standard library's embed.FS and the HandleDir method. The example includes a corresponding test that verifies the correct content types and response bodies for the embedded files.
_\examples/file-server/embedding-files-into-app · high confidence
Add example for multi-channel Server-Sent Events with a third-party package
A new example was added to demonstrate how to use the 'go-sse' third-party package to handle Server-Sent Events. The example implements a Go server using the 'kataras/iris' framework that serves an HTML page and manages two distinct event channels ('channel-1' and 'channel-2') with custom retry intervals and CORS headers. The client-side code in 'index.html' connects to both channels to display incoming messages.
_\examples/response-writer/sse-third-party-2 · high confidence
Add example for per-method middleware registration in MVC applications
Added a new example demonstrating four different approaches for registering middleware within an MVC application, including using the router, party configuration, and the AfterActivation hook for specific route methods. The example also shows how to apply middleware to a single controller method using ctx.Proceed. The implementation uses the 'io' package instead of 'ioutil' and updates the import path to include the 'v12' suffix.
_\examples/mvc/middleware/per-method · high confidence
Add example for reading custom request bodies via Unmarshaler
A new example demonstrates how to read a custom request body (YAML) by passing a custom unmarshaler to the context. The example includes both the implementation and an integration test that verifies the server correctly parses and echoes the YAML payload.
_\examples/request-body/read-custom-via-unmarshaler · high confidence
Add example for removing a middleware handler from a route
A new example demonstrates how to remove a specific handler (middleware) from a route using the RemoveHandler method. The example shows removing a middleware from a specific route and includes a corresponding test to verify the behavior.
_\examples/routing/remove-handler · high confidence
Add example for rendering templates to arbitrary writers
A new example demonstrates using app.View to render templates to an arbitrary io.Writer, such as os.Stdout, allowing users to capture template output for non-HTTP uses like generating emails. The example includes the necessary app.Build() call and shows how to pass template data to the rendering function.
_\examples/view/write-to · high confidence
Add example for request default values via dependencies
A new example at \_examples/mvc/request-default-values demonstrates how to set default values for request inputs by registering a request-scoped dependency. The code shows binding URL query parameters to a struct and applying defaults (e.g., 'ASC') when values are missing, illustrating a recommended pattern for handling request inputs in MVC controllers.
_\examples/mvc/request-default-values · medium confidence
Add example for streaming JSON body parsing
A new example at \_examples/request-body/read-json-stream demonstrates how to parse a stream of JSON objects from an HTTP request body using the Context.ReadJSONStream method. The example shows how to handle multiple JSON objects sequentially and collect them into a slice, contrasting with the standard single-object JSON parsing approach.
_\examples/request-body/read-json-stream · high confidence
Add example project structure with CLI, API, and configuration
Introduces a complete example project structure including a CLI entry point, an HTTP server with CORS and compression support, user API endpoints, and YAML-based configuration. The example demonstrates how to wire up the Iris framework with custom middleware, dependency injection for database and user repositories, and structured help templates showing build revision and runtime version.
_\examples/project · high confidence
Add example template for URL path generation
A new HTML template is added to the example project to demonstrate URL path generation using the {{urlpath}} template function. The template renders links to various route patterns, including those with static path segments, multiple parameters, and wildcard matching, illustrating how the framework handles different URL structures in the view layer.
_\_examples/view/template\_html\3/templates · medium confidence
Add examples for embedding static assets into the Go binary
Added two new example applications in the \file-server\ directory: \embedding-files-into-app-bindata\ and \embedding-gzipped-files-into-app-bindata\. The first demonstrates how to embed static assets (CSS, JS, images) directly into the application binary using \go-bindata\, serving them via \iris.HandleDir\. The second example extends this by demonstrating how to serve pre-compressed (gzip, deflate, br, snappy) embedded assets with caching enabled via \iris.DirCacheOptions\. Both examples include corresponding test files (\main\_test.go\) to verify that the embedded files are served correctly.
_\examples/file-server/embedding-files-into-app-bindata · high confidence
Add examples for integrating third-party and native HTTP handlers with Iris
The examples/convert-handlers directory now includes three new example files demonstrating how to integrate standard library and third-party HTTP handlers with the Iris framework. The nethttp/ directory provides a basic example of wrapping a standard library http.Handler, while the nethttp/wrapper/ subdirectory shows how to wrap a third-party handler using the app.WrapRouter method. Additionally, a new example in the convert-handlers directory demonstrates a Negroni-like middleware pattern. These examples illustrate practical patterns for interoperability with existing Go HTTP middleware and handlers.
_\examples/convert-handlers/nethttp · high confidence
Add examples for integrating third-party net/http middleware with Iris
Two new example files demonstrate how to integrate the raven-go error tracking library with the Iris web framework. The 'wrapping-the-router' example shows how to wrap the router to capture panics, while the 'writing-middleware' example illustrates converting a native Go HTTP handler into an Iris middleware using the standard library's http.Handler interface.
_\examples/convert-handlers/real-usecase-raven · high confidence
Add examples for same route path pattern with different macro functions
Added new example files in the routing/dynamic-path/same-pattern-different-func directory, including main.go, main\_test.go, and a use-global subdirectory with its own main.go and main\_test.go. These files demonstrate how to handle multiple routes with the same path pattern but different macro functions, including the use of global middleware and done handlers.
_\examples/routing/dynamic-path/same-pattern-different-func · high confidence
Add file upload example for Iris
Added a new example demonstrating file upload functionality using the Iris web framework. The example includes a Go handler that processes multipart form data, saves uploaded files to a local directory, and enforces a 5MB size limit on incoming requests. The accompanying HTML template provides the user interface for file selection and submission.
_\examples/file-server/upload-file · high confidence
Add file upload example for the Iris framework
Introduces a new example demonstrating how to handle file uploads using the Iris web framework. The addition includes a Go application that supports both automatic multipart form processing and manual file handling, along with the corresponding HTML template and automated tests to verify upload functionality.
_\examples/file-server/upload-files · high confidence
Add form-reading examples for standard fields and checkboxes
New example code demonstrates how to read form data, including a multi-select field and a checkbox array, using the Iris framework's ReadForm method. The update provides templates and Go handlers that show users how to bind form submissions to struct fields, specifically illustrating the handling of multiple values in a single field.
_\examples/request-body/read-form · high confidence
Add gRPC bidirectional streaming example
Added a new example demonstrating bidirectional streaming with gRPC, including the server implementation using Iris, the client implementation, the Protobuf definitions, and the necessary TLS certificates for secure communication.
_\examples/mvc/grpc-compatible-bidirectional-stream · high confidence
Add gRPC-compatible HTTP client example
A new example is added at \_examples/mvc/grpc-compatible/http-client that demonstrates how to communicate with the gRPC-compatible server using standard HTTP/JSON. The client loads TLS certificates, configures an HTTP transport with the appropriate root CA, and sends a JSON-encoded HelloRequest to the server's /helloworld.Greeter/SayHello endpoint, decoding the JSON response into a HelloReply.
(repo-wide) · high confidence
Add gorilla websocket file-watching example
A new example was added at \_examples/websocket/gorilla-filewatch that demonstrates a live-updating file viewer using Gorilla WebSocket. The example serves a home page that connects to a WebSocket endpoint; whenever the watched file is modified, the server pushes the updated contents to the browser in real time.
_\examples/websocket/gorilla-filewatch · high confidence
Add goth OAuth2 example with session support
Added a new example in \_examples/auth/goth demonstrating how to integrate the markbates/goth library for OAuth2 authentication with the Iris framework. The example includes a main.go file that sets up session management using gorilla/securecookie and provides handlers for the authentication flow, along with HTML templates for the index and user profile pages.
_\examples/auth/goth · high confidence
Add i18n examples with template functions, pluralization, and variable support
The i18n example suite is expanded with three new examples: a basic i18n setup supporting multiple locales (en-US, el-GR, zh-CN) with path, subdomain, and query parameter language detection; a plurals example demonstrating pluralization rules and variable interpolation in translations; and a template example showing how to use text/template functions within translation values. Each example includes corresponding tests to verify correct translation behavior.
_\examples/i18n/basic · high confidence
Add in-memory user repository example for MVC login
The \_examples/mvc/login/repositories package now includes a new user\_repository.go file that defines a UserRepository interface and an in-memory implementation (userMemoryRepository). This provides a testable, memory-based data access layer for the MVC login example, supporting operations like Select, SelectMany, InsertOrUpdate, and Delete with thread-safe access to the underlying map storage.
_\examples/mvc/login/repositories · high confidence
Add layout examples for multiple template engines
Added new example code demonstrating how to use view layouts with various template engines (Ace, Blocks, Django, Handlebars, HTML, Jet, and Pug) in the \_examples/view/layout directory. Each subdirectory contains a Go file and corresponding template files that show how to register a view engine, define a layout, and render a view within that layout.
_\examples/view/layout · high confidence
Add login MVC example with user authentication
Added a new example at \_examples/mvc/login-mvc-single-responsibility that demonstrates a complete user authentication flow using the MVC pattern. The example includes controllers for registration, login, and profile viewing, along with templates and CSS for the UI. It showcases session management, in-memory data storage, and single-responsibility design for the user module.
_\examples/mvc/login-mvc-single-responsibility · high confidence
Add login and users API controllers for the MVC example
The \_examples/mvc/login example now includes two new controllers: a user controller handling registration, login, profile viewing, and logout via the MVC pattern, and a users controller exposing a RESTful API for CRUD operations on users. This provides a complete, working example of authentication flows and API design within the framework.
_\examples/mvc/login/web/controllers · high confidence
Add multi-environment configuration example
Added a new example in \_examples/configuration/multi-environments that demonstrates how to manage environment-specific configuration files (server.yml and server.dev.yml) for an Iris-based Go application. The example includes a CLI entry point using Cobra, a configuration loader that binds YAML files to a struct, and a server wrapper that handles graceful shutdown and middleware registration, showing how to switch between development and production settings via command-line flags.
_\examples/configuration/multi-environments · high confidence
Add multi-subdomain routing example
Added a new example demonstrating how to route requests to different subdomains (dashboard, system, and frontend) using the Iris framework's Party feature, along with a hosts file for local development.
_\examples/routing/subdomains/multi · high confidence
Add native WebSocket message example
A new example demonstrating raw WebSocket communication is added to the \_examples/websocket/native-messages directory. The Go server registers a handler that accepts and broadcasts native messages without using the framework's higher-level messaging abstractions, while the client side uses the browser's native WebSocket API to connect to the /my\_endpoint and send/receive messages.
_\examples/websocket/native-messages · high confidence
Add new 'Hi' template example
A new HTML template named 'hi.html' has been added to the examples directory. This template renders a simple page with a title and a heading that displays a name, serving as a basic example for template usage.
_\_examples/view/template\_html\0/templates · high confidence
Add new dependency injection examples for overview and sessions
Added a new 'overview' example demonstrating a complete MVC-style application with dependency injection, including a movie data model, in-memory repository, service layer, and web routes with basic authentication middleware. Also added a 'sessions' example showing how to use the Iris sessions package to track user visits. These new examples illustrate how to structure an application using the framework's dependency injection container and session management features.
_\examples/dependency-injection/overview · high confidence
Add new view engine examples for template rendering and layouts
Added two new example files in the \_examples/view directory demonstrating the usage of the Iris v12 view engine. The 'overview' example shows how to register custom template functions and render HTML templates with various data structures. The 'template\_html\_1' example demonstrates how to configure and use HTML layouts for template rendering.
_\examples/view/overview · high confidence
Add online visitors example using WebSocket and neffos
A new example demonstrates real-time online visitor counting using the Iris framework's built-in WebSocket support. The example tracks concurrent connections per page, broadcasting live visitor counts to all connected clients via WebSocket events, with separate counters for the index and other pages.
_\examples/websocket/online-visitors · high confidence
Add path intelligence and 404 suggestion examples
New examples in \_examples/routing/intelligence demonstrate how to enable path intelligence for route matching and how to handle 404 errors by suggesting similar paths. The main.go file shows the use of iris.WithPathIntelligence, while manual/main.go illustrates the OnErrorCode handler for 404s, using ctx.FindClosest to suggest alternative routes.
_\examples/routing/intelligence · high confidence
Add permissions example using Iris and BoltDB
A new example at \_examples/auth/permissions/main.go demonstrates how to implement role-based access control in an Iris application. The example uses the 'github.com/xyproto/permissionbolt' library to manage user states, including login/logout status, user confirmation, and administrative privileges. It provides endpoints for registering users, confirming accounts, logging in and out, and accessing restricted admin routes, illustrating how to integrate permission checks into an HTTP server.
_\examples/auth/permissions · high confidence
Add rate-limited file download example
A new example at \_examples/file-server/send-files demonstrates how to serve files with a configurable download speed limit. The example registers two routes: one for standard file downloads and another, /download, which uses the new SendFileWithRate method to restrict the transfer rate to 50KB/s with a 100KB burst, illustrating the integration of the new rate-limiting functionality into the Iris framework.
_\examples/file-server/send-files · high confidence
Add request body reading example with multi-format support
A new example at \_examples/request-body/read-body demonstrates how to read and parse request bodies using the Iris framework. The example shows binding incoming data to a struct and responding with JSON, XML, YAML, and MessagePack formats, illustrating content negotiation and automatic decompression capabilities.
_\examples/request-body/read-body · high confidence
Add rewrite middleware example for URL redirection and modification
The \examples/routing/rewrite directory now contains a complete example of the rewrite middleware, including main.go, redirects.yml, and hosts configuration. This demonstrates how to configure URL redirections (e.g., /seo/\ to /\, /docs/v12\ to /docs) and internal URL modifications (e.g., /users.json to /users?format=json) using the rewrite package. The example also shows subdomain redirection (test to newtest) and the use of PrimarySubdomain for root domain to www redirection.
_\examples/routing/rewrite · medium confidence
Add routing example with subdomains, nested parties, and body size limits
The \_examples/routing directory now includes a comprehensive routing example that demonstrates advanced routing features. It showcases nested route groups (parties) for a game API, subdomain handling (including wildcard subdomains), and request body size limiting. The example also includes a corresponding test suite that validates all defined routes, subdomains, and error conditions.
_\examples/routing · high confidence
Add session examples demonstrating secure cookie encoding and flash messages
Added new session examples: 'flash-messages' demonstrates using session flash messages, while 'securecookie' shows how to integrate the 'gorilla/securecookie' library for custom cookie encoding. Both examples configure sessions with 'AllowReclaim: true' to allow session data persistence across requests, and include corresponding tests to verify session encoding/decoding and flash message behavior.
_\examples/sessions/securecookie · high confidence
Add sessions overview example
A new example at \_examples/sessions/overview/example/example.go demonstrates session management in the Iris framework, covering basic key-value storage, struct encoding/decoding, type-specific value handling, and immutable data storage.
_\examples/sessions/overview/example · high confidence
Add sessions view data example
Added a new example demonstrating how to pass session data to HTML templates using the Iris framework. The example includes a Go handler that registers a view data middleware to expose the session object to the template, and an HTML template that accesses session data via the template engine.
_\examples/sessions/viewdata · high confidence
Add simple access log example for request logging
A new example at \_examples/logging/request-logger/accesslog-simple demonstrates how to configure and use the accesslog middleware in the Iris framework. The example shows how to set up file-based access logging with custom formatting (JSON with human-readable timestamps) and various configuration options like latency, status code, IP address, and request/response body handling.
_\examples/logging/request-logger/accesslog-simple · high confidence
Add sitemap generation example with route exclusion support
The \_examples/routing/sitemap directory now contains a complete example demonstrating how to generate an XML sitemap for an Iris application. The example shows how to configure the router to list online GET static routes in the sitemap, while excluding specific routes (using ExcludeSitemap) and offline routes from the output. A corresponding test verifies the generated sitemap XML matches the expected structure.
_\examples/routing/sitemap · medium confidence
Add smart-contract example demonstrating dependency injection
A new example was added at \_examples/dependency-injection/smart-contract/main.go that demonstrates how to use Iris' dependency injection system to inject dynamic, per-request dependencies (such as a user object) into route handlers. The example implements a REST API for users, showing how to register dependencies via PartyFunc and how to use the jmespath library to filter JSON responses.
_\examples/dependency-injection/smart-contract · medium confidence
Add streaming response example using context cancellation
A new example at \_examples/response-writer/stream-writer demonstrates streaming HTTP responses. The code shows how to handle client disconnection by listening to the request context's Done channel (ctx.Request().Context().Done()) rather than using the ResponseWriter's CloseNotify, illustrating a pattern for detecting when a client has closed the connection during a long-running stream.
_\examples/response-writer/stream-writer · medium confidence
Add subdomain-based static file serving example
A new example demonstrates how to serve static files from a subdomain (v1.example.com) using the Go Iris framework. The change introduces a main.go file that configures a subdomain route to serve assets from a local directory, along with a corresponding test file (main\_test.go) that validates the correct content types and responses for CSS, JavaScript, and HTML files. This provides a concrete reference for implementing subdomain-based static file serving in Go applications.
_\examples/file-server/subdomain · high confidence
Add templ example for view generation
A new example demonstrates the 'templ' template engine, providing a 'hello.templ' source file and its corresponding Go implementation alongside an 'iris' web server setup to render the component.
_\examples/view/templ · high confidence
Add template examples for the view overview
Added three new HTML template examples in the view overview section: a basic template demonstrating variable rendering and range loops, a template showcasing function and field access, and a simple 'Hi' greeting template.
_\examples/view/overview/templates · high confidence
Add template\_blocks\_0 example using the Blocks template engine
A new example demonstrates the Blocks template engine for the Iris web framework. The example registers the Blocks view engine, defines layout templates with content and message blocks, and implements handlers for the index and 500 error pages, illustrating how to structure views using the Blocks syntax.
_\_examples/view/template\_blocks\0 · high confidence
Add user data model and memory-based data source for the login example
The login example now includes a user data model (datamodels/user.go) that defines the User struct with JSON and form tags, along with password hashing and validation helpers using bcrypt. Additionally, a new datasource package (datasource/users.go) introduces an Engine type to represent data sources (Memory, Bolt, MySQL), with the current implementation providing a simple in-memory map-based user store for demonstration purposes.
_\examples/mvc/login/datasource · medium confidence
Add versioned controller example with API deprecation support
Added a new example at \_examples/mvc/versioned-controller that demonstrates MVC-based API versioning. The example registers controllers for specific API versions (v1, v2, v3) using version constraints, and shows how to mark a controller as deprecated with custom warning and deprecation date headers.
_\examples/mvc/versioned-controller · high confidence
Add view engine benchmarks for seven template parsers
A new benchmark suite has been added to \_benchmarks/view, providing performance comparisons for seven supported template parsers: Ace, Blocks, Django, Handlebars, HTML, Jet, and Pug. Each engine is implemented in its own subdirectory with corresponding view templates and configuration, allowing users to evaluate throughput, latency, and other metrics across different rendering strategies.
_\benchmarks/view · high confidence
Add www subdomain routing examples
Added new example code in the \_examples/routing/subdomains/www directory that demonstrates how to handle subdomains in the Iris web framework. The changes include a hosts file for local development, a main.go file showing how to copy routes to a 'www' subdomain, a corresponding test file, and a separate www-method example that utilizes the app.WWW() helper for automatic redirection. These files provide a practical reference for developers implementing subdomain routing.
_\examples/routing/subdomains/www · high confidence
Added Django template example demonstrating the urlpath function
A new example in the \_examples/view/template\_django\_1 directory demonstrates how to use the urlpath template function to generate URLs for named routes, including handling path parameters and arrays.
_\_examples/view/template\_django\1 · high confidence
Added MVC error handling example with custom result types
Added a new example in the MVC package demonstrating how to implement a custom error handling strategy using the mvc.Result interface. The example shows how to return a custom error response struct from a controller method, which then dispatches to specific HTML templates (404.html and 500.html) based on the HTTP status code.
_\examples/mvc/error-handler-custom-result · high confidence
Added ParseTemplate examples for all supported view engines
The \_examples/view/parse-template directory now contains complete, runnable examples for every supported template engine (HTML, Pug, Ace, Django, Handlebars, and Jet). Each example demonstrates how to use the ParseTemplate method to manually parse and register a template from a byte slice or string, allowing developers to see how to integrate inline or dynamically generated templates with the respective view engine.
_\examples/view/parse-template · high confidence
Added Protobuf example with new Context.ReadJSONProtobuf method
The \_examples/response-writer/protobuf directory was added, providing a complete example of using Protocol Buffers with the Iris framework. This includes the proto definition, generated Go code, and a main.go demonstrating the new Context.ReadJSONProtobuf method alongside existing Protobuf and JSON serialization capabilities.
_\examples/response-writer/protobuf · high confidence
Added default CSS styling for the routing overview example
The routing overview example now includes a default stylesheet that sets the page background to black, providing a consistent visual theme for the example application.
_\examples/routing/overview/public · high confidence
Added example applications for real-time server monitoring
Two new example applications were added to demonstrate real-time monitoring capabilities. The first, located in \_examples/monitor/monitor-middleware, showcases the Iris monitor middleware for tracking process and OS statistics via JSON and a default view. The second, in \_examples/monitor/statsviz, integrates the statsviz library to provide a web-based dashboard for visualizing server statistics in real-time.
_\examples/monitor · high confidence
Added example assets for file-server demo
Added static assets for the file-server example, including HTML pages (index.html, app2/index.html, app2/app2app3/index.html, and app2/app22/just\_a\_text\_no\_index.txt), a CSS stylesheet (css/main.css), and a JavaScript file (js/main.js). These files provide the content served by the file server in the basic example.
_\examples/file-server/basic/assets · high confidence
Added example demonstrating route removal
A new example in the routing section demonstrates how to remove a previously registered route using the RemoveRoute method, allowing users to see how to dynamically unregister handlers in the Iris framework.
_\examples/routing/remove-route · medium confidence
Added example for dynamic path parameters with prefix validation
A new example demonstrates how to use dynamic path parameters with a required '@' prefix and a minimum length constraint, showing how the framework matches routes like /@username while rejecting invalid formats.
_\examples/routing/dynamic-path/at-username · medium confidence
Added example for request rate limiting with the ulule-limiter library
Added two new example files in the \_examples/request-ratelimit directory to demonstrate request rate limiting. The first, rate-middleware/main.go, shows how to use the built-in Iris rate limiter middleware. The second, ulule-limiter/main.go, demonstrates integrating the external ulule/limiter library with the Iris web framework to implement IP-based rate limiting.
_\examples/request-ratelimit · high confidence
Added gRPC-compatible helloworld example
A new gRPC-compatible helloworld example has been added to the MVC examples, providing a reference implementation for implementing gRPC services using the framework's MVC patterns. The example includes the necessary .proto definition, the generated Go code, and a README file, demonstrating how to build a gRPC server compatible with the standard gRPC protocol.
(repo-wide) · high confidence
Added login example views and styles
The login example now includes a complete set of HTML templates and CSS styles for the user interface. This includes a shared layout template, an error page, and specific views for login, registration, and the user profile page, along with a new site.css file to style the forms and buttons.
_\examples/mvc/login/web/views · high confidence
Added new example applications for authentication, logging, profiling, and routing
Added several new example applications to the \_examples directory, including a reCAPTCHA authentication example (both standard and custom form), a file-based logger example, a pprof profiling example, a JSON request body reading example, a MsgPack reading example, a basic hello-world routing example, and a subdomain routing example. These additions provide practical demonstrations of various Iris features such as middleware integration, logging to files, performance profiling, and subdomain routing.
(repo-wide) · high confidence
Added panic recovery examples
Added two new example files in the \_examples/recover directory: a basic panic recovery handler and a more advanced example demonstrating panic handling with a custom error handler and compression support.
_\examples/recover · high confidence
Added wildcard subdomain routing example
The \_examples/routing/subdomains/wildcard directory now includes a Go example demonstrating how to handle dynamic or wildcard subdomains using the Iris framework. The main.go file registers a wildcard subdomain handler that captures any subdomain (e.g., username1.mydomain.com) and routes it to a common handler, while the hosts file provides local DNS mappings for development. This allows users to see how to catch unknown or dynamic subdomains in a web application.
_\examples/routing/subdomains/wildcard · high confidence
Complete rewrite of the view package with a unified Engine interface
The view package has been completely rewritten to provide a unified \Engine\ interface that all template engines (HTML, Blocks, Django, Handlebars, Jet, Pug, and Ace) now implement. This change introduces a consistent API for registering, loading, and executing templates across all supported engines, while also exposing engine-specific configuration methods (such as \Reload\, \Layout\, and \AddFunc\) through the \EngineFuncer\ interface. The refactoring standardizes how templates are loaded from file systems or embedded assets, simplifying the integration of new template engines and improving the maintainability of the view system.
view · high confidence
Embedded template engine example added
An example demonstrating the use of embedded HTML templates via go-bindata, allowing the application to serve static view files without relying on the filesystem at runtime. The example registers the embedded templates with the Blocks template engine, enabling the use of layout templates and partials from the embedded asset file.
_\_examples/view/template\_blocks\_1\embedded · high confidence
Example of secure cookie encoding using Gorilla SecureCookie
Added a new example demonstrating how to use custom cookie encoders and decoders with the Iris framework. The example integrates the 'github.com/gorilla/securecookie' library to encode and decode cookie values, ensuring that cookies are not stored in plain text. The implementation configures the Iris application to use secure cookie encoding via a middleware that sets the cookie options, and includes tests to verify that the cookie value is encoded and can be correctly retrieved.
_\examples/cookies/securecookie · high confidence
Expanded HTTP server examples and documentation
The \_examples/http-server area now includes a comprehensive README.md guide and a suite of new example programs demonstrating various server configurations. These include serving via custom HTTP servers, multiple concurrent listeners, custom network listeners (including Unix sockets), graceful shutdown handling, HTTP/2 without TLS, HTTP/3 over QUIC, Let's Encrypt integration, TLS/HTTPS, and socket sharding. This provides users with concrete templates for common and advanced server setups.
_\examples/http-server · high confidence
File server example adds JS upload and rich directory listing
The file-server example now provides a modern file management interface. Users can upload files using a JavaScript-based upload form, and directory listings are rendered with a rich, styled HTML template that includes file size formatting and delete functionality. The server also supports basic authentication for file deletion and allows serving files as attachments with configurable speed limits.
_\examples/file-server/file-server · high confidence
HTTP/2 push support for static file serving
The file server example now supports HTTP/2 server push for static assets. By configuring \DirOptions.PushTargets\ or \PushTargetsRegexp\, developers can specify which resources (such as CSS, JS, or image files) should be pushed to the client alongside the initial HTML response. This example demonstrates the feature using a wildcard pattern (\iris.MatchCommonAssets\) to automatically push common asset types, requiring the server to run over TLS to enable HTTP/2.
_\examples/file-server/http2push · high confidence
Introduce MVC versioning and deprecation support
Developers can now apply version constraints to controllers using the new \mvc.Version\ option, which automatically enforces API versioning headers and sets the route registration rule to \RouteOverlap\ to allow multiple controller versions to coexist on the same path. Additionally, the \mvc.Deprecated\ option has been added to mark specific controllers as deprecated, allowing developers to signal to clients that a newer version of the resource is available. These features are implemented in the new \mvc/versioning.go\ file and integrated into the \mvc.Application.Handle\ API.
mvc · high confidence
Introduce fallback view handling in the view example
The \_examples/view/fallback example now demonstrates how to register fallback views, layouts, and custom fallback functions using the new FallbackView API, allowing the application to gracefully handle missing templates by rendering a fallback template or executing a custom handler.
_\examples/view/fallback · high confidence
Introduce httptest package for simplified HTTP testing
A new \httptest\ package is added to provide a streamlined way to test Iris applications. It includes helper functions like \New\ and \NewInsecure\ that wrap the \httpexpect\ library to simplify writing integration tests. The package also provides aliases for \net/http/httptest\ types and constants for HTTP status codes, including the new 103 Early Hints status.
httptest · high confidence
Introduce macro package for route path parameter validation and error handling
The \macro\ package has been extracted from the router to provide a public API for defining, parsing, and evaluating path parameters. This includes a new \handler\ sub-package that generates middleware to validate path parameters at runtime, allowing developers to register custom error handlers for invalid parameters. The package includes a lexer, parser, and AST for parsing route templates, along with built-in macro types (e.g., \int\, \string\, \uuid\) and the ability to register custom parameter types and validation functions. This change enables more robust route matching and error handling for dynamic path segments.
macro · high confidence
Introduce new auth package with JWT-based authentication and SSO support
The repository introduces a new 'auth' package (previously 'sso') that provides a complete JWT-based authentication and single-sign-on (SSO) solution for the Iris framework. This change adds core types and handlers for signing and verifying access and refresh tokens, including request/response structures for sign-in and token refresh. It also exposes helper functions to retrieve the access token, standard claims, and the authenticated user from the context, alongside configurable cookie security and error handling.
auth · high confidence
Introduce the 'hero' package for standalone dependency injection and handler binding
The 'hero' package is introduced to provide a standalone dependency injection container and handler binding system, separate from the existing 'mvc' package. This allows developers to create rich, bound handlers without the full MVC controller structure. The package includes a 'Container' for managing dependencies, 'binding' logic to map function inputs to dependencies, and 'handler' creation that automatically resolves and injects registered dependencies. It also provides a 'Result' interface for custom response dispatching and supports various content types (JSON, XML, Protobuf, MsgPack) through a default result handler. Tests confirm the container can inject values outside the HTTP lifecycle and handle function results correctly.
hero · high confidence
Introduce the \`apps\` package for global application management and host-based routing
The \apps\ package is added to provide global, scoped control over all registered Iris Applications within a program. It introduces a \Get\ function to retrieve applications by name (or the last registered one), an \OnApplicationRegistered\ listener hook, and a \Switch\ function that routes requests to different applications based on host patterns. The package also includes a \Hosts\ switch provider for mapping domains to applications and a \SetHost\ option to force the request's host header, enabling scenarios like serving \www\ and root domains with the same internal host context.
apps · high confidence
Introduce x/client HTTP client and x/errors error handling utilities
Added a new x/client sub-package providing a configurable HTTP client with support for base URLs, timeouts, rate limiting, and request/response handlers. The package includes an APIError type for structured error handling and a handler transport for testing against http.Handlers. Simultaneously, the x/errors package was introduced to standardize error handling in REST services, offering pre-registered HTTP status codes, a HandleError function to automatically map errors to JSON responses, and helper functions (Handle, HandleCreate, HandleUpdate, HandleDelete) for common CRUD operations. The x/errors/validation sub-package adds generic, type-safe validation errors for strings, numbers, and slices, while x/jsonx provides new types like DayTime and ISO8601 for robust time and duration serialization.
x · high confidence
Major i18n overhaul: template variables, pluralization, and flexible loading
The i18n package has been significantly refactored to support advanced translation features. Users can now define template variables within translation files, enabling dynamic content in messages. Pluralization is fully supported, allowing for correct grammar forms in different languages. The loader has been updated to support multiple file formats (YAML, TOML, JSON, INI) and can load from various sources including the Go \embed\ package, \fs.FS\, and standard file paths. Additionally, the \LoadKV\ method has been added to allow loading translations directly from a map, and template functions can be registered per locale.
i18n · high confidence
New Basic Auth examples for in-memory, file-based, and database-backed user stores
The \_examples/auth/basicauth directory now includes four new example applications demonstrating different ways to configure the basicauth middleware. The 'basic' example shows a simple in-memory user list, while 'users\_list' demonstrates configuring expiration and garbage collection for in-memory users. The 'users\_file\_bcrypt' example illustrates loading users from a YAML file with bcrypt-hashed passwords. Finally, the 'database' example provides a complete Dockerized setup for authenticating against a MySQL database, including the necessary Dockerfile, docker-compose.yml, and SQL migration scripts.
_\examples/auth/basicauth · high confidence
New DropzoneJS and Caddy examples for file uploads and reverse proxying
Added new example projects demonstrating how to integrate the Iris web framework with external tools. The \_examples/dropzonejs directory provides a complete tutorial and code for building a multiple file upload form using DropzoneJS, including server-side handling, thumbnail generation, and JSON API endpoints. Additionally, the \_examples/caddy directory introduces a Caddyfile configuration and Go server setups to demonstrate how to use Caddy as a reverse proxy in front of one or more Iris web servers.
_\examples/dropzonejs · high confidence
New HTML template engine example for view rendering
Added a new example demonstrating how to configure and use the built-in HTML template engine with the Iris framework. This example shows how to register a view engine, add custom template functions (like 'greet'), and render HTML templates in a web application.
_\_examples/view/template\_html\0 · high confidence
New HTTP/2 server push example
Added a new example demonstrating HTTP/2 server push, showing how to proactively push assets like JavaScript files to the client before they are explicitly requested, using the Go 1.8+ http.Pusher interface.
_\examples/response-writer/http2push · high confidence
New MVC WebSocket authentication example
The repository adds a new example at \_examples/mvc/websocket-auth that demonstrates how to secure WebSocket connections using the Iris framework's built-in authentication system. This includes a complete MVC-style implementation with a Go backend (main.go, user.go, user\_provider.go) that handles sign-in, sign-out, and token validation, alongside HTML templates and a browser client (index.html) that connects via WebSocket to a protected namespace.
_\examples/mvc/websocket-auth · high confidence
New MVC overview example with environment-aware services and Docker support
Added a complete MVC example at \_examples/mvc/overview that demonstrates environment-based dependency injection (DEV/PROD) for database and service layers, along with Dockerfile and docker-compose.yml for containerized development and testing.
_\examples/mvc/overview · high confidence
New MySQL example with Iris, Groupcache, and Docker support
Added a new example demonstrating a MySQL-backed API using the Iris web framework, complete with JWT authentication, groupcache-based caching for products, and a Docker Compose setup for local development. The example includes full CRUD endpoints for categories and products, along with a Postman collection for testing.
_\examples/database/mysql · high confidence
New ORM and database examples added: GORM, sqlx, and Reform
Added three new example applications in the \_examples/database/orm directory to demonstrate database integration with the Iris framework. The 'gorm' example shows how to use the GORM ORM for managing a 'User' model with SQLite, including CRUD operations. The 'sqlx' example demonstrates using the sqlx library for raw SQL queries and struct scanning. The 'reform' example provides a complete MVC-style application using the Reform ORM, featuring a 'Person' model with generated code for database mapping. Each example includes its own main.go file and supporting files (controllers, models, or READMEs) to serve as a reference for developers.
_\examples/database/orm · high confidence
New accesslog example with custom fields and template formatting
A new example demonstrates how to configure the accesslog middleware to include custom fields, such as a Request ID, and format the log output using a custom template. This allows users to see how to add specific data points to their access logs and control the log line structure.
_\examples/logging/request-logger/accesslog-template · medium confidence
New accesslog, basicauth, grpc, and hcaptcha middleware implementations
The framework introduces several new middleware implementations. The accesslog middleware is added, providing configurable logging of HTTP requests with support for CSV, JSON, and template-based formatters, as well as a log broker for asynchronous processing. The basicauth middleware is introduced to handle HTTP Basic Authentication, supporting user lists, file-based user loading, and bcrypt password hashing. A gRPC router wrapper is added to allow sharing an HTTP/2 port for gRPC servers. Additionally, an hCAPTCHA middleware is provided for bot protection. These additions expand the built-in toolkit for logging, security, and protocol handling.
middleware · high confidence
New browser and server-side caching middleware
The cache package now includes browser-side caching middleware (NoCache, StaticCache, ETag, Cache304) and a server-side caching handler (cache.Handler/Cache) with rule-based validators. This allows developers to control browser caching headers, implement ETag/If-None-Match conditional requests, and use server-side response caching with customizable expiration and validation rules.
cache · high confidence
New cache example implementations for server-side and client-side caching
Added two new example files to demonstrate caching strategies: a client-side caching example using \iris.Cache304\ for browser-based cache control, and a server-side caching example using \cache.Handler\ to store and serve static content in memory with configurable expiration times.
_\examples/response-writer/cache · high confidence
New conditional routing handler example
Added a new example demonstrating the use of NewConditionalHandler for conditional routing, where middleware execution depends on a filter function. The example shows how to conditionally apply middleware based on a URL parameter, and includes tests to verify the behavior.
_\examples/routing/conditional-chain · high confidence
New context package with comprehensive HTTP handling and compression support
The context package has been restructured and expanded to include dedicated files for handling HTTP headers (accept\_header.go), application lifecycle and configuration (application.go, configuration.go), function registration and execution (context\_func.go), user authentication models (context\_user.go), file system resolution (fs.go), and handler naming (handler.go). This introduces robust support for content negotiation, gzip/brotli/snappy compression, user identity management, and template rendering, providing a more modular and feature-rich request context for developers.
context · high confidence
New core packages for error grouping, HTTP handler conversion, and server supervision
The core package introduces several new sub-packages to enhance framework capabilities. The \core/errgroup\ package provides a \Group\ type for managing and grouping multiple errors, supporting hierarchical error structures with type information. The \core/handlerconv\ package adds \FromStd\ and \FromStdWithNext\ functions to seamlessly convert standard \http.Handler\ and \http.HandlerFunc\ implementations into Iris-compatible \context.Handler\ wrappers, including support for middleware-style handlers that receive a \next\ function. The \core/host\ package introduces a \Supervisor\ for managing HTTP servers, offering non-blocking startup, graceful shutdown on interrupt signals, and proxy/redirect capabilities. Additionally, the \core/memstore\ package adds serialization support via \gob\ encoding for store entries, and the \core/host\ package also includes a \Waiter\ for non-blocking server startup checks.
core · high confidence
New example applications for hCaptcha authentication and routing overview
Added two new example applications to demonstrate specific Iris features. The \auth/hcaptcha\ example shows how to integrate hCaptcha for bot protection on a registration form. The \routing/overview-2\ example demonstrates advanced routing capabilities, including subdomains, JSON/XML serialization, dynamic path parameters, and template rendering.
_\_examples/auth/hcaptcha, \examples/routing/overview-2 · high confidence
New example demonstrating MVC middleware registration
A new example at \_examples/mvc/middleware/main.go has been added to show how to register middleware for an MVC application by using its Router. The example includes a cache handler and demonstrates handling controller methods with and without caching.
_\examples/mvc/middleware · high confidence
New example demonstrating cookie options and request-lifecycle cookie management
Added a new example in \_examples/cookies/options that demonstrates how to configure cookie options for the entire request lifecycle using the CookieAllowReclaim feature. This allows cookies set or removed during a request to be immediately reflected in the Request object, ensuring subsequent handlers see the updated state. The example includes both the implementation and corresponding tests to verify cookie setting, retrieval, and removal.
_\examples/cookies/options · high confidence
New example demonstrating multiple body reads with Iris
Added a new example at \_examples/request-body/read-many that demonstrates how to read the HTTP request body multiple times using the Iris framework. The example shows how to use ctx.GetBody() to retrieve the body content and configure the application with iris.WithoutBodyConsumptionOnUnmarshal to allow subsequent handlers to access the body data.
_\examples/request-body/read-many · high confidence
New example demonstrating route registration rule behavior
Added a new example in the routing section that demonstrates how to configure route registration rules, specifically showing how the 'RouteSkip' rule prevents an 'Any' route from overriding a previously registered 'GET' route. The example includes both the implementation and corresponding tests to verify the expected behavior across all HTTP methods.
_\examples/routing/route-register-rule · high confidence
New example for ReadURL usage
Added a new example demonstrating how to use the ReadURL method to parse URL parameters and query strings into a struct, including a corresponding test to verify the behavior.
_\examples/request-body/read-url · high confidence
New example for Slack-based access log formatting
Added a new example in the \_examples/logging/request-logger/accesslog-slack directory that demonstrates how to format access logs and send them to a Slack channel. The example includes a custom Slack formatter that utilizes the slack-go/slack library to post log messages to specified channels, configurable via environment variables for the bot token and channel ID.
_\examples/logging/request-logger/accesslog-slack · high confidence
New example for reading query parameters and URL params
Added a new example demonstrating how to read query parameters using the Context.ReadQuery method, including handling of required fields and empty query errors via the WithEmptyFormError option. The example also shows how to retrieve multiple values for a single query key using the new URLParamSlice method.
_\examples/request-body/read-query · high confidence
New example for serving a custom favicon
Added a new example in the file-server/favicon directory that demonstrates how to serve a custom favicon using the Favicon method, including a simple HTML page that links to the icon.
_\examples/file-server/favicon · high confidence
New examples for reading request bodies in YAML and XML formats
Added new example applications demonstrating how to parse incoming request bodies into Go structs using YAML and XML formats. The 'read-yaml' example shows how to use the context's ReadYAML method to deserialize YAML payloads, while 'read-xml' demonstrates using ReadXML for XML payloads. Additionally, the 'read-custom-per-type' example illustrates how to implement a custom BodyDecoder interface on a struct to handle unmarshaling, providing a flexible approach for custom parsing logic. Each example includes corresponding tests to verify the functionality.
_\_examples/request-body/read-custom-per-type, \_examples/request-body/read-xml, \examples/request-body/read-yaml · high confidence
New file server API with in-memory caching and compression support
The file server example has been updated to use the new \iris.Dir\ and \iris.DirOptions\ API, which introduces in-memory caching (\DirCacheOptions\) and pre-compression for static files. The example demonstrates configuring these options, including enabling caching, ignoring image types for compression, and setting minimum file sizes. A corresponding test suite (\main\_test.go\) has been added to verify the behavior of the new file server implementation.
_\examples/file-server/basic · medium confidence
New functional configuration options for Iris
The examples now demonstrate configuring the application using functional options (e.g., \iris.WithoutStartupLog\, \iris.WithCharset\) via \app.Listen\ or \app.Configure\. This provides a more concise and idiomatic way to modify specific configuration fields, as opposed to passing a full \iris.Configuration\ struct.
_\examples/configuration/functional · medium confidence
New middleware examples for global, per-route, and shared state
Added example code for the 'writing a middleware' guide, demonstrating how to register global and per-route middleware, as well as how to share functions and services between handlers using the Context. Includes test coverage for the shared state examples.
_\examples/routing/writing-a-middleware · high confidence
New party controller example for routing
Added a new example demonstrating the use of party controllers in the routing system. The example includes a main application file that sets up an API group, registers a weather API client as a dependency, and configures a weather controller to handle requests. The weather API client and its response structures are also provided, showing how to interact with an external weather service and return JSON responses.
(repo-wide) · high confidence
New request-referrer example demonstrating Go's HTTP header and query parameter parsing
A new example at \_examples/request-referrer shows how to use the Iris framework's GetReferrer() method to extract and parse the 'Referer' or 'Referrer' header and URL query parameters. The example demonstrates handling different referrer types (search, social, indirect) and accessing specific details like Google search type or social media labels.
_\examples/request-referrer · high confidence
New session overview example with configurable session management
A new example at \_examples/sessions/overview demonstrates session management using the sessions package. It configures session cookies with a custom name ('\_session\_id'), a 2-hour expiration, and enables AllowReclaim to allow retrieving session values within the same request.
_\examples/sessions/overview · high confidence
New subdomain redirect and multi-instance routing examples
Added new example code demonstrating how to handle subdomain redirection using the rewrite middleware, as well as how to route requests to different Iris application instances based on the host header using the apps.Switch provider. The examples show how to configure host-based routing and subdomain redirects in a Go web application.
_\examples/routing/subdomains/redirect · high confidence
New versioning example with API version aliases
Added a new example at \_examples/routing/versioning that demonstrates API versioning using the versioning package. The example shows how to use versioning.Aliases to map client-provided version strings (like 'latest' or empty) to specific API versions, and how to create versioned route groups (v1, v2, v3) with separate view templates and error handlers for each version.
_\examples/routing/versioning · medium confidence
New x/errors and x/errors/validation packages for HTTP error handling
Added the x/errors package, providing ready-to-use handlers (CreateHandler, NoContentHandler, etc.) and generic helper functions (OK, Create, NoContent, NoContentOrNotModified, List, Intercept) to simplify HTTP service method calls and error responses in the Iris framework. Also added the x/errors/validation package with generic validation helpers to streamline request body validation.
_\examples/routing/http-wire-errors/service · high confidence
New x/errors package for structured HTTP error handling
An example application at \_examples/routing/http-wire-errors demonstrates a new x/errors package that provides package-level generic functions (such as OK, Create, NoContent, and NoContentOrNotModified) for handling HTTP wire errors. This allows developers to send structured error responses with canonical names, status codes, and optional details, offering compatibility with the standard errors package while extending functionality for HTTP-specific error scenarios.
_\examples/routing/http-wire-errors · medium confidence
Reverse routing example for manual path generation
The \_examples/routing/reverse/main.go file was added to demonstrate how to use the \router.NewRoutePathReverser\ for manual reverse routing outside of the view engine. The example shows how to name a route, generate its path using the reverser, and execute a route programmatically.
_\examples/routing/reverse · high confidence
Sessions subsystem rewritten with a new database abstraction and backend implementations
The sessions package has been completely rewritten to use a new \Database\ interface, allowing for pluggable session storage backends. The old provider-based system has been replaced with explicit database implementations for Badger, BoltDB, and Redis, each located in their respective \sessiondb\ subdirectories. The \Config\ struct now explicitly defines session options like cookie names, expiration, and subdomain persistence. Additionally, a \Transcoder\ interface and default implementations (JSON and Gob) are introduced to handle serialization of session values across different storage engines.
sessions · high confidence
YAML configuration examples for single and shared setups
Added example code demonstrating how to load application configuration from a YAML file using \iris.YAML\ for a single instance, and how to share configuration across multiple server instances using \iris.WithGlobalConfiguration\.
_\examples/configuration/from-yaml-file · high confidence
Removals
Removal of deprecated and incomplete plugins
The editor, iriscontrol, routesinfo, and typescript plugins have been removed from the codebase. This eliminates the browser-based IDE bridge, the incomplete web-based server control panel, the route information collector, and the TypeScript compilation plugin, reducing the framework's plugin surface area.
plugin · high confidence
Removal of legacy bindings for form, JSON, and XML parsing
The \bindings\ package has removed the \errors.go\, \form.go\, \json.go\, and \xml.go\ files, eliminating the built-in support for binding form data, JSON, and XML from request bodies. Users will no longer have access to the \BindJSON\, \BindXML\, and form decoding functions provided by this package, requiring alternative methods for parsing these content types.
bindings · high confidence
Removal of legacy configuration structs
The 'config' package has removed a large number of configuration structs and their associated helper functions, including BasicAuth, Editor, Iris, IrisControl, Logger, Render, Server, Sessions, Typescript, and Websocket. This cleanup eliminates the internal configuration management layer that previously handled default values, merging, and serialization for these components, indicating a shift away from the older configuration API.
config · high confidence
Removal of legacy render engines and REST response types
The legacy template engine implementations (Amber, HTML, Jade, Markdown, and Pongo) and the REST response engine (JSON, JSONP, XML, Text, Data) have been removed from the render package. This eliminates the previous architecture where multiple template engines could be used simultaneously, simplifying the rendering subsystem by removing these deprecated components.
render · high confidence
Removal of legacy server implementation files
The server package's legacy implementation files, including \server.go\, \errors.go\, and \README.md\, have been removed from the codebase. This eliminates the previous internal server logic that managed TCP, TLS, and Unix socket listening states, indicating a shift away from this specific server architecture.
server · high confidence
Removal of legacy utility packages
The utils package has been removed from the codebase. This includes the deletion of files for byte serialization, error definitions, command execution, file operations (including download, unzip, and copy utilities), string manipulation, and a custom ticker implementation. Users relying on these internal utilities will need to replace them with standard library functions or other dependencies.
utils · high confidence
Removal of npm Go package
The Go package providing npm interaction utilities (npm.go) has been removed from the codebase. This eliminates the ability to install, uninstall, or query global npm modules directly from Go code.
npm · high confidence
Removal of the legacy 'iris' CLI tool
The legacy 'iris' command-line tool, including its main implementation and documentation, has been removed from the codebase. This eliminates the previous workflow where users could install and run the 'iris' CLI to scaffold projects, as the tool is no longer maintained or distributed.
iris · high confidence
Removal of the standalone graceful shutdown package
The 'graceful' package, which previously provided a standalone 'Server' type and functions like 'Run' and 'RunWithErr' for handling graceful HTTP shutdowns, has been removed. Users can no longer import 'github.com/kataras/iris/graceful' to manage server lifecycle; the functionality is now integrated into the main 'iris' package.
graceful · high confidence
Behavioural changes
Add routing overview example with modern API and logging
A new example at \_examples/routing/overview/main.go demonstrates the current Iris API, utilizing app.Listen for server startup, the logger middleware, and modern route parameter types like :uint64 with ctx.Params().GetUint64. The example also showcases subdomain routing via app.Party and app.WildcardSubdomain, alongside static file handling with app.HandleDir and app.Favicon.
_\examples/routing/overview · high confidence
Added HTML template examples for layout and page rendering
New example templates were added to demonstrate the use of built-in HTML template functions. The \layout.html\ template provides a base structure that uses the \{{ yield . }}\ directive to inject content, while \mypage.html\ shows how to render title and message data within a page.
_\_examples/view/template\_html\1/templates · medium confidence
Added example assets for embedding files into the application
The file-server example now includes sample CSS and JavaScript assets (main.css and main.js) to demonstrate how to embed static files into the application. This provides users with a concrete example of folder structuring and asset management as requested in issue \#748.
_\examples/file-server/embedding-files-into-app/assets · medium confidence
Added static asset files for the custom wrapper example
The example now includes static files (app.js, css/main.css, and index.html) that serve as the client-side assets for the custom wrapper routing example. These files define the visual and interactive elements of the example application.
_\examples/routing/custom-wrapper/public · medium confidence
Context-specific view engine registration
The example demonstrates registering a view engine for a specific route group (e.g., /admin) and dynamically setting a view engine for a single handler chain. This allows different parts of an application to use distinct template directories or configurations, such as separating public and admin templates.
_\examples/view/context-view-engine · medium confidence
Dynamic route state changes via Exec and RefreshRouter
The route-state example demonstrates how to modify a route's state at runtime using the new \RefreshRouter\ method and \ctx.Exec\ to execute routes dynamically. This allows for flexible routing logic, such as changing a route's HTTP method or availability based on application state, with changes taking effect immediately after the router is refreshed.
_\examples/routing/route-state · high confidence
Enhanced cookie security and management
The framework introduces improved mechanisms for handling cookies, including the ability to set custom cookie encoders and decoders. This allows developers to encode the cookie's value before it is sent by \ctx.SetCookie\ and decode it when retrieved via \ctx.GetCookie\, providing greater control over cookie security and management.
(repo-wide) · high confidence
Expanded dynamic path parameter types and validation
The dynamic-path example demonstrates support for a wider range of path parameter types, including int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64, bool, alphabetical, file, path, uuid, mail, email, date, and weekday. It also shows how to register custom macro functions and handle path parameter validation errors with a custom 400 Bad Request response.
_\examples/routing/dynamic-path · medium confidence
Introduce UserService abstraction for authentication and user management
Added a new UserService interface and its implementation in the login example, decoupling user data operations from the controllers. The service provides methods for creating, updating, and deleting users, as well as retrieving user data and validating credentials via GetByUsernameAndPassword, which handles password hashing and verification.
_\examples/mvc/login/services · medium confidence
Migrate websocket package to kataras/neffos
The websocket package has been refactored to use the \kataras/neffos\ library, replacing the previous internal implementation. This migration introduces support for multiple WebSocket subprotocols (Gorilla and Gobwas), enables Redis and NATS stack exchanges for scaling, and updates the public API to align with the \neffos\ interface, including new constants for system events like \OnNamespaceConnect\ and \OnRoomJoin\.
websocket · high confidence
Removal of custom error implementation
The custom error struct and its associated methods (New, Printf, Format, With, Return, Panic, Panicf) have been removed from the errors package. This eliminates the framework-specific error handling mechanism in favor of standard Go error interfaces.
errors · high confidence
Removal of the standalone logger package
The standalone logger package, including its Go implementation and README, has been removed from the codebase. This change eliminates the separate \logger\ module that previously provided logging functionality with configurable prefixes and enable/disable states, indicating a consolidation or replacement of the logging infrastructure within the framework.
logger · high confidence
Support for embedded locale files in the i18n example
The i18n/template-embedded example now demonstrates how to embed locale files directly into the Go binary using the standard library's embed package. This allows the application to load translations from an embedded filesystem (via LoadFS) rather than relying on external files or HTTP requests, enabling fully self-contained binaries for English (en-US) and Greek (el-GR) translations.
_\examples/i18n/template-embedded · medium confidence
Fixes
Example demonstrates resetting HTTP response body on error
Added an example in \_examples/routing/http-errors/reset-body that shows how to use the WithResetOnFireErrorCode configuration to ensure the HTTP response body is cleared before firing an error. The example includes a handler that writes to the response before triggering a status error, and a test verifying that the final body contains only the error message.
_\examples/routing/http-errors/reset-body · medium confidence
Test coverage
Added Ginkgo-based tests for the httptest package; Added httptest package for simplified HTTP testing; Removal of legacy HTTP error and router test suites.
Dependencies
Updated example dependencies to latest versions
The Go module files (go.mod and go.sum) for the auth/basicauth/database, auth/jwt/tutorial, and bootstrapper examples have been updated to use the latest versions of their dependencies, including kataras/iris/v12, golang.org/x packages, and various third-party libraries.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 63.
Lenses
- Architecture 100
- Maturity 55
- Readiness 65
- Security 66
Changes since last survey
- 300 commits — 287 feature/other, 13 fixes
By area
- (root) — 182 commits
- _examples/database — 27 commits
- (repo) — 8 commits
- .github/workflows — 7 commits
- core/router — 7 commits
- x/jsonx — 7 commits
- _examples/mvc — 6 commits
- _examples/routing — 4 commits
- _examples/view — 4 commits
- _examples/websocket — 3 commits
- context/context.go — 3 commits
- _examples/auth — 2 commits
- _examples/configuration — 2 commits
- _examples/graphql — 2 commits
- _examples/logging — 2 commits
- view/html.go — 2 commits
- x/errors — 2 commits
- .github/ISSUE_TEMPLATE — 1 commit
- _examples/apidoc — 1 commit
- _examples/bootstrapper — 1 commit
Notable commits
- fix: FIX: Session.Destroy trigger map concurrency write (#2225)
- fix: fix #2034 and #2033
- fix: fix #2098
- fix: fix #2147
- fix: fix #2158 and more
- fix: fix #2215
- fix: fix #2216 (#2218)
- fix: fix #2309
- fix: fix #2587
- fix: fix an issue on accesslog when response and request recorder and minifier were enabled
- fix: fix(context.CookieAllowReclaim): Fix the issue with the context.CookieAllowReclaim method not working as expected when deleting cookies (#2136)
- fix: fix: close form file (#2416)
- fix: try to fix badger's latest version does not pass the checksum
- change: Add Chinese (Traditional) Translation of README (#2043)
- change: Add example of the powerful 'templ' generated templates
- change: Add mvc.Application.EnableStructDependents() and app.ConfigureContainer().EnableStructDependents()
- change: Add new x/errors/validation package to make your life even more easier (using Generics)
- change: Added example how to use ulule-limiter with Iris web framework (#2152)
- change: Bump github.com/BurntSushi/toml from 1.2.1 to 1.3.0 (#2145)
- change: Bump github.com/BurntSushi/toml from 1.3.0 to 1.3.2 (#2149)
- …and 280 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
kataras/iris was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 6 August 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 7bedaf55a0b64bbb2248a5845a2c60d81a30996a — the exact code this score is about.
- Scored under rubric-2026.08.19 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer latest.