rename master branch to main

This commit is contained in:
Gerasimos (Makis) Maropoulos 2023-08-20 03:12:46 +03:00
parent 2e9745a915
commit 48f7b38d15
No known key found for this signature in database
GPG Key ID: B9839E9CD30B7B6B
62 changed files with 216 additions and 211 deletions

View File

@ -1,5 +1,5 @@
Examples for the Iris project can be found at Examples for the Iris project can be found at
<https://github.com/kataras/iris/tree/master/_examples>. <https://github.com/kataras/iris/tree/main/_examples>.
Documentation for the Iris project can be found at Documentation for the Iris project can be found at
<https://www.iris-go.com/docs>. <https://www.iris-go.com/docs>.

View File

@ -30,7 +30,7 @@ Please make sure the bug is reproducible over the `master` branch:
```sh ```sh
$ cd PROJECT $ cd PROJECT
$ go get -u github.com/kataras/iris/v12@master $ go get -u github.com/kataras/iris/v12@main
$ go run . $ go run .
``` ```

View File

@ -1,5 +1,5 @@
# We'd love to see more contributions # We'd love to see more contributions
Read how you can [contribute to the project](https://github.com/kataras/iris/blob/master/CONTRIBUTING.md). Read how you can [contribute to the project](https://github.com/kataras/iris/blob/main/CONTRIBUTING.md).
> Please attach an [issue](https://github.com/kataras/iris/issues) link which your PR solves otherwise your work may be rejected. > Please attach an [issue](https://github.com/kataras/iris/issues) link which your PR solves otherwise your work may be rejected.

View File

@ -4,7 +4,7 @@ for f in ../../_examples/*; do
if [ -d "$f" ]; then if [ -d "$f" ]; then
# Will not run if no directories are available # Will not run if no directories are available
go mod init go mod init
go get -u github.com/kataras/iris/v12@master go get -u github.com/kataras/iris/v12@main
go mod download go mod download
go run . go run .
fi fi

View File

@ -2,9 +2,9 @@ name: CI
on: on:
push: push:
branches: [master] branches: [main]
pull_request: pull_request:
branches: [master] branches: [main]
permissions: permissions:
contents: read contents: read

View File

@ -1,6 +1,6 @@
# Contributing # Contributing
First of all read our [Code of Conduct](https://github.com/kataras/iris/blob/master/CODE_OF_CONDUCT.md). First of all read our [Code of Conduct](https://github.com/kataras/iris/blob/main/CODE_OF_CONDUCT.md).
## PR ## PR

4
FAQ.md
View File

@ -31,8 +31,8 @@ More than 280 practical examples, tutorials and articles at:
- https://www.iris-go.com/docs - https://www.iris-go.com/docs
- https://www.iris-go.com/#ebookDonateForm - https://www.iris-go.com/#ebookDonateForm
<!-- - https://github.com/kataras/iris/wiki/Starter-kits --> <!-- - https://github.com/kataras/iris/wiki/Starter-kits -->
- https://github.com/kataras/iris/tree/master/_examples - https://github.com/kataras/iris/tree/main/_examples
- https://pkg.go.dev/github.com/kataras/iris/v12@master - https://pkg.go.dev/github.com/kataras/iris/v12@main
## Active development mode ## Active development mode

View File

@ -21,7 +21,9 @@ Developers are not forced to upgrade if they don't really need it. Upgrade whene
# Next # Next
Changes apply to `master` branch. Changes apply to `main` branch.
- `master` branch finally renamed to `main`. Don't worry GitHub will still navigate any `master` request to `main` automatically. Examples, Documentation and other Pages are refactored too.
# Sat, 12 Aug 2023 | v12.2.4 # Sat, 12 Aug 2023 | v12.2.4
@ -88,11 +90,11 @@ All new features have been tested in production and seem to work fine. Fixed all
- Add new `URLParamSeparator` to the configuration. Defaults to "," but can be set to an empty string to disable splitting query values on `Context.URLParamSlice` method. - Add new `URLParamSeparator` to the configuration. Defaults to "," but can be set to an empty string to disable splitting query values on `Context.URLParamSlice` method.
- [PR #1992](https://github.com/kataras/iris/pull/1992): Added support for third party packages on [httptest](https://github.com/kataras/iris/tree/master/httptest). An example using 3rd-party module named [Ginkgo](github.com/onsi/ginkgo) can be found [here](https://github.com/kataras/iris/blob/master/_examples/testing/ginkgotest). - [PR #1992](https://github.com/kataras/iris/pull/1992): Added support for third party packages on [httptest](https://github.com/kataras/iris/tree/main/httptest). An example using 3rd-party module named [Ginkgo](github.com/onsi/ginkgo) can be found [here](https://github.com/kataras/iris/blob/main/_examples/testing/ginkgotest).
- Add `Context.Render` method for compatibility. - Add `Context.Render` method for compatibility.
- Support of embedded [locale files](https://github.com/kataras/iris/blob/master/_examples/i18n/template-embedded/main.go) using standard `embed.FS` with the new `LoadFS` function. - Support of embedded [locale files](https://github.com/kataras/iris/blob/main/_examples/i18n/template-embedded/main.go) using standard `embed.FS` with the new `LoadFS` function.
- Support of direct embedded view engines (`HTML, Blocks, Django, Handlebars, Pug, Jet` and `Ace`) with `embed.FS` or `fs.FS` (in addition to `string` and `http.FileSystem` types). - Support of direct embedded view engines (`HTML, Blocks, Django, Handlebars, Pug, Jet` and `Ace`) with `embed.FS` or `fs.FS` (in addition to `string` and `http.FileSystem` types).
- Add support for `embed.FS` and `fs.FS` on `app.HandleDir`. - Add support for `embed.FS` and `fs.FS` on `app.HandleDir`.
@ -252,7 +254,7 @@ app.Get("/users/{id:uuid}", getUser)
- Improve the performance and fix `:int, :int8, :int16, :int32, :int64, :uint, :uint8, :uint16, :uint32, :uint64` path type parameters couldn't accept a positive number written with the plus symbol or with a leading zeroes, e.g. `+42` and `021`. - Improve the performance and fix `:int, :int8, :int16, :int32, :int64, :uint, :uint8, :uint16, :uint32, :uint64` path type parameters couldn't accept a positive number written with the plus symbol or with a leading zeroes, e.g. `+42` and `021`.
- The `iris.WithEmptyFormError` option is respected on `context.ReadQuery` method too, as requested at [#1727](https://github.com/kataras/iris/issues/1727). [Example comments](https://github.com/kataras/iris/blob/master/_examples/request-body/read-query/main.go) were updated. - The `iris.WithEmptyFormError` option is respected on `context.ReadQuery` method too, as requested at [#1727](https://github.com/kataras/iris/issues/1727). [Example comments](https://github.com/kataras/iris/blob/main/_examples/request-body/read-query/main.go) were updated.
- New `httptest.Strict` option setter to enable the `httpexpect.RequireReporter` instead of the default `httpexpect.AssetReporter. Use that to enable complete test failure on the first error. As requested at: [#1722](https://github.com/kataras/iris/issues/1722). - New `httptest.Strict` option setter to enable the `httpexpect.RequireReporter` instead of the default `httpexpect.AssetReporter. Use that to enable complete test failure on the first error. As requested at: [#1722](https://github.com/kataras/iris/issues/1722).
@ -312,11 +314,11 @@ stage := NewGroup(api, "5.0.0-alpha")
stage.Get/Post... stage.Get/Post...
``` ```
- New [Basic Authentication](https://github.com/kataras/iris/tree/master/middleware/basicauth) middleware. Its `Default` function has not changed, however, the rest, e.g. `New` contains breaking changes as the new middleware features new functionalities. - New [Basic Authentication](https://github.com/kataras/iris/tree/main/middleware/basicauth) middleware. Its `Default` function has not changed, however, the rest, e.g. `New` contains breaking changes as the new middleware features new functionalities.
- Add `iris.DirOptions.SPA bool` field to allow [Single Page Applications](https://github.com/kataras/iris/tree/master/_examples/file-server/single-page-application/basic/main.go) under a file server. - Add `iris.DirOptions.SPA bool` field to allow [Single Page Applications](https://github.com/kataras/iris/tree/main/_examples/file-server/single-page-application/basic/main.go) under a file server.
- A generic User interface, see the `Context.SetUser/User` methods in the New Context Methods section for more. In-short, the basicauth middleware's stored user can now be retrieved through `Context.User()` which provides more information than the native `ctx.Request().BasicAuth()` method one. Third-party authentication middleware creators can benefit of these two methods, plus the Logout below. - A generic User interface, see the `Context.SetUser/User` methods in the New Context Methods section for more. In-short, the basicauth middleware's stored user can now be retrieved through `Context.User()` which provides more information than the native `ctx.Request().BasicAuth()` method one. Third-party authentication middleware creators can benefit of these two methods, plus the Logout below.
- A `Context.Logout` method is added, can be used to invalidate [basicauth](https://github.com/kataras/iris/blob/master/_examples/auth/basicauth/basic/main.go) or [jwt](https://github.com/kataras/iris/blob/master/_examples/auth/jwt/blocklist/main.go) client credentials. - A `Context.Logout` method is added, can be used to invalidate [basicauth](https://github.com/kataras/iris/blob/main/_examples/auth/basicauth/basic/main.go) or [jwt](https://github.com/kataras/iris/blob/main/_examples/auth/jwt/blocklist/main.go) client credentials.
- Add the ability to [share functions](https://github.com/kataras/iris/tree/master/_examples/routing/writing-a-middleware/share-funcs) between handlers chain and add an [example](https://github.com/kataras/iris/tree/master/_examples/routing/writing-a-middleware/share-services) on sharing Go structures (aka services). - Add the ability to [share functions](https://github.com/kataras/iris/tree/main/_examples/routing/writing-a-middleware/share-funcs) between handlers chain and add an [example](https://github.com/kataras/iris/tree/main/_examples/routing/writing-a-middleware/share-services) on sharing Go structures (aka services).
- Add the new `Party.UseOnce` method to the `*Route` - Add the new `Party.UseOnce` method to the `*Route`
- Add a new `*Route.RemoveHandler(...interface{}) int` and `Party.RemoveHandler(...interface{}) Party` methods, delete a handler based on its name or the handler pc function. - Add a new `*Route.RemoveHandler(...interface{}) int` and `Party.RemoveHandler(...interface{}) Party` methods, delete a handler based on its name or the handler pc function.
@ -342,7 +344,7 @@ func main() {
- Redis Driver is now based on the [go-redis](https://github.com/go-redis/redis/) module. Radix and redigo removed entirely. Sessions are now stored in hashes which fixes [issue #1610](https://github.com/kataras/iris/issues/1610). The only breaking change on default configuration is that the `redis.Config.Delim` option was removed. The redis sessions database driver is now defaults to the `&redis.GoRedisDriver{}`. End-developers can implement their own implementations too. The `Database#Close` is now automatically called on interrupt signals, no need to register it by yourself. - Redis Driver is now based on the [go-redis](https://github.com/go-redis/redis/) module. Radix and redigo removed entirely. Sessions are now stored in hashes which fixes [issue #1610](https://github.com/kataras/iris/issues/1610). The only breaking change on default configuration is that the `redis.Config.Delim` option was removed. The redis sessions database driver is now defaults to the `&redis.GoRedisDriver{}`. End-developers can implement their own implementations too. The `Database#Close` is now automatically called on interrupt signals, no need to register it by yourself.
- Add builtin support for **[i18n pluralization](https://github.com/kataras/iris/tree/master/_examples/i18n/plurals)**. Please check out the [following yaml locale example](https://github.com/kataras/iris/tree/master/_examples/i18n/plurals/locales/en-US/welcome.yml) to see an overview of the supported formats. - Add builtin support for **[i18n pluralization](https://github.com/kataras/iris/tree/main/_examples/i18n/plurals)**. Please check out the [following yaml locale example](https://github.com/kataras/iris/tree/main/_examples/i18n/plurals/locales/en-US/welcome.yml) to see an overview of the supported formats.
- Fix [#1650](https://github.com/kataras/iris/issues/1650) - Fix [#1650](https://github.com/kataras/iris/issues/1650)
- Fix [#1649](https://github.com/kataras/iris/issues/1649) - Fix [#1649](https://github.com/kataras/iris/issues/1649)
- Fix [#1648](https://github.com/kataras/iris/issues/1648) - Fix [#1648](https://github.com/kataras/iris/issues/1648)
@ -357,7 +359,7 @@ func main() {
- Fix Response Recorder `Flush` when transfer-encoding is `chunked`. - Fix Response Recorder `Flush` when transfer-encoding is `chunked`.
- Fix Response Recorder `Clone` concurrent access afterwards. - Fix Response Recorder `Clone` concurrent access afterwards.
- Add a `ParseTemplate` method on view engines to manually parse and add a template from a text as [requested](https://github.com/kataras/iris/issues/1617). [Examples](https://github.com/kataras/iris/tree/master/_examples/view/parse-template). - Add a `ParseTemplate` method on view engines to manually parse and add a template from a text as [requested](https://github.com/kataras/iris/issues/1617). [Examples](https://github.com/kataras/iris/tree/main/_examples/view/parse-template).
- Full `http.FileSystem` interface support for all **view** engines as [requested](https://github.com/kataras/iris/issues/1575). The first argument of the functions(`HTML`, `Blocks`, `Pug`, `Ace`, `Jet`, `Django`, `Handlebars`) can now be either a directory of `string` type (like before) or a value which completes the `http.FileSystem` interface. The `.Binary` method of all view engines was removed: pass the go-bindata's latest version `AssetFile()` exported function as the first argument instead of string. - Full `http.FileSystem` interface support for all **view** engines as [requested](https://github.com/kataras/iris/issues/1575). The first argument of the functions(`HTML`, `Blocks`, `Pug`, `Ace`, `Jet`, `Django`, `Handlebars`) can now be either a directory of `string` type (like before) or a value which completes the `http.FileSystem` interface. The `.Binary` method of all view engines was removed: pass the go-bindata's latest version `AssetFile()` exported function as the first argument instead of string.
- Add `Route.ExcludeSitemap() *Route` to exclude a route from sitemap as requested in [chat](https://chat.iris-go.com), also offline routes are excluded automatically now. - Add `Route.ExcludeSitemap() *Route` to exclude a route from sitemap as requested in [chat](https://chat.iris-go.com), also offline routes are excluded automatically now.
@ -376,13 +378,13 @@ func main() {
![DBUG routes with Controllers](https://iris-go.com/images/v12.2.0-dbug3.png?v=0) ![DBUG routes with Controllers](https://iris-go.com/images/v12.2.0-dbug3.png?v=0)
- Update the [pprof middleware](https://github.com/kataras/iris/tree/master/middleware/pprof). - Update the [pprof middleware](https://github.com/kataras/iris/tree/main/middleware/pprof).
- New `Controller.HandleHTTPError(mvc.Code) <T>` optional Controller method to handle http errors as requested at: [MVC - More Elegent OnErrorCode registration?](https://github.com/kataras/iris/issues/1595). Example can be found [here](https://github.com/kataras/iris/tree/master/_examples/mvc/error-handler-http/main.go). - New `Controller.HandleHTTPError(mvc.Code) <T>` optional Controller method to handle http errors as requested at: [MVC - More Elegent OnErrorCode registration?](https://github.com/kataras/iris/issues/1595). Example can be found [here](https://github.com/kataras/iris/tree/main/_examples/mvc/error-handler-http/main.go).
![MVC: HTTP Error Handler Method](https://user-images.githubusercontent.com/22900943/90948989-e04cd300-e44c-11ea-8c97-54d90fb0cbb6.png) ![MVC: HTTP Error Handler Method](https://user-images.githubusercontent.com/22900943/90948989-e04cd300-e44c-11ea-8c97-54d90fb0cbb6.png)
- New [Rewrite Engine Middleware](https://github.com/kataras/iris/tree/master/middleware/rewrite). Set up redirection rules for path patterns using the syntax we all know. [Example Code](https://github.com/kataras/iris/tree/master/_examples/routing/rewrite). - New [Rewrite Engine Middleware](https://github.com/kataras/iris/tree/main/middleware/rewrite). Set up redirection rules for path patterns using the syntax we all know. [Example Code](https://github.com/kataras/iris/tree/main/_examples/routing/rewrite).
```yml ```yml
RedirectMatch: # REDIRECT_CODE_DIGITS | PATTERN_REGEX | TARGET_REPL RedirectMatch: # REDIRECT_CODE_DIGITS | PATTERN_REGEX | TARGET_REPL
@ -411,15 +413,15 @@ RedirectMatch: # REDIRECT_CODE_DIGITS | PATTERN_REGEX | TARGET_REPL
PrimarySubdomain: www PrimarySubdomain: www
``` ```
- New `TraceRoute bool` on [middleware/logger](https://github.com/kataras/iris/tree/master/middleware/logger) middleware. Displays information about the executed route. Also marks the handlers executed. Screenshot: - New `TraceRoute bool` on [middleware/logger](https://github.com/kataras/iris/tree/main/middleware/logger) middleware. Displays information about the executed route. Also marks the handlers executed. Screenshot:
![logger middleware: TraceRoute screenshot](https://iris-go.com/images/github/logger-trace-route.png) ![logger middleware: TraceRoute screenshot](https://iris-go.com/images/github/logger-trace-route.png)
- Implement feature request [Log when I18n Translation Fails?](https://github.com/kataras/iris/issues/1593) by using the new `Application.I18n.DefaultMessageFunc` field **before** `I18n.Load`. [Example of usage](https://github.com/kataras/iris/blob/master/_examples/i18n/basic/main.go#L28-L50). - Implement feature request [Log when I18n Translation Fails?](https://github.com/kataras/iris/issues/1593) by using the new `Application.I18n.DefaultMessageFunc` field **before** `I18n.Load`. [Example of usage](https://github.com/kataras/iris/blob/main/_examples/i18n/basic/main.go#L28-L50).
- Fix [#1594](https://github.com/kataras/iris/issues/1594) and add a new `PathAfterHandler` which can be set to true to enable the old behavior (not recommended though). - Fix [#1594](https://github.com/kataras/iris/issues/1594) and add a new `PathAfterHandler` which can be set to true to enable the old behavior (not recommended though).
- New [apps](https://github.com/kataras/iris/tree/master/apps) subpackage. [Example of usage](https://github.com/kataras/iris/tree/master/_examples/routing/subdomains/redirect/multi-instances). - New [apps](https://github.com/kataras/iris/tree/main/apps) subpackage. [Example of usage](https://github.com/kataras/iris/tree/main/_examples/routing/subdomains/redirect/multi-instances).
![apps image example](https://user-images.githubusercontent.com/22900943/90459288-8a54f400-e109-11ea-8dea-20631975c9fc.png) ![apps image example](https://user-images.githubusercontent.com/22900943/90459288-8a54f400-e109-11ea-8dea-20631975c9fc.png)
@ -531,33 +533,33 @@ var dirOpts = iris.DirOptions{
- Update jet parser to v5.0.2, closes [#1551](https://github.com/kataras/iris/issues/1551). It contains two breaking changes by its author: - Update jet parser to v5.0.2, closes [#1551](https://github.com/kataras/iris/issues/1551). It contains two breaking changes by its author:
- Relative paths on `extends, import, include...` tmpl functions, e.g. `{{extends "../layouts/application.jet"}}` instead of `layouts/application.jet` - Relative paths on `extends, import, include...` tmpl functions, e.g. `{{extends "../layouts/application.jet"}}` instead of `layouts/application.jet`
- the new [jet.Ranger](https://github.com/CloudyKit/jet/pull/165) interface now requires a `ProvidesIndex() bool` method too - the new [jet.Ranger](https://github.com/CloudyKit/jet/pull/165) interface now requires a `ProvidesIndex() bool` method too
- Example has been [updated](https://github.com/kataras/iris/tree/master/_examples/view/template_jet_0) - Example has been [updated](https://github.com/kataras/iris/tree/main/_examples/view/template_jet_0)
- Fix [#1552](https://github.com/kataras/iris/issues/1552). - Fix [#1552](https://github.com/kataras/iris/issues/1552).
- Proper listing of root directories on `Party.HandleDir` when its `DirOptions.ShowList` was set to true. - Proper listing of root directories on `Party.HandleDir` when its `DirOptions.ShowList` was set to true.
- Customize the file/directory listing page through views, see [example](https://github.com/kataras/iris/tree/master/_examples/file-server/file-server). - Customize the file/directory listing page through views, see [example](https://github.com/kataras/iris/tree/main/_examples/file-server/file-server).
- Socket Sharding as requested at [#1544](https://github.com/kataras/iris/issues/1544). New `iris.WithSocketSharding` Configurator and `SocketSharding bool` setting. - Socket Sharding as requested at [#1544](https://github.com/kataras/iris/issues/1544). New `iris.WithSocketSharding` Configurator and `SocketSharding bool` setting.
- Versioned Controllers feature through the new `mvc.Version` option. See [_examples/mvc/versioned-controller](https://github.com/kataras/iris/blob/master/_examples/mvc/versioned-controller/main.go). - Versioned Controllers feature through the new `mvc.Version` option. See [_examples/mvc/versioned-controller](https://github.com/kataras/iris/blob/main/_examples/mvc/versioned-controller/main.go).
- Fix [#1539](https://github.com/kataras/iris/issues/1539). - Fix [#1539](https://github.com/kataras/iris/issues/1539).
- New [rollbar example](https://github.com/kataras/iris/blob/master/_examples/logging/rollbar/main.go). - New [rollbar example](https://github.com/kataras/iris/blob/main/_examples/logging/rollbar/main.go).
- New builtin [requestid](https://github.com/kataras/iris/tree/master/middleware/requestid) middleware. - New builtin [requestid](https://github.com/kataras/iris/tree/main/middleware/requestid) middleware.
- New builtin [JWT](https://github.com/kataras/iris/tree/master/middleware/jwt) middleware based on the fastest JWT implementation; [kataras/jwt](https://github.com/kataras/jwt) featured with optional wire encryption to set claims with sensitive data when necessary. - New builtin [JWT](https://github.com/kataras/iris/tree/main/middleware/jwt) middleware based on the fastest JWT implementation; [kataras/jwt](https://github.com/kataras/jwt) featured with optional wire encryption to set claims with sensitive data when necessary.
- New `iris.RouteOverlap` route registration rule. `Party.SetRegisterRule(iris.RouteOverlap)` to allow overlapping across multiple routes for the same request subdomain, method, path. See [1536#issuecomment-643719922](https://github.com/kataras/iris/issues/1536#issuecomment-643719922). This allows two or more **MVC Controllers** to listen on the same path based on one or more registered dependencies (see [_examples/mvc/authenticated-controller](https://github.com/kataras/iris/tree/master/_examples/mvc/authenticated-controller)). - New `iris.RouteOverlap` route registration rule. `Party.SetRegisterRule(iris.RouteOverlap)` to allow overlapping across multiple routes for the same request subdomain, method, path. See [1536#issuecomment-643719922](https://github.com/kataras/iris/issues/1536#issuecomment-643719922). This allows two or more **MVC Controllers** to listen on the same path based on one or more registered dependencies (see [_examples/mvc/authenticated-controller](https://github.com/kataras/iris/tree/main/_examples/mvc/authenticated-controller)).
- `Context.ReadForm` now can return an `iris.ErrEmptyForm` instead of `nil` when the new `Configuration.FireEmptyFormError` is true (when `iris.WithEmptyFormError` is set) on missing form body to read from. - `Context.ReadForm` now can return an `iris.ErrEmptyForm` instead of `nil` when the new `Configuration.FireEmptyFormError` is true (when `iris.WithEmptyFormError` is set) on missing form body to read from.
- `Configuration.EnablePathIntelligence | iris.WithPathIntelligence` to enable path intelligence automatic path redirection on the most closest path (if any), [example]((https://github.com/kataras/iris/blob/master/_examples/routing/intelligence/main.go) - `Configuration.EnablePathIntelligence | iris.WithPathIntelligence` to enable path intelligence automatic path redirection on the most closest path (if any), [example]((https://github.com/kataras/iris/blob/main/_examples/routing/intelligence/main.go)
- Enhanced cookie security and management through new `Context.AddCookieOptions` method and new cookie options (look on New Package-level functions section below), [securecookie](https://github.com/kataras/iris/tree/master/_examples/cookies/securecookie) example has been updated. - Enhanced cookie security and management through new `Context.AddCookieOptions` method and new cookie options (look on New Package-level functions section below), [securecookie](https://github.com/kataras/iris/tree/main/_examples/cookies/securecookie) example has been updated.
- `Context.RemoveCookie` removes also the Request's specific cookie of the same request lifecycle when `iris.CookieAllowReclaim` is set to cookie options, [example](https://github.com/kataras/iris/tree/master/_examples/cookies/options). - `Context.RemoveCookie` removes also the Request's specific cookie of the same request lifecycle when `iris.CookieAllowReclaim` is set to cookie options, [example](https://github.com/kataras/iris/tree/main/_examples/cookies/options).
- `iris.TLS` can now accept certificates in form of raw `[]byte` contents too. - `iris.TLS` can now accept certificates in form of raw `[]byte` contents too.
- `iris.TLS` registers a secondary http server which redirects "http://" to their "https://" equivalent requests, unless the new `iris.TLSNoRedirect` host Configurator is provided on `iris.TLS`, e.g. `app.Run(iris.TLS("127.0.0.1:443", "mycert.cert", "mykey.key", iris.TLSNoRedirect))`. There is `iris.AutoTLSNoRedirect` option for `AutoTLS` too. - `iris.TLS` registers a secondary http server which redirects "http://" to their "https://" equivalent requests, unless the new `iris.TLSNoRedirect` host Configurator is provided on `iris.TLS`, e.g. `app.Run(iris.TLS("127.0.0.1:443", "mycert.cert", "mykey.key", iris.TLSNoRedirect))`. There is `iris.AutoTLSNoRedirect` option for `AutoTLS` too.
@ -588,7 +590,7 @@ var dirOpts = iris.DirOptions{
- `iris.DirListRichOptions` to pass on `iris.DirListRich` method. - `iris.DirListRichOptions` to pass on `iris.DirListRich` method.
- `iris.DirListRich` to override the default look and feel if the `DirOptions.ShowList` was set to true, can be passed to `DirOptions.DirList` field. - `iris.DirListRich` to override the default look and feel if the `DirOptions.ShowList` was set to true, can be passed to `DirOptions.DirList` field.
- `DirOptions.PushTargets` for http/2 push on index [*](https://github.com/kataras/iris/tree/master/_examples/file-server/http2push/main.go). - `DirOptions.PushTargets` for http/2 push on index [*](https://github.com/kataras/iris/tree/main/_examples/file-server/http2push/main.go).
- `iris.Compression` middleware to compress responses and decode compressed request data respectfully. - `iris.Compression` middleware to compress responses and decode compressed request data respectfully.
- `iris.B, KB, MB, GB, TB, PB, EB` for byte units. - `iris.B, KB, MB, GB, TB, PB, EB` for byte units.
- `TLSNoRedirect` to disable automatic "http://" to "https://" redirections (see below) - `TLSNoRedirect` to disable automatic "http://" to "https://" redirections (see below)
@ -600,14 +602,14 @@ var dirOpts = iris.DirOptions{
- `Context.ReadURL(ptr interface{}) error` shortcut of `ReadParams` and `ReadQuery`. Binds URL dynamic path parameters and URL query parameters to the given "ptr" pointer of a struct value. - `Context.ReadURL(ptr interface{}) error` shortcut of `ReadParams` and `ReadQuery`. Binds URL dynamic path parameters and URL query parameters to the given "ptr" pointer of a struct value.
- `Context.SetUser(User)` and `Context.User() User` to store and retrieve an authenticated client. Read more [here](https://github.com/iris-contrib/middleware/issues/63). - `Context.SetUser(User)` and `Context.User() User` to store and retrieve an authenticated client. Read more [here](https://github.com/iris-contrib/middleware/issues/63).
- `Context.SetLogoutFunc(fn interface{}, persistenceArgs ...interface{})` and `Logout(args ...interface{}) error` methods to allow different kind of auth middlewares to be able to set a "logout" a user/client feature with a single function, the route handler may not be aware of the implementation of the authentication used. - `Context.SetLogoutFunc(fn interface{}, persistenceArgs ...interface{})` and `Logout(args ...interface{}) error` methods to allow different kind of auth middlewares to be able to set a "logout" a user/client feature with a single function, the route handler may not be aware of the implementation of the authentication used.
- `Context.SetFunc(name string, fn interface{}, persistenceArgs ...interface{})` and `Context.CallFunc(name string, args ...interface{}) ([]reflect.Value, error)` to allow middlewares to share functions dynamically when the type of the function is not predictable, see the [example](https://github.com/kataras/iris/tree/master/_examples/routing/writing-a-middleware/share-funcs) for more. - `Context.SetFunc(name string, fn interface{}, persistenceArgs ...interface{})` and `Context.CallFunc(name string, args ...interface{}) ([]reflect.Value, error)` to allow middlewares to share functions dynamically when the type of the function is not predictable, see the [example](https://github.com/kataras/iris/tree/main/_examples/routing/writing-a-middleware/share-funcs) for more.
- `Context.TextYAML(interface{}) error` same as `Context.YAML` but with set the Content-Type to `text/yaml` instead (Google Chrome renders it as text). - `Context.TextYAML(interface{}) error` same as `Context.YAML` but with set the Content-Type to `text/yaml` instead (Google Chrome renders it as text).
- `Context.IsDebug() bool` reports whether the application is running under debug/development mode. It is a shortcut of Application.Logger().Level >= golog.DebugLevel. - `Context.IsDebug() bool` reports whether the application is running under debug/development mode. It is a shortcut of Application.Logger().Level >= golog.DebugLevel.
- `Context.IsRecovered() bool` reports whether the current request was recovered from the [recover middleware](https://github.com/kataras/iris/tree/master/middleware/recover). Also the `Context.GetErrPublic() (bool, error)`, `Context.SetErrPrivate(err error)` methods and `iris.ErrPrivate` interface have been introduced. - `Context.IsRecovered() bool` reports whether the current request was recovered from the [recover middleware](https://github.com/kataras/iris/tree/main/middleware/recover). Also the `Context.GetErrPublic() (bool, error)`, `Context.SetErrPrivate(err error)` methods and `iris.ErrPrivate` interface have been introduced.
- `Context.RecordRequestBody(bool)` same as the Application's `DisableBodyConsumptionOnUnmarshal` configuration field but registers per chain of handlers. It makes the request body readable more than once. - `Context.RecordRequestBody(bool)` same as the Application's `DisableBodyConsumptionOnUnmarshal` configuration field but registers per chain of handlers. It makes the request body readable more than once.
- `Context.IsRecordingBody() bool` reports whether the request body can be readen multiple times. - `Context.IsRecordingBody() bool` reports whether the request body can be readen multiple times.
- `Context.ReadHeaders(ptr interface{}) error` binds request headers to "ptr". [Example](https://github.com/kataras/iris/blob/master/_examples/request-body/read-headers/main.go). - `Context.ReadHeaders(ptr interface{}) error` binds request headers to "ptr". [Example](https://github.com/kataras/iris/blob/main/_examples/request-body/read-headers/main.go).
- `Context.ReadParams(ptr interface{}) error` binds dynamic path parameters to "ptr". [Example](https://github.com/kataras/iris/blob/master/_examples/request-body/read-params/main.go). - `Context.ReadParams(ptr interface{}) error` binds dynamic path parameters to "ptr". [Example](https://github.com/kataras/iris/blob/main/_examples/request-body/read-params/main.go).
- `Context.SaveFormFile(fh *multipart.FileHeader, dest string) (int64, error)` previously unexported. Accepts a result file of `Context.FormFile` and saves it to the disk. - `Context.SaveFormFile(fh *multipart.FileHeader, dest string) (int64, error)` previously unexported. Accepts a result file of `Context.FormFile` and saves it to the disk.
- `Context.URLParamSlice(name string) []string` is a a shortcut of `ctx.Request().URL.Query()[name]`. Like `URLParam` but it returns all values as a string slice instead of a single string separated by commas. Note that it skips any empty values (e.g. https://iris-go.com?values=). - `Context.URLParamSlice(name string) []string` is a a shortcut of `ctx.Request().URL.Query()[name]`. Like `URLParam` but it returns all values as a string slice instead of a single string separated by commas. Note that it skips any empty values (e.g. https://iris-go.com?values=).
- `Context.PostValueMany(name string) (string, error)` returns the post data of a given key. The returned value is a single string separated by commas on multiple values. It also reports whether the form was empty or when the "name" does not exist or whether the available values are empty. It strips any empty key-values from the slice before return. See `ErrEmptyForm`, `ErrNotFound` and `ErrEmptyFormField` respectfully. The `PostValueInt`, `PostValueInt64`, `PostValueFloat64` and `PostValueBool` now respect the above errors too (the `PostValues` method now returns a second output argument of `error` too, see breaking changes below). - `Context.PostValueMany(name string) (string, error)` returns the post data of a given key. The returned value is a single string separated by commas on multiple values. It also reports whether the form was empty or when the "name" does not exist or whether the available values are empty. It strips any empty key-values from the slice before return. See `ErrEmptyForm`, `ErrNotFound` and `ErrEmptyFormField` respectfully. The `PostValueInt`, `PostValueInt64`, `PostValueFloat64` and `PostValueBool` now respect the above errors too (the `PostValues` method now returns a second output argument of `error` too, see breaking changes below).
@ -784,8 +786,8 @@ Prior to this version the `iris.Context` was the only one dependency that has be
| `uint, uint8, uint16, uint32, uint64`, | | | `uint, uint8, uint16, uint32, uint64`, | |
| `float, float32, float64`, | | | `float, float32, float64`, | |
| `bool`, | | | `bool`, | |
| `slice` | [Path Parameter](https://github.com/kataras/iris/blob/master/_examples/routing/dynamic-path/main.go#L20) | | `slice` | [Path Parameter](https://github.com/kataras/iris/blob/main/_examples/routing/dynamic-path/main.go#L20) |
| Struct | [Request Body](https://github.com/kataras/iris/tree/master/_examples/request-body) of `JSON`, `XML`, `YAML`, `Form`, `URL Query`, `Protobuf`, `MsgPack` | | Struct | [Request Body](https://github.com/kataras/iris/tree/main/_examples/request-body) of `JSON`, `XML`, `YAML`, `Form`, `URL Query`, `Protobuf`, `MsgPack` |
Here is a preview of what the new Hero handlers look like: Here is a preview of what the new Hero handlers look like:
@ -991,7 +993,7 @@ Response:
- The `Context.ContentType` does not accept filenames to resolve the mime type anymore (caused issues with vendor-specific(vnd) MIME types). - The `Context.ContentType` does not accept filenames to resolve the mime type anymore (caused issues with vendor-specific(vnd) MIME types).
- The `Configuration.RemoteAddrPrivateSubnets.IPRange.Start and End` are now type of `string` instead of `net.IP`. The `WithRemoteAddrPrivateSubnet` option remains as it is, already accepts `string`s. - The `Configuration.RemoteAddrPrivateSubnets.IPRange.Start and End` are now type of `string` instead of `net.IP`. The `WithRemoteAddrPrivateSubnet` option remains as it is, already accepts `string`s.
- The `i18n#LoaderConfig.FuncMap template.FuncMap` field was replaced with `Funcs func(iris.Locale) template.FuncMap` in order to give current locale access to the template functions. A new `app.I18n.Loader` was introduced too, in order to make it easier for end-developers to customize the translation key values. - The `i18n#LoaderConfig.FuncMap template.FuncMap` field was replaced with `Funcs func(iris.Locale) template.FuncMap` in order to give current locale access to the template functions. A new `app.I18n.Loader` was introduced too, in order to make it easier for end-developers to customize the translation key values.
- Request Logger's `Columns bool` field has been removed. Use the new [accesslog](https://github.com/kataras/iris/tree/master/_examples/logging/request-logger/accesslog/main.go) middleware instead. - Request Logger's `Columns bool` field has been removed. Use the new [accesslog](https://github.com/kataras/iris/tree/main/_examples/logging/request-logger/accesslog/main.go) middleware instead.
- The `.Binary` method of all view engines was removed: pass the go-bindata's latest version `AssetFile()` exported function as the first argument instead of string. All examples updated. - The `.Binary` method of all view engines was removed: pass the go-bindata's latest version `AssetFile()` exported function as the first argument instead of string. All examples updated.
- `ContextUploadFormFiles(destDirectory string, before ...func(*Context, *multipart.FileHeader) bool) (uploaded []*multipart.FileHeader, n int64, err error)` now returns the total files uploaded too (as its first parameter) and the "before" variadic option should return a boolean, if false then the specific file is skipped. - `ContextUploadFormFiles(destDirectory string, before ...func(*Context, *multipart.FileHeader) bool) (uploaded []*multipart.FileHeader, n int64, err error)` now returns the total files uploaded too (as its first parameter) and the "before" variadic option should return a boolean, if false then the specific file is skipped.
- `Context.PostValues(name string) ([]string, error)` now returns a second output argument of `error` type too, which reports `ErrEmptyForm` or `ErrNotFound` or `ErrEmptyFormField`. The single post value getters now returns the **last value** if multiple was given instead of the first one (this allows clients to append values on flow updates). - `Context.PostValues(name string) ([]string, error)` now returns a second output argument of `error` type too, which reports `ErrEmptyForm` or `ErrNotFound` or `ErrEmptyFormField`. The single post value getters now returns the **last value** if multiple was given instead of the first one (this allows clients to append values on flow updates).
@ -1068,7 +1070,7 @@ Fix [[BUG]Session works incorrectly when meets the multi-level TLDs](https://git
# Mo, 16 December 2019 | v12.1.1 # Mo, 16 December 2019 | v12.1.1
Add [Context.FindClosest(n int) []string](https://github.com/kataras/iris/blob/master/_examples/routing/intelligence/manual/main.go#L22) Add [Context.FindClosest(n int) []string](https://github.com/kataras/iris/blob/main/_examples/routing/intelligence/manual/main.go#L22)
```go ```go
app := iris.New() app := iris.New()
@ -1103,7 +1105,7 @@ Minor as many of you don't even use them but, indeed, they need to be covered he
- Community-driven i18n middleware(iris-contrib/middleware/go-i18n) has a `NewLoader` function which returns a loader which can be passed at `app.I18n.Reset(loader i18n.Loader, languages ...string)` to change the locales parser - Community-driven i18n middleware(iris-contrib/middleware/go-i18n) has a `NewLoader` function which returns a loader which can be passed at `app.I18n.Reset(loader i18n.Loader, languages ...string)` to change the locales parser
- The Configuration's `TranslateFunctionContextKey` was replaced by `LocaleContextKey` which Context store's value (if i18n is used) returns the current Locale which contains the translate function, the language code, the language tag and the index position of it - The Configuration's `TranslateFunctionContextKey` was replaced by `LocaleContextKey` which Context store's value (if i18n is used) returns the current Locale which contains the translate function, the language code, the language tag and the index position of it
- The `context.Translate` method was replaced by `context.Tr` as a shortcut for the new `context.GetLocale().GetMessage(format, args...)` method and it matches the view's function `{{tr format args}}` too - The `context.Translate` method was replaced by `context.Tr` as a shortcut for the new `context.GetLocale().GetMessage(format, args...)` method and it matches the view's function `{{tr format args}}` too
- If you used [Iris Django](https://github.com/kataras/iris/tree/master/_examples/view/template_django_0) view engine with `import _ github.com/flosch/pongo2-addons` you **must change** the import path to `_ github.com/iris-contrib/pongo2-addons` or add a [go mod replace](https://github.com/golang/go/wiki/Modules#when-should-i-use-the-replace-directive) to your `go.mod` file, e.g. `replace github.com/flosch/pongo2-addons => github.com/iris-contrib/pongo2-addons v0.0.1`. - If you used [Iris Django](https://github.com/kataras/iris/tree/main/_examples/view/template_django_0) view engine with `import _ github.com/flosch/pongo2-addons` you **must change** the import path to `_ github.com/iris-contrib/pongo2-addons` or add a [go mod replace](https://github.com/golang/go/wiki/Modules#when-should-i-use-the-replace-directive) to your `go.mod` file, e.g. `replace github.com/flosch/pongo2-addons => github.com/iris-contrib/pongo2-addons v0.0.1`.
## Fixes ## Fixes
@ -1121,13 +1123,13 @@ All known issues.
### Internationalization and localization ### Internationalization and localization
Support for i18n is now a **builtin feature** and is being respected across your entire application, per say [sitemap](https://github.com/kataras/iris/blob/master/_examples/routing/sitemap/main.go) and [views](https://github.com/kataras/iris/blob/master/_examples/i18n/basic/main.go#L50). Support for i18n is now a **builtin feature** and is being respected across your entire application, per say [sitemap](https://github.com/kataras/iris/blob/main/_examples/routing/sitemap/main.go) and [views](https://github.com/kataras/iris/blob/main/_examples/i18n/basic/main.go#L50).
### Sitemaps ### Sitemaps
Iris generates and serves one or more [sitemap.xml](https://www.sitemaps.org/protocol.html) for your static routes. Iris generates and serves one or more [sitemap.xml](https://www.sitemaps.org/protocol.html) for your static routes.
Navigate through: https://github.com/kataras/iris/blob/master/_examples/routing/sitemap/main.go for more. Navigate through: https://github.com/kataras/iris/blob/main/_examples/routing/sitemap/main.go for more.
## New Examples ## New Examples
@ -1219,7 +1221,7 @@ Commit log: https://github.com/kataras/iris/compare/v11.2.3...v11.2.4
- [New Feature: Handle different parameter types in the same path](https://github.com/kataras/iris/issues/1315) - [New Feature: Handle different parameter types in the same path](https://github.com/kataras/iris/issues/1315)
- [New Feature: Content Negotiation](https://github.com/kataras/iris/issues/1319) - [New Feature: Content Negotiation](https://github.com/kataras/iris/issues/1319)
- [Context.ReadYAML](https://github.com/kataras/iris/tree/master/_examples/request-body/read-yaml) - [Context.ReadYAML](https://github.com/kataras/iris/tree/main/_examples/request-body/read-yaml)
- Fixes https://github.com/kataras/neffos/issues/1#issuecomment-515698536 - Fixes https://github.com/kataras/neffos/issues/1#issuecomment-515698536
# We, 24 July 2019 | v11.2.2 # We, 24 July 2019 | v11.2.2

View File

@ -6,7 +6,7 @@ Try the official [Iris Command Line Interface](https://github.com/kataras/iris-c
# <a href="https://iris-go.com"><img src="https://iris-go.com/images/logo-new-lq-45.png"></a> Iris Web Framework <a href="README_GR.md"><img width="20px" src="https://iris-go.com/images/flag-greece.svg" /> <a href="README_JA.md"><img width="20px" height="20px" src="https://iris-go.com/images/flag-japan.svg" /></a> </a> <a href="README_FR.md"><img width="20px" src="https://iris-go.com/images/flag-france.svg" /></a> <a href="README_ZH_HANT.md"><img width="20px" src="https://iris-go.com/images/flag-taiwan.svg" /></a> <a href="README_ZH_HANS.md"><img width="20px" src="https://iris-go.com/images/flag-china.svg" /></a> <a href="README_ES.md"><img width="20px" src="https://iris-go.com/images/flag-spain.png" /></a> <a href="README_FA.md"><img width="20px" src="https://iris-go.com/images/flag-iran.svg" /></a> <a href="README_RU.md"><img width="20px" src="https://iris-go.com/images/flag-russia.svg" /></a> <a href="README_KO.md"><img width="20px" src="https://iris-go.com/images/flag-south-korea.svg?v=12" /></a> <a href="README_PT_BR.md"><img width="20px" height="20px" src="https://iris-go.com/images/flag-brazil.svg" /></a> <a href="README_VN.md"><img width="20px" height="20px" src="https://iris-go.com/images/flag-vietnam.svg" /></a> # <a href="https://iris-go.com"><img src="https://iris-go.com/images/logo-new-lq-45.png"></a> Iris Web Framework <a href="README_GR.md"><img width="20px" src="https://iris-go.com/images/flag-greece.svg" /> <a href="README_JA.md"><img width="20px" height="20px" src="https://iris-go.com/images/flag-japan.svg" /></a> </a> <a href="README_FR.md"><img width="20px" src="https://iris-go.com/images/flag-france.svg" /></a> <a href="README_ZH_HANT.md"><img width="20px" src="https://iris-go.com/images/flag-taiwan.svg" /></a> <a href="README_ZH_HANS.md"><img width="20px" src="https://iris-go.com/images/flag-china.svg" /></a> <a href="README_ES.md"><img width="20px" src="https://iris-go.com/images/flag-spain.png" /></a> <a href="README_FA.md"><img width="20px" src="https://iris-go.com/images/flag-iran.svg" /></a> <a href="README_RU.md"><img width="20px" src="https://iris-go.com/images/flag-russia.svg" /></a> <a href="README_KO.md"><img width="20px" src="https://iris-go.com/images/flag-south-korea.svg?v=12" /></a> <a href="README_PT_BR.md"><img width="20px" height="20px" src="https://iris-go.com/images/flag-brazil.svg" /></a> <a href="README_VN.md"><img width="20px" height="20px" src="https://iris-go.com/images/flag-vietnam.svg" /></a>
[![build status](https://img.shields.io/github/actions/workflow/status/kataras/iris/ci.yml?branch=master&style=for-the-badge)](https://github.com/kataras/iris/actions/workflows/ci.yml) [![view examples](https://img.shields.io/badge/examples%20-285-a83adf.svg?style=for-the-badge&logo=go)](https://github.com/kataras/iris/tree/master/_examples) [![chat](https://img.shields.io/gitter/room/iris_go/community.svg?color=cc2b5e&logo=gitter&style=for-the-badge)](https://gitter.im/iris_go/community) <!--[![FOSSA Status](https://img.shields.io/badge/LICENSE%20SCAN-PASSING❤-CD2956?style=for-the-badge&logo=fossa)](https://app.fossa.io/projects/git%2Bgithub.com%2Fkataras%2Firis?ref=badge_shield)--> [![donate](https://img.shields.io/badge/support-Iris-blue.svg?style=for-the-badge&logo=paypal)](https://iris-go.com/donate) <!--[![report card](https://img.shields.io/badge/report%20card-a%2B-ff3333.svg?style=for-the-badge)](https://goreportcard.com/report/github.com/kataras/iris)--><!--[![godocs](https://img.shields.io/badge/go-%20docs-488AC7.svg?style=for-the-badge)](https://pkg.go.dev/github.com/kataras/iris/v12@v12.2.0)--> <!-- [![release](https://img.shields.io/badge/release%20-v12.0-0077b3.svg?style=for-the-badge)](https://github.com/kataras/iris/releases) --> [![build status](https://img.shields.io/github/actions/workflow/status/kataras/iris/ci.yml?branch=main&style=for-the-badge)](https://github.com/kataras/iris/actions/workflows/ci.yml) [![view examples](https://img.shields.io/badge/examples%20-285-a83adf.svg?style=for-the-badge&logo=go)](https://github.com/kataras/iris/tree/main/_examples) [![chat](https://img.shields.io/gitter/room/iris_go/community.svg?color=cc2b5e&logo=gitter&style=for-the-badge)](https://gitter.im/iris_go/community) <!--[![FOSSA Status](https://img.shields.io/badge/LICENSE%20SCAN-PASSING❤-CD2956?style=for-the-badge&logo=fossa)](https://app.fossa.io/projects/git%2Bgithub.com%2Fkataras%2Firis?ref=badge_shield)--> [![donate](https://img.shields.io/badge/support-Iris-blue.svg?style=for-the-badge&logo=paypal)](https://iris-go.com/donate) <!--[![report card](https://img.shields.io/badge/report%20card-a%2B-ff3333.svg?style=for-the-badge)](https://goreportcard.com/report/github.com/kataras/iris)--><!--[![godocs](https://img.shields.io/badge/go-%20docs-488AC7.svg?style=for-the-badge)](https://pkg.go.dev/github.com/kataras/iris/v12@v12.2.0)--> <!-- [![release](https://img.shields.io/badge/release%20-v12.0-0077b3.svg?style=for-the-badge)](https://github.com/kataras/iris/releases) -->
Iris is a fast, simple yet fully featured and very efficient web framework for Go. Iris is a fast, simple yet fully featured and very efficient web framework for Go.
@ -77,21 +77,21 @@ func updateUser(ctx iris.Context) {
} }
``` ```
> Read the [routing examples](https://github.com/kataras/iris/blob/master/_examples/routing) for more! > Read the [routing examples](https://github.com/kataras/iris/blob/main/_examples/routing) for more!
</details> </details>
<details><summary>Handler with custom input and output arguments</summary> <details><summary>Handler with custom input and output arguments</summary>
[![https://github.com/kataras/iris/blob/master/_examples/dependency-injection/basic/main.go](https://user-images.githubusercontent.com/22900943/105253731-b8db6d00-5b88-11eb-90c1-0c92a5581c86.png)](https://twitter.com/iris_framework/status/1234783655408668672) [![https://github.com/kataras/iris/blob/main/_examples/dependency-injection/basic/main.go](https://user-images.githubusercontent.com/22900943/105253731-b8db6d00-5b88-11eb-90c1-0c92a5581c86.png)](https://twitter.com/iris_framework/status/1234783655408668672)
> Interesting? Read the [examples](https://github.com/kataras/iris/blob/master/_examples/dependency-injection). > Interesting? Read the [examples](https://github.com/kataras/iris/blob/main/_examples/dependency-injection).
</details> </details>
<details><summary>Party Controller (NEW)</summary> <details><summary>Party Controller (NEW)</summary>
> Head over to the [full running example](https://github.com/kataras/iris/blob/master/_examples/routing/party-controller)! > Head over to the [full running example](https://github.com/kataras/iris/blob/main/_examples/routing/party-controller)!
</details> </details>
@ -569,7 +569,7 @@ Iris contains extensive and thorough **[documentation](https://www.iris-go.com/d
<!-- ![](https://media.giphy.com/media/Ur8iqy9FQfmPuyQpgy/giphy.gif) --> <!-- ![](https://media.giphy.com/media/Ur8iqy9FQfmPuyQpgy/giphy.gif) -->
For a more detailed technical documentation you can head over to our [godocs](https://pkg.go.dev/github.com/kataras/iris/v12@master). And for executable code you can always visit the [./_examples](_examples) repository's subdirectory. For a more detailed technical documentation you can head over to our [godocs](https://pkg.go.dev/github.com/kataras/iris/v12@main). And for executable code you can always visit the [./_examples](_examples) repository's subdirectory.
### Do you like to read while traveling? ### Do you like to read while traveling?

View File

@ -1,6 +1,6 @@
# Iris Web Framework # Iris Web Framework
[![build status](https://img.shields.io/github/actions/workflow/status/kataras/iris/ci.yml?branch=master&style=for-the-badge)](https://github.com/kataras/iris/actions/workflows/ci.yml) [![FOSSA Status](https://img.shields.io/badge/LICENSE%20SCAN-PASSING❤-CD2956?style=for-the-badge&logo=fossa)](https://app.fossa.io/projects/git%2Bgithub.com%2Fkataras%2Firis?ref=badge_shield)<!--[![report card](https://img.shields.io/badge/report%20card-a%2B-ff3333.svg?style=for-the-badge)](https://goreportcard.com/report/github.com/kataras/iris)--><!--[![godocs](https://img.shields.io/badge/go-%20docs-488AC7.svg?style=for-the-badge)](https://pkg.go.dev/github.com/kataras/iris/v12@v12.2.0)--> [![view examples](https://img.shields.io/badge/learn%20by-examples-0C8EC5.svg?style=for-the-badge&logo=go)](https://github.com/kataras/iris/tree/master/_examples) [![chat](https://img.shields.io/gitter/room/iris_go/community.svg?color=7E18DD&logo=gitter&style=for-the-badge)](https://gitter.im/iris_go/community)<!--[![donate on PayPal](https://img.shields.io/badge/support-PayPal-blue.svg?style=for-the-badge)](https://iris-go.com/donate)--><!-- [![release](https://img.shields.io/badge/release%20-v12.0-0077b3.svg?style=for-the-badge)](https://github.com/kataras/iris/releases) --> [![build status](https://img.shields.io/github/actions/workflow/status/kataras/iris/ci.yml?branch=main&style=for-the-badge)](https://github.com/kataras/iris/actions/workflows/ci.yml) [![FOSSA Status](https://img.shields.io/badge/LICENSE%20SCAN-PASSING❤-CD2956?style=for-the-badge&logo=fossa)](https://app.fossa.io/projects/git%2Bgithub.com%2Fkataras%2Firis?ref=badge_shield)<!--[![report card](https://img.shields.io/badge/report%20card-a%2B-ff3333.svg?style=for-the-badge)](https://goreportcard.com/report/github.com/kataras/iris)--><!--[![godocs](https://img.shields.io/badge/go-%20docs-488AC7.svg?style=for-the-badge)](https://pkg.go.dev/github.com/kataras/iris/v12@v12.2.0)--> [![view examples](https://img.shields.io/badge/learn%20by-examples-0C8EC5.svg?style=for-the-badge&logo=go)](https://github.com/kataras/iris/tree/main/_examples) [![chat](https://img.shields.io/gitter/room/iris_go/community.svg?color=7E18DD&logo=gitter&style=for-the-badge)](https://gitter.im/iris_go/community)<!--[![donate on PayPal](https://img.shields.io/badge/support-PayPal-blue.svg?style=for-the-badge)](https://iris-go.com/donate)--><!-- [![release](https://img.shields.io/badge/release%20-v12.0-0077b3.svg?style=for-the-badge)](https://github.com/kataras/iris/releases) -->
Iris es un framework web rápido, simple pero con muchas funcionalidades y muy eficiente para Go. Proporciona una base bellamente expresiva y fácil de usar para su próximo sitio web o API. Iris es un framework web rápido, simple pero con muchas funcionalidades y muy eficiente para Go. Proporciona una base bellamente expresiva y fácil de usar para su próximo sitio web o API.

View File

@ -10,7 +10,7 @@
# Iris Web Framework # Iris Web Framework
[![build status](https://img.shields.io/github/actions/workflow/status/kataras/iris/ci.yml?branch=master&style=for-the-badge)](https://github.com/kataras/iris/actions/workflows/ci.yml) [![FOSSA Status](https://img.shields.io/badge/LICENSE%20SCAN-PASSING❤-CD2956?style=for-the-badge&logo=fossa)](https://app.fossa.io/projects/git%2Bgithub.com%2Fkataras%2Firis?ref=badge_shield)<!--[![report card](https://img.shields.io/badge/report%20card-a%2B-ff3333.svg?style=for-the-badge)](https://goreportcard.com/report/github.com/kataras/iris)--><!--[![godocs](https://img.shields.io/badge/go-%20docs-488AC7.svg?style=for-the-badge)](https://pkg.go.dev/github.com/kataras/iris/v12@v12.2.0)--> [![view examples](https://img.shields.io/badge/learn%20by-examples-0C8EC5.svg?style=for-the-badge&logo=go)](https://github.com/kataras/iris/tree/master/_examples) [![chat](https://img.shields.io/gitter/room/iris_go/community.svg?color=7E18DD&logo=gitter&style=for-the-badge)](https://gitter.im/iris_go/community)<!--[![donate on PayPal](https://img.shields.io/badge/support-PayPal-blue.svg?style=for-the-badge)](https://iris-go.com/donate)--><!-- [![release](https://img.shields.io/badge/release%20-v12.0-0077b3.svg?style=for-the-badge)](https://github.com/kataras/iris/releases) --> [![build status](https://img.shields.io/github/actions/workflow/status/kataras/iris/ci.yml?branch=main&style=for-the-badge)](https://github.com/kataras/iris/actions/workflows/ci.yml) [![FOSSA Status](https://img.shields.io/badge/LICENSE%20SCAN-PASSING❤-CD2956?style=for-the-badge&logo=fossa)](https://app.fossa.io/projects/git%2Bgithub.com%2Fkataras%2Firis?ref=badge_shield)<!--[![report card](https://img.shields.io/badge/report%20card-a%2B-ff3333.svg?style=for-the-badge)](https://goreportcard.com/report/github.com/kataras/iris)--><!--[![godocs](https://img.shields.io/badge/go-%20docs-488AC7.svg?style=for-the-badge)](https://pkg.go.dev/github.com/kataras/iris/v12@v12.2.0)--> [![view examples](https://img.shields.io/badge/learn%20by-examples-0C8EC5.svg?style=for-the-badge&logo=go)](https://github.com/kataras/iris/tree/main/_examples) [![chat](https://img.shields.io/gitter/room/iris_go/community.svg?color=7E18DD&logo=gitter&style=for-the-badge)](https://gitter.im/iris_go/community)<!--[![donate on PayPal](https://img.shields.io/badge/support-PayPal-blue.svg?style=for-the-badge)](https://iris-go.com/donate)--><!-- [![release](https://img.shields.io/badge/release%20-v12.0-0077b3.svg?style=for-the-badge)](https://github.com/kataras/iris/releases) -->
آیریس یک چارچوب وب پر سرعت ، ساده و در عین حال کاملاً برجسته و بسیار کارآمد برای Go است. آیریس یک چارچوب وب پر سرعت ، ساده و در عین حال کاملاً برجسته و بسیار کارآمد برای Go است.
</div> </div>
@ -56,15 +56,15 @@ func updateUser(ctx iris.Context) {
ctx.JSON(resp) ctx.JSON(resp)
} }
``` ```
> !برای اطلاعات بیشتر ، [مثال های مسیریابی](https://github.com/kataras/iris/blob/master/_examples/routing) را بخوانید > !برای اطلاعات بیشتر ، [مثال های مسیریابی](https://github.com/kataras/iris/blob/main/_examples/routing) را بخوانید
</details> </details>
<details><summary>Handler with custom input and output arguments</summary> <details><summary>Handler with custom input and output arguments</summary>
[![https://github.com/kataras/iris/blob/master/_examples/dependency-injection/basic/main.go](https://user-images.githubusercontent.com/22900943/105253731-b8db6d00-5b88-11eb-90c1-0c92a5581c86.png)](https://twitter.com/iris_framework/status/1234783655408668672) [![https://github.com/kataras/iris/blob/main/_examples/dependency-injection/basic/main.go](https://user-images.githubusercontent.com/22900943/105253731-b8db6d00-5b88-11eb-90c1-0c92a5581c86.png)](https://twitter.com/iris_framework/status/1234783655408668672)
> اگر برایتان جالب بود [مثال های دیگری](https://github.com/kataras/iris/blob/master/_examples/dependency-injection) را مطالعه کنید > اگر برایتان جالب بود [مثال های دیگری](https://github.com/kataras/iris/blob/main/_examples/dependency-injection) را مطالعه کنید
</details> </details>
@ -274,7 +274,7 @@ require github.com/kataras/iris/v12 v12.2.0-beta4.0.20220920072528-ff81f370625a
برای اطلاعات بیشتر در مورد اسناد فنی می توانید به مستندات اصلی ما مراجعه کنید. برای اطلاعات بیشتر در مورد اسناد فنی می توانید به مستندات اصلی ما مراجعه کنید.
> [مستندات اصلی](https://pkg.go.dev/github.com/kataras/iris/v12@master) > [مستندات اصلی](https://pkg.go.dev/github.com/kataras/iris/v12@main)
## دوست دارید در حین مسافرت کتاب بخوانید ? ## دوست دارید در حین مسافرت کتاب بخوانید ?

View File

@ -1,6 +1,6 @@
# Iris Web Framework # Iris Web Framework
[![build status](https://img.shields.io/github/actions/workflow/status/kataras/iris/ci.yml?branch=master&style=for-the-badge)](https://github.com/kataras/iris/actions/workflows/ci.yml) [![FOSSA Status](https://img.shields.io/badge/LICENSE%20SCAN-PASSING❤-CD2956?style=for-the-badge&logo=fossa)](https://app.fossa.io/projects/git%2Bgithub.com%2Fkataras%2Firis?ref=badge_shield)<!--[![report card](https://img.shields.io/badge/report%20card-a%2B-ff3333.svg?style=for-the-badge)](https://goreportcard.com/report/github.com/kataras/iris)--><!--[![godocs](https://img.shields.io/badge/go-%20docs-488AC7.svg?style=for-the-badge)](https://pkg.go.dev/github.com/kataras/iris/v12@v12.2.0)--> [![view examples](https://img.shields.io/badge/learn%20by-examples-0C8EC5.svg?style=for-the-badge&logo=go)](https://github.com/kataras/iris/tree/master/_examples) [![chat](https://img.shields.io/gitter/room/iris_go/community.svg?color=7E18DD&logo=gitter&style=for-the-badge)](https://gitter.im/iris_go/community)<!--[![donate on PayPal](https://img.shields.io/badge/support-PayPal-blue.svg?style=for-the-badge)](https://iris-go.com/donate)--><!-- [![release](https://img.shields.io/badge/release%20-v12.0-0077b3.svg?style=for-the-badge)](https://github.com/kataras/iris/releases) --> [![build status](https://img.shields.io/github/actions/workflow/status/kataras/iris/ci.yml?branch=main&style=for-the-badge)](https://github.com/kataras/iris/actions/workflows/ci.yml) [![FOSSA Status](https://img.shields.io/badge/LICENSE%20SCAN-PASSING❤-CD2956?style=for-the-badge&logo=fossa)](https://app.fossa.io/projects/git%2Bgithub.com%2Fkataras%2Firis?ref=badge_shield)<!--[![report card](https://img.shields.io/badge/report%20card-a%2B-ff3333.svg?style=for-the-badge)](https://goreportcard.com/report/github.com/kataras/iris)--><!--[![godocs](https://img.shields.io/badge/go-%20docs-488AC7.svg?style=for-the-badge)](https://pkg.go.dev/github.com/kataras/iris/v12@v12.2.0)--> [![view examples](https://img.shields.io/badge/learn%20by-examples-0C8EC5.svg?style=for-the-badge&logo=go)](https://github.com/kataras/iris/tree/main/_examples) [![chat](https://img.shields.io/gitter/room/iris_go/community.svg?color=7E18DD&logo=gitter&style=for-the-badge)](https://gitter.im/iris_go/community)<!--[![donate on PayPal](https://img.shields.io/badge/support-PayPal-blue.svg?style=for-the-badge)](https://iris-go.com/donate)--><!-- [![release](https://img.shields.io/badge/release%20-v12.0-0077b3.svg?style=for-the-badge)](https://github.com/kataras/iris/releases) -->
<a href="https://iris-go.com"> <img align="right" src="https://iris-go.com/images/logo-w169.png"></a> <a href="https://iris-go.com"> <img align="right" src="https://iris-go.com/images/logo-w169.png"></a>

View File

@ -1,6 +1,6 @@
# Iris Web Framework # Iris Web Framework
[![build status](https://img.shields.io/github/actions/workflow/status/kataras/iris/ci.yml?branch=master&style=for-the-badge)](https://github.com/kataras/iris/actions/workflows/ci.yml) [![FOSSA Status](https://img.shields.io/badge/LICENSE%20SCAN-PASSING❤-CD2956?style=for-the-badge&logo=fossa)](https://app.fossa.io/projects/git%2Bgithub.com%2Fkataras%2Firis?ref=badge_shield)<!--[![report card](https://img.shields.io/badge/report%20card-a%2B-ff3333.svg?style=for-the-badge)](https://goreportcard.com/report/github.com/kataras/iris)--><!--[![godocs](https://img.shields.io/badge/go-%20docs-488AC7.svg?style=for-the-badge)](https://pkg.go.dev/github.com/kataras/iris/v12@v12.2.0)--> [![view examples](https://img.shields.io/badge/learn%20by-examples-0C8EC5.svg?style=for-the-badge&logo=go)](https://github.com/kataras/iris/tree/master/_examples) [![chat](https://img.shields.io/gitter/room/iris_go/community.svg?color=7E18DD&logo=gitter&style=for-the-badge)](https://gitter.im/iris_go/community)<!--[![donate on PayPal](https://img.shields.io/badge/support-PayPal-blue.svg?style=for-the-badge)](https://iris-go.com/donate)--><!-- [![release](https://img.shields.io/badge/release%20-v12.0-0077b3.svg?style=for-the-badge)](https://github.com/kataras/iris/releases) --> [![build status](https://img.shields.io/github/actions/workflow/status/kataras/iris/ci.yml?branch=main&style=for-the-badge)](https://github.com/kataras/iris/actions/workflows/ci.yml) [![FOSSA Status](https://img.shields.io/badge/LICENSE%20SCAN-PASSING❤-CD2956?style=for-the-badge&logo=fossa)](https://app.fossa.io/projects/git%2Bgithub.com%2Fkataras%2Firis?ref=badge_shield)<!--[![report card](https://img.shields.io/badge/report%20card-a%2B-ff3333.svg?style=for-the-badge)](https://goreportcard.com/report/github.com/kataras/iris)--><!--[![godocs](https://img.shields.io/badge/go-%20docs-488AC7.svg?style=for-the-badge)](https://pkg.go.dev/github.com/kataras/iris/v12@v12.2.0)--> [![view examples](https://img.shields.io/badge/learn%20by-examples-0C8EC5.svg?style=for-the-badge&logo=go)](https://github.com/kataras/iris/tree/main/_examples) [![chat](https://img.shields.io/gitter/room/iris_go/community.svg?color=7E18DD&logo=gitter&style=for-the-badge)](https://gitter.im/iris_go/community)<!--[![donate on PayPal](https://img.shields.io/badge/support-PayPal-blue.svg?style=for-the-badge)](https://iris-go.com/donate)--><!-- [![release](https://img.shields.io/badge/release%20-v12.0-0077b3.svg?style=for-the-badge)](https://github.com/kataras/iris/releases) -->
Το Iris είναι ένα γρήγορο, απλό αλλά και πλήρως λειτουργικό και πολύ αποδοτικό web framework για τη Go γλώσσα προγραμματισμού. Παρέχει ένα εκφραστικό και εύχρηστο υπόβαθρο για την επόμενη ιστοσελίδα σας. Το Iris είναι ένα γρήγορο, απλό αλλά και πλήρως λειτουργικό και πολύ αποδοτικό web framework για τη Go γλώσσα προγραμματισμού. Παρέχει ένα εκφραστικό και εύχρηστο υπόβαθρο για την επόμενη ιστοσελίδα σας.

View File

@ -6,7 +6,7 @@ Try the official [Iris Command Line Interface](https://github.com/kataras/iris-c
# <a href="https://iris-go.com"><img src="https://iris-go.com/images/logo-new-lq-45.png"></a> Iris Web Framework <a href="README_GR.md"><img width="20px" src="https://iris-go.com/images/flag-greece.svg" /></a> <a href="README_FR.md"><img width="20px" src="https://iris-go.com/images/flag-france.svg" /></a> <a href="README_ZH_HANT.md"><img width="20px" src="https://iris-go.com/images/flag-taiwan.svg" /></a> <a href="README_ZH_HANS.md"><img width="20px" src="https://iris-go.com/images/flag-china.svg" /></a> <a href="README_ES.md"><img width="20px" src="https://iris-go.com/images/flag-spain.png" /></a> <a href="README_FA.md"><img width="20px" src="https://iris-go.com/images/flag-iran.svg" /></a> <a href="README_RU.md"><img width="20px" src="https://iris-go.com/images/flag-russia.svg" /></a> <a href="README_KO.md"><img width="20px" src="https://iris-go.com/images/flag-south-korea.svg?v=12" /></a> <a href="README_PT_BR.md"><img width="20px" height="20px" src="https://iris-go.com/images/flag-brazil.svg" /></a> <a href="README_JA.md"><img width="20px" height="20px" src="https://iris-go.com/images/flag-japan.svg" /></a> # <a href="https://iris-go.com"><img src="https://iris-go.com/images/logo-new-lq-45.png"></a> Iris Web Framework <a href="README_GR.md"><img width="20px" src="https://iris-go.com/images/flag-greece.svg" /></a> <a href="README_FR.md"><img width="20px" src="https://iris-go.com/images/flag-france.svg" /></a> <a href="README_ZH_HANT.md"><img width="20px" src="https://iris-go.com/images/flag-taiwan.svg" /></a> <a href="README_ZH_HANS.md"><img width="20px" src="https://iris-go.com/images/flag-china.svg" /></a> <a href="README_ES.md"><img width="20px" src="https://iris-go.com/images/flag-spain.png" /></a> <a href="README_FA.md"><img width="20px" src="https://iris-go.com/images/flag-iran.svg" /></a> <a href="README_RU.md"><img width="20px" src="https://iris-go.com/images/flag-russia.svg" /></a> <a href="README_KO.md"><img width="20px" src="https://iris-go.com/images/flag-south-korea.svg?v=12" /></a> <a href="README_PT_BR.md"><img width="20px" height="20px" src="https://iris-go.com/images/flag-brazil.svg" /></a> <a href="README_JA.md"><img width="20px" height="20px" src="https://iris-go.com/images/flag-japan.svg" /></a>
[![build status](https://img.shields.io/github/actions/workflow/status/kataras/iris/ci.yml?branch=master&style=for-the-badge)](https://github.com/kataras/iris/actions/workflows/ci.yml) [![view examples](https://img.shields.io/badge/examples%20-285-a83adf.svg?style=for-the-badge&logo=go)](https://github.com/kataras/iris/tree/master/_examples) [![chat](https://img.shields.io/gitter/room/iris_go/community.svg?color=cc2b5e&logo=gitter&style=for-the-badge)](https://gitter.im/iris_go/community) <!--[![FOSSA Status](https://img.shields.io/badge/LICENSE%20SCAN-PASSING❤-CD2956?style=for-the-badge&logo=fossa)](https://app.fossa.io/projects/git%2Bgithub.com%2Fkataras%2Firis?ref=badge_shield)--> [![donate](https://img.shields.io/badge/support-Iris-blue.svg?style=for-the-badge&logo=paypal)](https://iris-go.com/donate) <!--[![report card](https://img.shields.io/badge/report%20card-a%2B-ff3333.svg?style=for-the-badge)](https://goreportcard.com/report/github.com/kataras/iris)--><!--[![godocs](https://img.shields.io/badge/go-%20docs-488AC7.svg?style=for-the-badge)](https://pkg.go.dev/github.com/kataras/iris/v12@v12.2.0)--> <!-- [![release](https://img.shields.io/badge/release%20-v12.0-0077b3.svg?style=for-the-badge)](https://github.com/kataras/iris/releases) --> [![build status](https://img.shields.io/github/actions/workflow/status/kataras/iris/ci.yml?branch=main&style=for-the-badge)](https://github.com/kataras/iris/actions/workflows/ci.yml) [![view examples](https://img.shields.io/badge/examples%20-285-a83adf.svg?style=for-the-badge&logo=go)](https://github.com/kataras/iris/tree/main/_examples) [![chat](https://img.shields.io/gitter/room/iris_go/community.svg?color=cc2b5e&logo=gitter&style=for-the-badge)](https://gitter.im/iris_go/community) <!--[![FOSSA Status](https://img.shields.io/badge/LICENSE%20SCAN-PASSING❤-CD2956?style=for-the-badge&logo=fossa)](https://app.fossa.io/projects/git%2Bgithub.com%2Fkataras%2Firis?ref=badge_shield)--> [![donate](https://img.shields.io/badge/support-Iris-blue.svg?style=for-the-badge&logo=paypal)](https://iris-go.com/donate) <!--[![report card](https://img.shields.io/badge/report%20card-a%2B-ff3333.svg?style=for-the-badge)](https://goreportcard.com/report/github.com/kataras/iris)--><!--[![godocs](https://img.shields.io/badge/go-%20docs-488AC7.svg?style=for-the-badge)](https://pkg.go.dev/github.com/kataras/iris/v12@v12.2.0)--> <!-- [![release](https://img.shields.io/badge/release%20-v12.0-0077b3.svg?style=for-the-badge)](https://github.com/kataras/iris/releases) -->
Irisは、高速でシンプルでありながら、十分な機能を備えた、非常に効率的なGo用Webフレームワークです。 Irisは、高速でシンプルでありながら、十分な機能を備えた、非常に効率的なGo用Webフレームワークです。
@ -77,21 +77,21 @@ func updateUser(ctx iris.Context) {
} }
``` ```
> Read the [routing examples](https://github.com/kataras/iris/blob/master/_examples/routing) for more! > Read the [routing examples](https://github.com/kataras/iris/blob/main/_examples/routing) for more!
</details> </details>
<details><summary>Handler with custom input and output arguments</summary> <details><summary>Handler with custom input and output arguments</summary>
[![https://github.com/kataras/iris/blob/master/_examples/dependency-injection/basic/main.go](https://user-images.githubusercontent.com/22900943/105253731-b8db6d00-5b88-11eb-90c1-0c92a5581c86.png)](https://twitter.com/iris_framework/status/1234783655408668672) [![https://github.com/kataras/iris/blob/main/_examples/dependency-injection/basic/main.go](https://user-images.githubusercontent.com/22900943/105253731-b8db6d00-5b88-11eb-90c1-0c92a5581c86.png)](https://twitter.com/iris_framework/status/1234783655408668672)
> Interesting? Read the [examples](https://github.com/kataras/iris/blob/master/_examples/dependency-injection). > Interesting? Read the [examples](https://github.com/kataras/iris/blob/main/_examples/dependency-injection).
</details> </details>
<details><summary>Party Controller (NEW)</summary> <details><summary>Party Controller (NEW)</summary>
> Head over to the [full running example](https://github.com/kataras/iris/blob/master/_examples/routing/party-controller)! > Head over to the [full running example](https://github.com/kataras/iris/blob/main/_examples/routing/party-controller)!
</details> </details>
@ -569,7 +569,7 @@ Iris には広範で詳細な **[ドキュメント](https://www.iris-go.com/doc
<!-- ![](https://media.giphy.com/media/Ur8iqy9FQfmPuyQpgy/giphy.gif) --> <!-- ![](https://media.giphy.com/media/Ur8iqy9FQfmPuyQpgy/giphy.gif) -->
より詳細な技術文書については [godocs](https://pkg.go.dev/github.com/kataras/iris/v12@master) をご覧ください。また、実行可能なコードについては、いつでもリポジトリのサブディレクトリ [./_examples](_examples) にアクセスできます。 より詳細な技術文書については [godocs](https://pkg.go.dev/github.com/kataras/iris/v12@main) をご覧ください。また、実行可能なコードについては、いつでもリポジトリのサブディレクトリ [./_examples](_examples) にアクセスできます。
### 旅行中に本を読むのは好きですか? ### 旅行中に本を読むのは好きですか?

View File

@ -1,6 +1,6 @@
# Iris Web Framework # Iris Web Framework
[![build status](https://img.shields.io/github/actions/workflow/status/kataras/iris/ci.yml?branch=master&style=for-the-badge)](https://github.com/kataras/iris/actions/workflows/ci.yml) [![FOSSA Status](https://img.shields.io/badge/LICENSE%20SCAN-PASSING❤-CD2956?style=for-the-badge&logo=fossa)](https://app.fossa.io/projects/git%2Bgithub.com%2Fkataras%2Firis?ref=badge_shield)<!--[![report card](https://img.shields.io/badge/report%20card-a%2B-ff3333.svg?style=for-the-badge)](https://goreportcard.com/report/github.com/kataras/iris)--><!--[![godocs](https://img.shields.io/badge/go-%20docs-488AC7.svg?style=for-the-badge)](https://pkg.go.dev/github.com/kataras/iris/v12@v12.2.0)--> [![view examples](https://img.shields.io/badge/learn%20by-examples-0C8EC5.svg?style=for-the-badge&logo=go)](https://github.com/kataras/iris/tree/master/_examples) [![chat](https://img.shields.io/gitter/room/iris_go/community.svg?color=7E18DD&logo=gitter&style=for-the-badge)](https://gitter.im/iris_go/community)<!--[![donate on PayPal](https://img.shields.io/badge/support-PayPal-blue.svg?style=for-the-badge)](https://iris-go.com/donate)--><!-- [![release](https://img.shields.io/badge/release%20-v12.0-0077b3.svg?style=for-the-badge)](https://github.com/kataras/iris/releases) --> [![build status](https://img.shields.io/github/actions/workflow/status/kataras/iris/ci.yml?branch=main&style=for-the-badge)](https://github.com/kataras/iris/actions/workflows/ci.yml) [![FOSSA Status](https://img.shields.io/badge/LICENSE%20SCAN-PASSING❤-CD2956?style=for-the-badge&logo=fossa)](https://app.fossa.io/projects/git%2Bgithub.com%2Fkataras%2Firis?ref=badge_shield)<!--[![report card](https://img.shields.io/badge/report%20card-a%2B-ff3333.svg?style=for-the-badge)](https://goreportcard.com/report/github.com/kataras/iris)--><!--[![godocs](https://img.shields.io/badge/go-%20docs-488AC7.svg?style=for-the-badge)](https://pkg.go.dev/github.com/kataras/iris/v12@v12.2.0)--> [![view examples](https://img.shields.io/badge/learn%20by-examples-0C8EC5.svg?style=for-the-badge&logo=go)](https://github.com/kataras/iris/tree/main/_examples) [![chat](https://img.shields.io/gitter/room/iris_go/community.svg?color=7E18DD&logo=gitter&style=for-the-badge)](https://gitter.im/iris_go/community)<!--[![donate on PayPal](https://img.shields.io/badge/support-PayPal-blue.svg?style=for-the-badge)](https://iris-go.com/donate)--><!-- [![release](https://img.shields.io/badge/release%20-v12.0-0077b3.svg?style=for-the-badge)](https://github.com/kataras/iris/releases) -->
Iris는 단순하고 빠르며 좋은 성능과 모든 기능을 갖춘 Go언어용 웹 프레임워크입니다. 당신의 웹사이트나 API를 위해서 아름답고 사용하기 쉬운 기반을 제공합니다. Iris는 단순하고 빠르며 좋은 성능과 모든 기능을 갖춘 Go언어용 웹 프레임워크입니다. 당신의 웹사이트나 API를 위해서 아름답고 사용하기 쉬운 기반을 제공합니다.

View File

@ -2,7 +2,7 @@
# Iris Web Framework <a href="README_GR.md"><img width="20px" src="https://iris-go.com/images/flag-greece.svg" /></a> <a href="README_FR.md"><img width="20px" src="https://iris-go.com/images/flag-france.svg" /></a> <a href="README_ZH.md"><img width="20px" src="https://iris-go.com/images/flag-china.svg" /></a> <a href="README_ES.md"><img width="20px" src="https://iris-go.com/images/flag-spain.png" /></a> <a href="README_FA.md"><img width="20px" src="https://iris-go.com/images/flag-iran.svg" /></a> <a href="README_RU.md"><img width="20px" src="https://iris-go.com/images/flag-russia.svg" /></a> <a href="README_KO.md"><img width="20px" src="https://iris-go.com/images/flag-south-korea.svg?v=12" /></a> <a href="README_PT_BR.md"><img width="20px" align="center" src="https://www.iris-go.com/images/flag-brazil.svg" /></a> <a href="README_JA.md"><img width="20px" height="20px" src="https://iris-go.com/images/flag-japan.svg" /></a> # Iris Web Framework <a href="README_GR.md"><img width="20px" src="https://iris-go.com/images/flag-greece.svg" /></a> <a href="README_FR.md"><img width="20px" src="https://iris-go.com/images/flag-france.svg" /></a> <a href="README_ZH.md"><img width="20px" src="https://iris-go.com/images/flag-china.svg" /></a> <a href="README_ES.md"><img width="20px" src="https://iris-go.com/images/flag-spain.png" /></a> <a href="README_FA.md"><img width="20px" src="https://iris-go.com/images/flag-iran.svg" /></a> <a href="README_RU.md"><img width="20px" src="https://iris-go.com/images/flag-russia.svg" /></a> <a href="README_KO.md"><img width="20px" src="https://iris-go.com/images/flag-south-korea.svg?v=12" /></a> <a href="README_PT_BR.md"><img width="20px" align="center" src="https://www.iris-go.com/images/flag-brazil.svg" /></a> <a href="README_JA.md"><img width="20px" height="20px" src="https://iris-go.com/images/flag-japan.svg" /></a>
[![build status](https://img.shields.io/github/actions/workflow/status/kataras/iris/ci.yml?branch=master&style=for-the-badge)](https://github.com/kataras/iris/actions/workflows/ci.yml) [![view examples](https://img.shields.io/badge/examples%20-270-a83adf.svg?style=for-the-badge&logo=go)](https://github.com/kataras/iris/tree/master/_examples) [![chat](https://img.shields.io/gitter/room/iris_go/community.svg?color=cc2b5e&logo=gitter&style=for-the-badge)](https://gitter.im/iris_go/community) <!--[![FOSSA Status](https://img.shields.io/badge/LICENSE%20SCAN-PASSING❤-CD2956?style=for-the-badge&logo=fossa)](https://app.fossa.io/projects/git%2Bgithub.com%2Fkataras%2Firis?ref=badge_shield)--> [![donate](https://img.shields.io/badge/support-Iris-blue.svg?style=for-the-badge&logo=paypal)](https://iris-go.com/donate) <!--[![report card](https://img.shields.io/badge/report%20card-a%2B-ff3333.svg?style=for-the-badge)](https://goreportcard.com/report/github.com/kataras/iris)--><!--[![godocs](https://img.shields.io/badge/go-%20docs-488AC7.svg?style=for-the-badge)](https://pkg.go.dev/github.com/kataras/iris/v12@v12.2.0)--> <!-- [![release](https://img.shields.io/badge/release%20-v12.0-0077b3.svg?style=for-the-badge)](https://github.com/kataras/iris/releases) --> [![build status](https://img.shields.io/github/actions/workflow/status/kataras/iris/ci.yml?branch=main&style=for-the-badge)](https://github.com/kataras/iris/actions/workflows/ci.yml) [![view examples](https://img.shields.io/badge/examples%20-270-a83adf.svg?style=for-the-badge&logo=go)](https://github.com/kataras/iris/tree/main/_examples) [![chat](https://img.shields.io/gitter/room/iris_go/community.svg?color=cc2b5e&logo=gitter&style=for-the-badge)](https://gitter.im/iris_go/community) <!--[![FOSSA Status](https://img.shields.io/badge/LICENSE%20SCAN-PASSING❤-CD2956?style=for-the-badge&logo=fossa)](https://app.fossa.io/projects/git%2Bgithub.com%2Fkataras%2Firis?ref=badge_shield)--> [![donate](https://img.shields.io/badge/support-Iris-blue.svg?style=for-the-badge&logo=paypal)](https://iris-go.com/donate) <!--[![report card](https://img.shields.io/badge/report%20card-a%2B-ff3333.svg?style=for-the-badge)](https://goreportcard.com/report/github.com/kataras/iris)--><!--[![godocs](https://img.shields.io/badge/go-%20docs-488AC7.svg?style=for-the-badge)](https://pkg.go.dev/github.com/kataras/iris/v12@v12.2.0)--> <!-- [![release](https://img.shields.io/badge/release%20-v12.0-0077b3.svg?style=for-the-badge)](https://github.com/kataras/iris/releases) -->
<!-- <a href="https://iris-go.com"> <img align="right" src="https://iris-go.com/images/logo-w169.png"></a> --> <!-- <a href="https://iris-go.com"> <img align="right" src="https://iris-go.com/images/logo-w169.png"></a> -->
@ -70,21 +70,21 @@ func updateUser(ctx iris.Context) {
} }
``` ```
> Read the [routing examples](https://github.com/kataras/iris/blob/master/_examples/routing) for more! > Read the [routing examples](https://github.com/kataras/iris/blob/main/_examples/routing) for more!
</details> </details>
<details><summary>Handler with custom input and output arguments</summary> <details><summary>Handler with custom input and output arguments</summary>
[![https://github.com/kataras/iris/blob/master/_examples/dependency-injection/basic/main.go](https://user-images.githubusercontent.com/22900943/105253731-b8db6d00-5b88-11eb-90c1-0c92a5581c86.png)](https://twitter.com/iris_framework/status/1234783655408668672) [![https://github.com/kataras/iris/blob/main/_examples/dependency-injection/basic/main.go](https://user-images.githubusercontent.com/22900943/105253731-b8db6d00-5b88-11eb-90c1-0c92a5581c86.png)](https://twitter.com/iris_framework/status/1234783655408668672)
> Interesting? Read the [examples](https://github.com/kataras/iris/blob/master/_examples/dependency-injection). > Interesting? Read the [examples](https://github.com/kataras/iris/blob/main/_examples/dependency-injection).
</details> </details>
<details><summary>Party Controller (NEW)</summary> <details><summary>Party Controller (NEW)</summary>
> Head over to the [full running example](https://github.com/kataras/iris/blob/master/_examples/routing/party-controller)! > Head over to the [full running example](https://github.com/kataras/iris/blob/main/_examples/routing/party-controller)!
</details> </details>
@ -489,7 +489,7 @@ Iris contém extensa e completa **[documentação](https://www.iris-go.com/docs)
<!-- ![](https://media.giphy.com/media/Ur8iqy9FQfmPuyQpgy/giphy.gif) --> <!-- ![](https://media.giphy.com/media/Ur8iqy9FQfmPuyQpgy/giphy.gif) -->
Para obter uma documentação técnica mais detalhada, você pode acessar nosso [godocs](https://pkg.go.dev/github.com/kataras/iris/v12@master). E para executar o código você sempre pode visitar os subdiretórios do diretório [./_examples](_examples). Para obter uma documentação técnica mais detalhada, você pode acessar nosso [godocs](https://pkg.go.dev/github.com/kataras/iris/v12@main). E para executar o código você sempre pode visitar os subdiretórios do diretório [./_examples](_examples).
### Você gosta de ler enquanto viaja ? ### Você gosta de ler enquanto viaja ?

View File

@ -1,6 +1,6 @@
# Iris Web Framework # Iris Web Framework
[![build status](https://img.shields.io/github/actions/workflow/status/kataras/iris/ci.yml?branch=master&style=for-the-badge)](https://github.com/kataras/iris/actions/workflows/ci.yml) [![FOSSA Status](https://img.shields.io/badge/LICENSE%20SCAN-PASSING❤-CD2956?style=for-the-badge&logo=fossa)](https://app.fossa.io/projects/git%2Bgithub.com%2Fkataras%2Firis?ref=badge_shield)<!--[![report card](https://img.shields.io/badge/report%20card-a%2B-ff3333.svg?style=for-the-badge)](https://goreportcard.com/report/github.com/kataras/iris)--><!--[![godocs](https://img.shields.io/badge/go-%20docs-488AC7.svg?style=for-the-badge)](https://pkg.go.dev/github.com/kataras/iris/v12@v12.2.0)--> [![view examples](https://img.shields.io/badge/learn%20by-examples-0C8EC5.svg?style=for-the-badge&logo=go)](https://github.com/kataras/iris/tree/master/_examples) [![chat](https://img.shields.io/gitter/room/iris_go/community.svg?color=7E18DD&logo=gitter&style=for-the-badge)](https://gitter.im/iris_go/community)<!--[![donate on PayPal](https://img.shields.io/badge/support-PayPal-blue.svg?style=for-the-badge)](https://iris-go.com/donate)--><!-- [![release](https://img.shields.io/badge/release%20-v12.0-0077b3.svg?style=for-the-badge)](https://github.com/kataras/iris/releases) --> [![build status](https://img.shields.io/github/actions/workflow/status/kataras/iris/ci.yml?branch=main&style=for-the-badge)](https://github.com/kataras/iris/actions/workflows/ci.yml) [![FOSSA Status](https://img.shields.io/badge/LICENSE%20SCAN-PASSING❤-CD2956?style=for-the-badge&logo=fossa)](https://app.fossa.io/projects/git%2Bgithub.com%2Fkataras%2Firis?ref=badge_shield)<!--[![report card](https://img.shields.io/badge/report%20card-a%2B-ff3333.svg?style=for-the-badge)](https://goreportcard.com/report/github.com/kataras/iris)--><!--[![godocs](https://img.shields.io/badge/go-%20docs-488AC7.svg?style=for-the-badge)](https://pkg.go.dev/github.com/kataras/iris/v12@v12.2.0)--> [![view examples](https://img.shields.io/badge/learn%20by-examples-0C8EC5.svg?style=for-the-badge&logo=go)](https://github.com/kataras/iris/tree/main/_examples) [![chat](https://img.shields.io/gitter/room/iris_go/community.svg?color=7E18DD&logo=gitter&style=for-the-badge)](https://gitter.im/iris_go/community)<!--[![donate on PayPal](https://img.shields.io/badge/support-PayPal-blue.svg?style=for-the-badge)](https://iris-go.com/donate)--><!-- [![release](https://img.shields.io/badge/release%20-v12.0-0077b3.svg?style=for-the-badge)](https://github.com/kataras/iris/releases) -->
Iris — это быстрый, простой, но полнофункциональный и эффективный веб-фреймворк для Go. Он обеспечивает красивую, выразительную и простую в использовании основу для вашего следующего веб-сайта или API. Iris — это быстрый, простой, но полнофункциональный и эффективный веб-фреймворк для Go. Он обеспечивает красивую, выразительную и простую в использовании основу для вашего следующего веб-сайта или API.
Узнайте, что [говорят другие люди об Iris](https://iris-go.com/testimonials/) и поставьте **[звёздочку](https://github.com/kataras/iris/stargazers)** этому проекту с открытым исходным кодом, чтобы поддержать его потенциал. Узнайте, что [говорят другие люди об Iris](https://iris-go.com/testimonials/) и поставьте **[звёздочку](https://github.com/kataras/iris/stargazers)** этому проекту с открытым исходным кодом, чтобы поддержать его потенциал.

View File

@ -6,7 +6,7 @@ Try the official [Iris Command Line Interface](https://github.com/kataras/iris-c
# <a href="https://iris-go.com"><img src="https://iris-go.com/images/logo-new-lq-45.png"></a> Iris Web Framework <a href="README_GR.md"><img width="20px" src="https://iris-go.com/images/flag-greece.svg" /></a> <a href="README_FR.md"><img width="20px" src="https://iris-go.com/images/flag-france.svg" /></a> <a href="README_ZH_HANT.md"><img width="20px" src="https://iris-go.com/images/flag-taiwan.svg" /></a> <a href="README_ZH_HANS.md"><img width="20px" src="https://iris-go.com/images/flag-china.svg" /></a> <a href="README_ES.md"><img width="20px" src="https://iris-go.com/images/flag-spain.png" /></a> <a href="README_FA.md"><img width="20px" src="https://iris-go.com/images/flag-iran.svg" /></a> <a href="README_RU.md"><img width="20px" src="https://iris-go.com/images/flag-russia.svg" /></a> <a href="README_KO.md"><img width="20px" src="https://iris-go.com/images/flag-south-korea.svg?v=12" /></a> <a href="README_PT_BR.md"><img width="20px" height="20px" src="https://iris-go.com/images/flag-brazil.svg" /></a> # <a href="https://iris-go.com"><img src="https://iris-go.com/images/logo-new-lq-45.png"></a> Iris Web Framework <a href="README_GR.md"><img width="20px" src="https://iris-go.com/images/flag-greece.svg" /></a> <a href="README_FR.md"><img width="20px" src="https://iris-go.com/images/flag-france.svg" /></a> <a href="README_ZH_HANT.md"><img width="20px" src="https://iris-go.com/images/flag-taiwan.svg" /></a> <a href="README_ZH_HANS.md"><img width="20px" src="https://iris-go.com/images/flag-china.svg" /></a> <a href="README_ES.md"><img width="20px" src="https://iris-go.com/images/flag-spain.png" /></a> <a href="README_FA.md"><img width="20px" src="https://iris-go.com/images/flag-iran.svg" /></a> <a href="README_RU.md"><img width="20px" src="https://iris-go.com/images/flag-russia.svg" /></a> <a href="README_KO.md"><img width="20px" src="https://iris-go.com/images/flag-south-korea.svg?v=12" /></a> <a href="README_PT_BR.md"><img width="20px" height="20px" src="https://iris-go.com/images/flag-brazil.svg" /></a>
[![build status](https://img.shields.io/github/actions/workflow/status/kataras/iris/ci.yml?branch=master&style=for-the-badge)](https://github.com/kataras/iris/actions/workflows/ci.yml) [![view examples](https://img.shields.io/badge/examples%20-285-a83adf.svg?style=for-the-badge&logo=go)](https://github.com/kataras/iris/tree/master/_examples) [![chat](https://img.shields.io/gitter/room/iris_go/community.svg?color=cc2b5e&logo=gitter&style=for-the-badge)](https://gitter.im/iris_go/community) <!--[![FOSSA Status](https://img.shields.io/badge/LICENSE%20SCAN-PASSING❤-CD2956?style=for-the-badge&logo=fossa)](https://app.fossa.io/projects/git%2Bgithub.com%2Fkataras%2Firis?ref=badge_shield)--> [![donate](https://img.shields.io/badge/support-Iris-blue.svg?style=for-the-badge&logo=paypal)](https://iris-go.com/donate) <!--[![report card](https://img.shields.io/badge/report%20card-a%2B-ff3333.svg?style=for-the-badge)](https://goreportcard.com/report/github.com/kataras/iris)--><!--[![godocs](https://img.shields.io/badge/go-%20docs-488AC7.svg?style=for-the-badge)](https://pkg.go.dev/github.com/kataras/iris/v12@v12.2.0)--> <!-- [![release](https://img.shields.io/badge/release%20-v12.0-0077b3.svg?style=for-the-badge)](https://github.com/kataras/iris/releases) --> [![build status](https://img.shields.io/github/actions/workflow/status/kataras/iris/ci.yml?branch=main&style=for-the-badge)](https://github.com/kataras/iris/actions/workflows/ci.yml) [![view examples](https://img.shields.io/badge/examples%20-285-a83adf.svg?style=for-the-badge&logo=go)](https://github.com/kataras/iris/tree/main/_examples) [![chat](https://img.shields.io/gitter/room/iris_go/community.svg?color=cc2b5e&logo=gitter&style=for-the-badge)](https://gitter.im/iris_go/community) <!--[![FOSSA Status](https://img.shields.io/badge/LICENSE%20SCAN-PASSING❤-CD2956?style=for-the-badge&logo=fossa)](https://app.fossa.io/projects/git%2Bgithub.com%2Fkataras%2Firis?ref=badge_shield)--> [![donate](https://img.shields.io/badge/support-Iris-blue.svg?style=for-the-badge&logo=paypal)](https://iris-go.com/donate) <!--[![report card](https://img.shields.io/badge/report%20card-a%2B-ff3333.svg?style=for-the-badge)](https://goreportcard.com/report/github.com/kataras/iris)--><!--[![godocs](https://img.shields.io/badge/go-%20docs-488AC7.svg?style=for-the-badge)](https://pkg.go.dev/github.com/kataras/iris/v12@v12.2.0)--> <!-- [![release](https://img.shields.io/badge/release%20-v12.0-0077b3.svg?style=for-the-badge)](https://github.com/kataras/iris/releases) -->
Iris là một khung web nhanh, đơn giản nhưng đầy đủ tính năng và rất hiệu quả dành cho Go. Iris là một khung web nhanh, đơn giản nhưng đầy đủ tính năng và rất hiệu quả dành cho Go.
@ -78,21 +78,21 @@ func updateUser(ctx iris.Context) {
} }
``` ```
> Read the [routing examples](https://github.com/kataras/iris/blob/master/_examples/routing) for more! > Read the [routing examples](https://github.com/kataras/iris/blob/main/_examples/routing) for more!
</details> </details>
<details><summary>Handler with custom input and output arguments</summary> <details><summary>Handler with custom input and output arguments</summary>
[![https://github.com/kataras/iris/blob/master/_examples/dependency-injection/basic/main.go](https://user-images.githubusercontent.com/22900943/105253731-b8db6d00-5b88-11eb-90c1-0c92a5581c86.png)](https://twitter.com/iris_framework/status/1234783655408668672) [![https://github.com/kataras/iris/blob/main/_examples/dependency-injection/basic/main.go](https://user-images.githubusercontent.com/22900943/105253731-b8db6d00-5b88-11eb-90c1-0c92a5581c86.png)](https://twitter.com/iris_framework/status/1234783655408668672)
> Interesting? Read the [examples](https://github.com/kataras/iris/blob/master/_examples/dependency-injection). > Interesting? Read the [examples](https://github.com/kataras/iris/blob/main/_examples/dependency-injection).
</details> </details>
<details><summary>Party Controller (NEW)</summary> <details><summary>Party Controller (NEW)</summary>
> Head over to the [full running example](https://github.com/kataras/iris/blob/master/_examples/routing/party-controller)! > Head over to the [full running example](https://github.com/kataras/iris/blob/main/_examples/routing/party-controller)!
</details> </details>
@ -571,7 +571,7 @@ Iris chứa **[tài liệu](https://www.iris-go.com/docs)** phong phú và kỹ
<!-- ![](https://media.giphy.com/media/Ur8iqy9FQfmPuyQpgy/giphy.gif) --> <!-- ![](https://media.giphy.com/media/Ur8iqy9FQfmPuyQpgy/giphy.gif) -->
Để có tài liệu kỹ thuật chi tiết hơn, bạn có thể truy cập [godocs](https://pkg.go.dev/github.com/kataras/iris/v12@master) của chúng tôi. Và đối với mã thực thi, bạn luôn có thể truy cập thư mục con của kho lưu trữ [./_examples](_examples). Để có tài liệu kỹ thuật chi tiết hơn, bạn có thể truy cập [godocs](https://pkg.go.dev/github.com/kataras/iris/v12@main) của chúng tôi. Và đối với mã thực thi, bạn luôn có thể truy cập thư mục con của kho lưu trữ [./_examples](_examples).
### Bạn có thích đọc khi đi du lịch không? ### Bạn có thích đọc khi đi du lịch không?

View File

@ -10,7 +10,7 @@
# Iris Web Framework <a href="README_GR.md"><img width="20px" src="https://iris-go.com/images/flag-greece.svg" /></a> <a href="README_FR.md"><img width="20px" src="https://iris-go.com/images/flag-france.svg" /></a> <a href="README_ZH.md"><img width="20px" src="https://iris-go.com/images/flag-china.svg" /></a> <a href="README_ES.md"><img width="20px" src="https://iris-go.com/images/flag-spain.png" /></a> <a href="README_FA.md"><img width="20px" src="https://iris-go.com/images/flag-iran.svg" /></a> <a href="README_RU.md"><img width="20px" src="https://iris-go.com/images/flag-russia.svg" /></a> <a href="README_KO.md"><img width="20px" src="https://iris-go.com/images/flag-south-korea.svg?v=12" /></a> <a href="README_JA.md"><img width="20px" height="20px" src="https://iris-go.com/images/flag-japan.svg" /></a> # Iris Web Framework <a href="README_GR.md"><img width="20px" src="https://iris-go.com/images/flag-greece.svg" /></a> <a href="README_FR.md"><img width="20px" src="https://iris-go.com/images/flag-france.svg" /></a> <a href="README_ZH.md"><img width="20px" src="https://iris-go.com/images/flag-china.svg" /></a> <a href="README_ES.md"><img width="20px" src="https://iris-go.com/images/flag-spain.png" /></a> <a href="README_FA.md"><img width="20px" src="https://iris-go.com/images/flag-iran.svg" /></a> <a href="README_RU.md"><img width="20px" src="https://iris-go.com/images/flag-russia.svg" /></a> <a href="README_KO.md"><img width="20px" src="https://iris-go.com/images/flag-south-korea.svg?v=12" /></a> <a href="README_JA.md"><img width="20px" height="20px" src="https://iris-go.com/images/flag-japan.svg" /></a>
[![build status](https://img.shields.io/github/actions/workflow/status/kataras/iris/ci.yml?branch=master&style=for-the-badge)](https://github.com/kataras/iris/actions/workflows/ci.yml) [![view examples](https://img.shields.io/badge/examples%20-253-a83adf.svg?style=for-the-badge&logo=go)](https://github.com/kataras/iris/tree/master/_examples) [![chat](https://img.shields.io/gitter/room/iris_go/community.svg?color=cc2b5e&logo=gitter&style=for-the-badge)](https://gitter.im/iris_go/community) <!--[![FOSSA Status](https://img.shields.io/badge/LICENSE%20SCAN-PASSING❤-CD2956?style=for-the-badge&logo=fossa)](https://app.fossa.io/projects/git%2Bgithub.com%2Fkataras%2Firis?ref=badge_shield)--> [![donate](https://img.shields.io/badge/support-Iris-blue.svg?style=for-the-badge&logo=paypal)](https://iris-go.com/donate) <!--[![report card](https://img.shields.io/badge/report%20card-a%2B-ff3333.svg?style=for-the-badge)](https://goreportcard.com/report/github.com/kataras/iris)--><!--[![godocs](https://img.shields.io/badge/go-%20docs-488AC7.svg?style=for-the-badge)](https://pkg.go.dev/github.com/kataras/iris/v12@v12.2.0)--> <!-- [![release](https://img.shields.io/badge/release%20-v12.0-0077b3.svg?style=for-the-badge)](https://github.com/kataras/iris/releases) --> [![build status](https://img.shields.io/github/actions/workflow/status/kataras/iris/ci.yml?branch=main&style=for-the-badge)](https://github.com/kataras/iris/actions/workflows/ci.yml) [![view examples](https://img.shields.io/badge/examples%20-253-a83adf.svg?style=for-the-badge&logo=go)](https://github.com/kataras/iris/tree/main/_examples) [![chat](https://img.shields.io/gitter/room/iris_go/community.svg?color=cc2b5e&logo=gitter&style=for-the-badge)](https://gitter.im/iris_go/community) <!--[![FOSSA Status](https://img.shields.io/badge/LICENSE%20SCAN-PASSING❤-CD2956?style=for-the-badge&logo=fossa)](https://app.fossa.io/projects/git%2Bgithub.com%2Fkataras%2Firis?ref=badge_shield)--> [![donate](https://img.shields.io/badge/support-Iris-blue.svg?style=for-the-badge&logo=paypal)](https://iris-go.com/donate) <!--[![report card](https://img.shields.io/badge/report%20card-a%2B-ff3333.svg?style=for-the-badge)](https://goreportcard.com/report/github.com/kataras/iris)--><!--[![godocs](https://img.shields.io/badge/go-%20docs-488AC7.svg?style=for-the-badge)](https://pkg.go.dev/github.com/kataras/iris/v12@v12.2.0)--> <!-- [![release](https://img.shields.io/badge/release%20-v12.0-0077b3.svg?style=for-the-badge)](https://github.com/kataras/iris/releases) -->
<!-- <a href="https://iris-go.com"> <img align="right" src="https://iris-go.com/images/logo-w169.png"></a> --> <!-- <a href="https://iris-go.com"> <img align="right" src="https://iris-go.com/images/logo-w169.png"></a> -->
@ -185,7 +185,7 @@ Iris 有完整且详尽的 **[使用文档](https://www.iris-go.com/#ebookDonate
<!-- ![](https://media.giphy.com/media/Ur8iqy9FQfmPuyQpgy/giphy.gif) --> <!-- ![](https://media.giphy.com/media/Ur8iqy9FQfmPuyQpgy/giphy.gif) -->
要了解更详细的技术文档,请访问我们的 [godocs](https://pkg.go.dev/github.com/kataras/iris/v12@master)。如果想要寻找代码示例,您可以到仓库的 [./_examples](_examples) 子目录下获取。 要了解更详细的技术文档,请访问我们的 [godocs](https://pkg.go.dev/github.com/kataras/iris/v12@main)。如果想要寻找代码示例,您可以到仓库的 [./_examples](_examples) 子目录下获取。
### 你喜欢在旅行时阅读吗? ### 你喜欢在旅行时阅读吗?

View File

@ -12,7 +12,7 @@
# Iris Web 框架 <a href="README_GR.md"><img width="20px" src="https://iris-go.com/images/flag-greece.svg" /></a> <a href="README_FR.md"><img width="20px" src="https://iris-go.com/images/flag-france.svg" /></a> <a href="README_ZH.md"><img width="20px" src="https://iris-go.com/images/flag-china.svg" /></a> <a href="README_ES.md"><img width="20px" src="https://iris-go.com/images/flag-spain.png" /></a> <a href="README_FA.md"><img width="20px" src="https://iris-go.com/images/flag-iran.svg" /></a> <a href="README_RU.md"><img width="20px" src="https://iris-go.com/images/flag-russia.svg" /></a> <a href="README_KO.md"><img width="20px" src="https://iris-go.com/images/flag-south-korea.svg?v=12" /></a> <a href="README_PT_BR.md"><img width="20px" height="20px" src="https://iris-go.com/images/flag-brazil.svg" /></a> <a href="README_JA.md"><img width="20px" height="20px" src="https://iris-go.com/images/flag-japan.svg" /></a> # Iris Web 框架 <a href="README_GR.md"><img width="20px" src="https://iris-go.com/images/flag-greece.svg" /></a> <a href="README_FR.md"><img width="20px" src="https://iris-go.com/images/flag-france.svg" /></a> <a href="README_ZH.md"><img width="20px" src="https://iris-go.com/images/flag-china.svg" /></a> <a href="README_ES.md"><img width="20px" src="https://iris-go.com/images/flag-spain.png" /></a> <a href="README_FA.md"><img width="20px" src="https://iris-go.com/images/flag-iran.svg" /></a> <a href="README_RU.md"><img width="20px" src="https://iris-go.com/images/flag-russia.svg" /></a> <a href="README_KO.md"><img width="20px" src="https://iris-go.com/images/flag-south-korea.svg?v=12" /></a> <a href="README_PT_BR.md"><img width="20px" height="20px" src="https://iris-go.com/images/flag-brazil.svg" /></a> <a href="README_JA.md"><img width="20px" height="20px" src="https://iris-go.com/images/flag-japan.svg" /></a>
[![組建狀態](https://img.shields.io/github/actions/workflow/status/kataras/iris/ci.yml?branch=master&style=for-the-badge)](https://github.com/kataras/iris/actions/workflows/ci.yml) [![查看範例](https://img.shields.io/badge/examples%20-285-a83adf.svg?style=for-the-badge&logo=go)](https://github.com/kataras/iris/tree/master/_examples) [![聊天室](https://img.shields.io/gitter/room/iris_go/community.svg?color=cc2b5e&logo=gitter&style=for-the-badge)](https://gitter.im/iris_go/community) <!--[![FOSSA Status](https://img.shields.io/badge/LICENSE%20SCAN-PASSING❤-CD2956?style=for-the-badge&logo=fossa)](https://app.fossa.io/projects/git%2Bgithub.com%2Fkataras%2Firis?ref=badge_shield)--> [![捐助](https://img.shields.io/badge/support-Iris-blue.svg?style=for-the-badge&logo=paypal)](https://iris-go.com/donate) <!--[![report card](https://img.shields.io/badge/report%20card-a%2B-ff3333.svg?style=for-the-badge)](https://goreportcard.com/report/github.com/kataras/iris)--><!--[![godocs](https://img.shields.io/badge/go-%20docs-488AC7.svg?style=for-the-badge)](https://pkg.go.dev/github.com/kataras/iris/v12@v12.2.0)--> <!-- [![release](https://img.shields.io/badge/release%20-v12.0-0077b3.svg?style=for-the-badge)](https://github.com/kataras/iris/releases) --> [![組建狀態](https://img.shields.io/github/actions/workflow/status/kataras/iris/ci.yml?branch=main&style=for-the-badge)](https://github.com/kataras/iris/actions/workflows/ci.yml) [![查看範例](https://img.shields.io/badge/examples%20-285-a83adf.svg?style=for-the-badge&logo=go)](https://github.com/kataras/iris/tree/main/_examples) [![聊天室](https://img.shields.io/gitter/room/iris_go/community.svg?color=cc2b5e&logo=gitter&style=for-the-badge)](https://gitter.im/iris_go/community) <!--[![FOSSA Status](https://img.shields.io/badge/LICENSE%20SCAN-PASSING❤-CD2956?style=for-the-badge&logo=fossa)](https://app.fossa.io/projects/git%2Bgithub.com%2Fkataras%2Firis?ref=badge_shield)--> [![捐助](https://img.shields.io/badge/support-Iris-blue.svg?style=for-the-badge&logo=paypal)](https://iris-go.com/donate) <!--[![report card](https://img.shields.io/badge/report%20card-a%2B-ff3333.svg?style=for-the-badge)](https://goreportcard.com/report/github.com/kataras/iris)--><!--[![godocs](https://img.shields.io/badge/go-%20docs-488AC7.svg?style=for-the-badge)](https://pkg.go.dev/github.com/kataras/iris/v12@v12.2.0)--> <!-- [![release](https://img.shields.io/badge/release%20-v12.0-0077b3.svg?style=for-the-badge)](https://github.com/kataras/iris/releases) -->
<!-- <a href="https://iris-go.com"> <img align="right" src="https://iris-go.com/images/logo-w169.png"></a> --> <!-- <a href="https://iris-go.com"> <img align="right" src="https://iris-go.com/images/logo-w169.png"></a> -->
@ -81,21 +81,21 @@ func updateUser(ctx iris.Context) {
} }
``` ```
> Read the [routing examples](https://github.com/kataras/iris/blob/master/_examples/routing) for more! > Read the [routing examples](https://github.com/kataras/iris/blob/main/_examples/routing) for more!
</details> </details>
<details><summary>Handler with custom input and output arguments</summary> <details><summary>Handler with custom input and output arguments</summary>
[![https://github.com/kataras/iris/blob/master/_examples/dependency-injection/basic/main.go](https://user-images.githubusercontent.com/22900943/105253731-b8db6d00-5b88-11eb-90c1-0c92a5581c86.png)](https://twitter.com/iris_framework/status/1234783655408668672) [![https://github.com/kataras/iris/blob/main/_examples/dependency-injection/basic/main.go](https://user-images.githubusercontent.com/22900943/105253731-b8db6d00-5b88-11eb-90c1-0c92a5581c86.png)](https://twitter.com/iris_framework/status/1234783655408668672)
> Interesting? Read the [examples](https://github.com/kataras/iris/blob/master/_examples/dependency-injection). > Interesting? Read the [examples](https://github.com/kataras/iris/blob/main/_examples/dependency-injection).
</details> </details>
<details><summary>Party Controller (NEW)</summary> <details><summary>Party Controller (NEW)</summary>
> Head over to the [full running example](https://github.com/kataras/iris/blob/master/_examples/routing/party-controller)! > Head over to the [full running example](https://github.com/kataras/iris/blob/main/_examples/routing/party-controller)!
</details> </details>
@ -526,7 +526,7 @@ Iris 包含極其豐富且透徹的 **[文件](https://www.iris-go.com/docs)**
<!-- ![](https://media.giphy.com/media/Ur8iqy9FQfmPuyQpgy/giphy.gif) --> <!-- ![](https://media.giphy.com/media/Ur8iqy9FQfmPuyQpgy/giphy.gif) -->
如需更為詳細的技術性文件,您可以前往我們的 [godocs](https://pkg.go.dev/github.com/kataras/iris/v12@master)。如果要可以直接執行的程式碼,可以到 [./\_examples](_examples) 儲存庫的子目錄參閱。 如需更為詳細的技術性文件,您可以前往我們的 [godocs](https://pkg.go.dev/github.com/kataras/iris/v12@main)。如果要可以直接執行的程式碼,可以到 [./\_examples](_examples) 儲存庫的子目錄參閱。
### 想一邊旅行、一邊閱讀嗎? ### 想一邊旅行、一邊閱讀嗎?

View File

@ -3,7 +3,7 @@
## Supported Versions ## Supported Versions
We are focusing on fixing issues and security vulnerabilities to the latest and greatest version of Iris. We are focusing on fixing issues and security vulnerabilities to the latest and greatest version of Iris.
Iris users SHOULD always update their backend code to the latest version of Iris API, there is a complete [HISTORY](https://github.com/kataras/iris/blob/master/HISTORY.md) file Iris users SHOULD always update their backend code to the latest version of Iris API, there is a complete [HISTORY](https://github.com/kataras/iris/blob/main/HISTORY.md) file
which acts as a code migration assistant. which acts as a code migration assistant.
## Reporting a Vulnerability ## Reporting a Vulnerability

View File

@ -90,7 +90,7 @@
* [Redirection](routing/subdomains/redirect/main.go) * [Redirection](routing/subdomains/redirect/main.go)
* [Multi Instances](routing/subdomains/redirect/multi-instances/main.go) * [Multi Instances](routing/subdomains/redirect/multi-instances/main.go)
* [HTTP Errors View](routing/subdomains/http-errors-view/main.go) * [HTTP Errors View](routing/subdomains/http-errors-view/main.go)
* [HTTP Method Override](https://github.com/kataras/iris/blob/master/middleware/methodoverride/methodoverride_test.go) * [HTTP Method Override](https://github.com/kataras/iris/blob/main/middleware/methodoverride/methodoverride_test.go)
* [API Versioning](routing/versioning/main.go) * [API Versioning](routing/versioning/main.go)
* [Sitemap](routing/sitemap/main.go) * [Sitemap](routing/sitemap/main.go)
* Logging * Logging
@ -175,7 +175,7 @@
* Third-Parties * Third-Parties
* [Render `valyala/quicktemplate` templates](view/quicktemplate) * [Render `valyala/quicktemplate` templates](view/quicktemplate)
* [Render `shiyanhui/hero` templates](view/herotemplate) * [Render `shiyanhui/hero` templates](view/herotemplate)
* [Request ID](https://github.com/kataras/iris/blob/master/middleware/requestid/requestid_test.go) * [Request ID](https://github.com/kataras/iris/blob/main/middleware/requestid/requestid_test.go)
* [Request Rate Limit](request-ratelimit/main.go) * [Request Rate Limit](request-ratelimit/main.go)
* [Request Referrer](request-referrer/main.go) * [Request Referrer](request-referrer/main.go)
* [Webassembly](webassembly/main.go) * [Webassembly](webassembly/main.go)

View File

@ -88,7 +88,7 @@
- [Redirection](routing/subdomains/redirect/main.go) - [Redirection](routing/subdomains/redirect/main.go)
- [Multi Instances](routing/subdomains/redirect/multi-instances/main.go) - [Multi Instances](routing/subdomains/redirect/multi-instances/main.go)
- [HTTP Errors View](routing/subdomains/http-errors-view/main.go) - [HTTP Errors View](routing/subdomains/http-errors-view/main.go)
- [HTTP Method Override](https://github.com/kataras/iris/blob/master/middleware/methodoverride/methodoverride_test.go) - [HTTP Method Override](https://github.com/kataras/iris/blob/main/middleware/methodoverride/methodoverride_test.go)
- [API Versioning](routing/versioning/main.go) - [API Versioning](routing/versioning/main.go)
- [Sitemap](routing/sitemap/main.go) - [Sitemap](routing/sitemap/main.go)
- 日誌 - 日誌
@ -173,7 +173,7 @@
- 第三方引擎 - 第三方引擎
- [Render `valyala/quicktemplate` templates](view/quicktemplate) - [Render `valyala/quicktemplate` templates](view/quicktemplate)
- [Render `shiyanhui/hero` templates](view/herotemplate) - [Render `shiyanhui/hero` templates](view/herotemplate)
- [請求 ID](https://github.com/kataras/iris/blob/master/middleware/requestid/requestid_test.go) - [請求 ID](https://github.com/kataras/iris/blob/main/middleware/requestid/requestid_test.go)
- [請求速率限制](request-ratelimit/main.go) - [請求速率限制](request-ratelimit/main.go)
- [請求 Referrer](request-referrer/main.go) - [請求 Referrer](request-referrer/main.go)
- [Webassembly](webassembly/main.go) - [Webassembly](webassembly/main.go)

View File

@ -23,7 +23,7 @@ func main() {
}) })
// Example for WrapRouter is already here: // Example for WrapRouter is already here:
// https://github.com/kataras/iris/blob/master/_examples/routing/custom-wrapper/main.go#L53 // https://github.com/kataras/iris/blob/main/_examples/routing/custom-wrapper/main.go#L53
app.WrapRouter(func(w http.ResponseWriter, r *http.Request, irisRouter http.HandlerFunc) { app.WrapRouter(func(w http.ResponseWriter, r *http.Request, irisRouter http.HandlerFunc) {
// Exactly the same source code: // Exactly the same source code:
// https://github.com/getsentry/raven-go/blob/379f8d0a68ca237cf8893a1cdfd4f574125e2c51/http.go#L70 // https://github.com/getsentry/raven-go/blob/379f8d0a68ca237cf8893a1cdfd4f574125e2c51/http.go#L70

View File

@ -37,7 +37,7 @@ func parse() {
// After `Load` the callers can get an environment variable via `os.Getenv`. // After `Load` the callers can get an environment variable via `os.Getenv`.
func Load(envFileName string) { func Load(envFileName string) {
if args := os.Args; len(args) > 1 && args[1] == "help" { if args := os.Args; len(args) > 1 && args[1] == "help" {
fmt.Fprintln(os.Stderr, "https://github.com/kataras/iris/blob/master/_examples/database/mongodb/README.md") fmt.Fprintln(os.Stderr, "https://github.com/kataras/iris/blob/main/_examples/database/mongodb/README.md")
os.Exit(-1) os.Exit(-1)
} }

View File

@ -305,7 +305,7 @@ If you have done it successfully. Now go and upload some images and reload the u
- http://www.dropzonejs.com/#server-side-implementation - http://www.dropzonejs.com/#server-side-implementation
- https://www.startutorial.com/articles/view/how-to-build-a-file-upload-form-using-dropzonejs-and-php - https://www.startutorial.com/articles/view/how-to-build-a-file-upload-form-using-dropzonejs-and-php
- https://docs.iris-go.com - https://docs.iris-go.com
- https://github.com/kataras/iris/tree/master/_examples/dropzonejs - https://github.com/kataras/iris/tree/main/_examples/dropzonejs
## The end ## The end

View File

@ -10,7 +10,7 @@ import (
) )
// This example is equivalent to the // This example is equivalent to the
// https://github.com/kataras/iris/blob/master/_examples/hello-world/main.go // https://github.com/kataras/iris/blob/main/_examples/hello-world/main.go
// //
// It seems that additional code you // It seems that additional code you
// have to write doesn't worth it // have to write doesn't worth it

View File

@ -27,7 +27,7 @@ Navigate to that `app` folder and execute the following command:
```sh ```sh
$ go init app $ go init app
$ go get github.com/kataras/iris/v12@master $ go get github.com/kataras/iris/v12@main
# or @latest for the latest official release. # or @latest for the latest official release.
``` ```
@ -136,7 +136,7 @@ func (db *sqlite) Exec(q string) error { return nil }
The `DB` depends on the `Environment. The `DB` depends on the `Environment.
> A practical and operational database example, including Docker images, can be found at the following guide: https://github.com/kataras/iris/tree/master/_examples/database/mysql > A practical and operational database example, including Docker images, can be found at the following guide: https://github.com/kataras/iris/tree/main/_examples/database/mysql
## Service ## Service

View File

@ -4,7 +4,7 @@ package main
/* /*
There is no MVC naming pattern for such these things,you can imagine the limitations of that. There is no MVC naming pattern for such these things,you can imagine the limitations of that.
Instead you can use the `BeforeActivation` on your controller to add more advanced routing features Instead you can use the `BeforeActivation` on your controller to add more advanced routing features
(https://github.com/kataras/iris/tree/master/_examples/routing). (https://github.com/kataras/iris/tree/main/_examples/routing).
You can also create your own macro, You can also create your own macro,
i.e: /{file:json} or macro function of a specific parameter type i.e: (/{file:string json()}). i.e: /{file:json} or macro function of a specific parameter type i.e: (/{file:string json()}).

View File

@ -575,13 +575,13 @@ Open one or more browser tabs at: http://localhost:8080 and have fun!
### Download the Source Code ### Download the Source Code
The whole project, all the files you saw in this article are located at: https://github.com/kataras/iris/tree/master/_examples/mvc/vuejs-todo-mvc The whole project, all the files you saw in this article are located at: https://github.com/kataras/iris/tree/main/_examples/mvc/vuejs-todo-mvc
## References ## References
https://vuejs.org/v2/examples/todomvc.html (using browser's local storage) https://vuejs.org/v2/examples/todomvc.html (using browser's local storage)
https://github.com/kataras/iris/tree/master/_examples/mvc (mvc examples and features overview repository) https://github.com/kataras/iris/tree/main/_examples/mvc (mvc examples and features overview repository)
## Thank you, once again ## Thank you, once again

View File

@ -93,6 +93,6 @@ func customIndexPost(ctx iris.Context) {
/* Note that `HandleDir` does use the browser's disk caching by-default /* Note that `HandleDir` does use the browser's disk caching by-default
therefore, register the cache handler AFTER any HandleDir calls, therefore, register the cache handler AFTER any HandleDir calls,
for a faster solution that server doesn't need to keep track of the response for a faster solution that server doesn't need to keep track of the response
navigate to https://github.com/kataras/iris/blob/master/_examples/cache/client-side/main.go. navigate to https://github.com/kataras/iris/blob/main/_examples/cache/client-side/main.go.
The `HandleDir` has its own cache mechanism, read the 'file-server' examples. */ The `HandleDir` has its own cache mechanism, read the 'file-server' examples. */

View File

@ -35,7 +35,7 @@ func main() {
app.SetContextErrorHandler(new(errorHandler)) app.SetContextErrorHandler(new(errorHandler))
// Read // Read
app.Post("/decode", func(ctx iris.Context) { app.Post("/decode", func(ctx iris.Context) {
// Read https://github.com/kataras/iris/blob/master/_examples/request-body/read-json/main.go as well. // Read https://github.com/kataras/iris/blob/main/_examples/request-body/read-json/main.go as well.
var user User var user User
err := ctx.ReadJSON(&user) err := ctx.ReadJSON(&user)
if err != nil { if err != nil {

View File

@ -19,7 +19,7 @@ import (
For a more detailed, complete and useful example For a more detailed, complete and useful example
you can take a look at the iris' router itself which is located at: you can take a look at the iris' router itself which is located at:
https://github.com/kataras/iris/tree/master/core/router/handler.go https://github.com/kataras/iris/tree/main/core/router/handler.go
which completes this exact interface, the `router#RequestHandler`. which completes this exact interface, the `router#RequestHandler`.
*/ */
type customRouter struct { type customRouter struct {

View File

@ -2,7 +2,7 @@
[WebSocket](https://wikipedia.org/wiki/WebSocket) is a protocol that enables two-way persistent communication channels over TCP connections. It is used for applications such as chat, stock tickers, games, anywhere you want real-time functionality in a web application. [WebSocket](https://wikipedia.org/wiki/WebSocket) is a protocol that enables two-way persistent communication channels over TCP connections. It is used for applications such as chat, stock tickers, games, anywhere you want real-time functionality in a web application.
Iris websocket library is now merged with the [neffos real-time framework](https://github.com/kataras/neffos) and Iris-specific helpers and type aliases live on the [iris/websocket](https://github.com/kataras/iris/tree/master/websocket) subpackage. Learn neffos from its [wiki](https://github.com/kataras/neffos#learning-neffos). Iris websocket library is now merged with the [neffos real-time framework](https://github.com/kataras/neffos) and Iris-specific helpers and type aliases live on the [iris/websocket](https://github.com/kataras/iris/tree/main/websocket) subpackage. Learn neffos from its [wiki](https://github.com/kataras/neffos#learning-neffos).
Helpers and type aliases improves your code speed when writing a websocket module. Helpers and type aliases improves your code speed when writing a websocket module.
For example, instead of importing both `kataras/iris/websocket` - in order to use its `websocket.Handler` - and `github.com/kataras/neffos` - to create a new websocket server `neffos.New` - you can use the `websocket.New` instead, another example is the `neffos.Conn` which can be declared as `websocket.Conn`. For example, instead of importing both `kataras/iris/websocket` - in order to use its `websocket.Handler` - and `github.com/kataras/neffos` - to create a new websocket server `neffos.New` - you can use the `websocket.New` instead, another example is the `neffos.Conn` which can be declared as `websocket.Conn`.

View File

@ -56,7 +56,7 @@ type (
// //
// See 'context#UnmarshalBody` for more. // See 'context#UnmarshalBody` for more.
// //
// Example: https://github.com/kataras/iris/blob/master/_examples/request-body/read-custom-via-unmarshaler/main.go // Example: https://github.com/kataras/iris/blob/main/_examples/request-body/read-custom-via-unmarshaler/main.go
UnmarshalerFunc = context.UnmarshalerFunc UnmarshalerFunc = context.UnmarshalerFunc
// DecodeFunc is a generic type of decoder function. // DecodeFunc is a generic type of decoder function.
// When the returned error is not nil the decode operation // When the returned error is not nil the decode operation
@ -64,7 +64,7 @@ type (
// otherwise it continues to read the next available object. // otherwise it continues to read the next available object.
// Look the `Context.ReadJSONStream` method. // Look the `Context.ReadJSONStream` method.
// //
// Example: https://github.com/kataras/iris/blob/master/_examples/request-body/read-json-stream. // Example: https://github.com/kataras/iris/blob/main/_examples/request-body/read-json-stream.
DecodeFunc = context.DecodeFunc DecodeFunc = context.DecodeFunc
// A Handler responds to an HTTP request. // A Handler responds to an HTTP request.
// It writes reply headers and data to the Context.ResponseWriter() and then return. // It writes reply headers and data to the Context.ResponseWriter() and then return.
@ -99,7 +99,7 @@ type (
// Pass a Problem value to `context.Problem` to // Pass a Problem value to `context.Problem` to
// write an "application/problem+json" response. // write an "application/problem+json" response.
// //
// Read more at: https://github.com/kataras/iris/blob/master/_examples/routing/http-errors. // Read more at: https://github.com/kataras/iris/blob/main/_examples/routing/http-errors.
// //
// It is an alias of the `context#Problem` type. // It is an alias of the `context#Problem` type.
Problem = context.Problem Problem = context.Problem
@ -180,7 +180,7 @@ type (
// }) // })
// //
// See `core/router/Party#SetExecutionRules` for more. // See `core/router/Party#SetExecutionRules` for more.
// Example: https://github.com/kataras/iris/tree/master/_examples/mvc/middleware/without-ctx-next // Example: https://github.com/kataras/iris/tree/main/_examples/mvc/middleware/without-ctx-next
ExecutionRules = router.ExecutionRules ExecutionRules = router.ExecutionRules
// ExecutionOptions is a set of default behaviors that can be changed in order to customize the execution flow of the routes' handlers with ease. // ExecutionOptions is a set of default behaviors that can be changed in order to customize the execution flow of the routes' handlers with ease.
// //
@ -302,7 +302,7 @@ type (
// All view engines have a `RootDir` method for that reason too // All view engines have a `RootDir` method for that reason too
// but alternatively, you can wrap the given file system with this `PrefixDir`. // but alternatively, you can wrap the given file system with this `PrefixDir`.
// //
// Example: https://github.com/kataras/iris/blob/master/_examples/file-server/single-page-application/embedded-single-page-application/main.go // Example: https://github.com/kataras/iris/blob/main/_examples/file-server/single-page-application/embedded-single-page-application/main.go
func PrefixDir(prefix string, fs http.FileSystem) http.FileSystem { func PrefixDir(prefix string, fs http.FileSystem) http.FileSystem {
return &prefixedDir{prefix, fs} return &prefixedDir{prefix, fs}
} }
@ -425,7 +425,7 @@ var (
// The second optional parameter is any optional settings that the caller can use. // The second optional parameter is any optional settings that the caller can use.
// //
// See `Party#HandleDir` too. // See `Party#HandleDir` too.
// Examples can be found at: https://github.com/kataras/iris/tree/master/_examples/file-server // Examples can be found at: https://github.com/kataras/iris/tree/main/_examples/file-server
// A shortcut for the `router.FileServer`. // A shortcut for the `router.FileServer`.
FileServer = router.FileServer FileServer = router.FileServer
// DirList is the default `DirOptions.DirList` field. // DirList is the default `DirOptions.DirList` field.
@ -461,7 +461,7 @@ var (
// It should be used after Static methods. // It should be used after Static methods.
// See `iris#Cache304` for an alternative, faster way. // See `iris#Cache304` for an alternative, faster way.
// //
// Examples can be found at: https://github.com/kataras/iris/tree/master/_examples/#caching // Examples can be found at: https://github.com/kataras/iris/tree/main/_examples/#caching
Cache = cache.Handler Cache = cache.Handler
// NoCache is a middleware which overrides the Cache-Control, Pragma and Expires headers // NoCache is a middleware which overrides the Cache-Control, Pragma and Expires headers
// in order to disable the cache during the browser's back and forward feature. // in order to disable the cache during the browser's back and forward feature.
@ -781,7 +781,7 @@ type GlobalPatches struct {
// //
// See its `Context` method. // See its `Context` method.
// //
// Example: https://github.com/kataras/iris/blob/master/_examples/response-writer/json-third-party/main.go // Example: https://github.com/kataras/iris/blob/main/_examples/response-writer/json-third-party/main.go
func Patches() *GlobalPatches { // singleton. func Patches() *GlobalPatches { // singleton.
return globalPatches return globalPatches
} }

View File

@ -2,7 +2,7 @@
Package `github.com/kataras/iris/v12/apps` provides a globally scoped control over all registered Iris Applications of the same Program. Package `github.com/kataras/iris/v12/apps` provides a globally scoped control over all registered Iris Applications of the same Program.
[Example Application](https://github.com/kataras/iris/tree/master/_examples/routing/subdomains/redirect/multi-instances) [Example Application](https://github.com/kataras/iris/tree/main/_examples/routing/subdomains/redirect/multi-instances)
Below you will find a use case for each feature. Below you will find a use case for each feature.

View File

@ -33,7 +33,7 @@ type (
// - SignoutHandler // - SignoutHandler
// - SignoutAllHandler // - SignoutAllHandler
// //
// Example can be found at: https://github.com/kataras/iris/tree/master/_examples/auth/auth/main.go. // Example can be found at: https://github.com/kataras/iris/tree/main/_examples/auth/auth/main.go.
Auth[T User] struct { Auth[T User] struct {
// Holds the configuration passed through the New and MustLoad // Holds the configuration passed through the New and MustLoad
// package-level functions. One or more Auth instance can share the // package-level functions. One or more Auth instance can share the
@ -116,7 +116,7 @@ func Must[T User](s *Auth[T], err error) *Auth[T] {
// MustGenerateConfiguration or MustLoadConfiguration // MustGenerateConfiguration or MustLoadConfiguration
// or LoadConfiguration or MustLoad package-level functions. // or LoadConfiguration or MustLoad package-level functions.
// //
// Example can be found at: https://github.com/kataras/iris/tree/master/_examples/auth/auth/main.go. // Example can be found at: https://github.com/kataras/iris/tree/main/_examples/auth/auth/main.go.
func New[T User](config Configuration) (*Auth[T], error) { func New[T User](config Configuration) (*Auth[T], error) {
keys, err := config.validate() keys, err := config.validate()
if err != nil { if err != nil {

View File

@ -23,7 +23,7 @@ type VerifiedToken = jwt.VerifiedToken
// ErrorHandler all in once when necessary. // ErrorHandler all in once when necessary.
// Set a provider using the AddProvider method of Auth type. // Set a provider using the AddProvider method of Auth type.
// //
// Example can be found at: https://github.com/kataras/iris/tree/master/_examples/auth/auth/user_provider.go. // Example can be found at: https://github.com/kataras/iris/tree/main/_examples/auth/auth/user_provider.go.
type Provider[T User] interface { type Provider[T User] interface {
// Signin accepts a username (or email) and a password and should // Signin accepts a username (or email) and a password and should
// return a valid T value or an error describing // return a valid T value or an error describing

View File

@ -15,7 +15,7 @@ type (
// User is an alias of an empty interface, it's here to declare the typeof T, // User is an alias of an empty interface, it's here to declare the typeof T,
// which can be any custom struct type. // which can be any custom struct type.
// //
// Example can be found at: https://github.com/kataras/iris/tree/master/_examples/auth/auth/user.go. // Example can be found at: https://github.com/kataras/iris/tree/main/_examples/auth/auth/user.go.
User = any User = any
) )

2
cache/cache.go vendored
View File

@ -64,7 +64,7 @@ func Cache(expiration time.Duration) *client.Handler {
// Handler like `Cache` but returns an Iris Handler to be used as a middleware. // Handler like `Cache` but returns an Iris Handler to be used as a middleware.
// For more options use the `Cache`. // For more options use the `Cache`.
// //
// Examples can be found at: https://github.com/kataras/iris/tree/master/_examples/response-writer/cache // Examples can be found at: https://github.com/kataras/iris/tree/main/_examples/response-writer/cache
func Handler(expiration time.Duration) context.Handler { func Handler(expiration time.Duration) context.Handler {
h := Cache(expiration).ServeHTTP h := Cache(expiration).ServeHTTP
return h return h

View File

@ -225,7 +225,7 @@ func WithTimeout(timeoutDur time.Duration, htmlBody ...string) Configurator {
// //
// See `Configuration#IgnoreServerErrors []string` too. // See `Configuration#IgnoreServerErrors []string` too.
// //
// Example: https://github.com/kataras/iris/tree/master/_examples/http-server/listen-addr/omit-server-errors // Example: https://github.com/kataras/iris/tree/main/_examples/http-server/listen-addr/omit-server-errors
func WithoutServerError(errors ...error) Configurator { func WithoutServerError(errors ...error) Configurator {
return func(app *Application) { return func(app *Application) {
if len(errors) == 0 { if len(errors) == 0 {
@ -502,7 +502,7 @@ func WithOtherValue(key string, val interface{}) Configurator {
// If the result does not complete your needs you can take control // If the result does not complete your needs you can take control
// and use the github.com/kataras/sitemap package to generate a customized one instead. // and use the github.com/kataras/sitemap package to generate a customized one instead.
// //
// Example: https://github.com/kataras/iris/tree/master/_examples/sitemap. // Example: https://github.com/kataras/iris/tree/main/_examples/sitemap.
func WithSitemap(startURL string) Configurator { func WithSitemap(startURL string) Configurator {
sitemaps := sitemap.New(startURL) sitemaps := sitemap.New(startURL)
return func(app *Application) { return func(app *Application) {
@ -688,7 +688,7 @@ type Configuration struct {
// //
// See `WithoutServerError(...)` function too. // See `WithoutServerError(...)` function too.
// //
// Example: https://github.com/kataras/iris/tree/master/_examples/http-server/listen-addr/omit-server-errors // Example: https://github.com/kataras/iris/tree/main/_examples/http-server/listen-addr/omit-server-errors
// //
// Defaults to an empty slice. // Defaults to an empty slice.
IgnoreServerErrors []string `ini:"ignore_server_errors" json:"ignoreServerErrors,omitempty" yaml:"IgnoreServerErrors" toml:"IgnoreServerErrors"` IgnoreServerErrors []string `ini:"ignore_server_errors" json:"ignoreServerErrors,omitempty" yaml:"IgnoreServerErrors" toml:"IgnoreServerErrors"`

View File

@ -70,7 +70,7 @@ type (
// Note: This is totally optionally, the default decoders // Note: This is totally optionally, the default decoders
// for ReadJSON is the encoding/json and for ReadXML is the encoding/xml. // for ReadJSON is the encoding/json and for ReadXML is the encoding/xml.
// //
// Example: https://github.com/kataras/iris/blob/master/_examples/request-body/read-custom-per-type/main.go // Example: https://github.com/kataras/iris/blob/main/_examples/request-body/read-custom-per-type/main.go
BodyDecoder interface { BodyDecoder interface {
Decode(data []byte) error Decode(data []byte) error
} }
@ -91,7 +91,7 @@ type (
// //
// See 'Unmarshaler' and 'BodyDecoder' for more. // See 'Unmarshaler' and 'BodyDecoder' for more.
// //
// Example: https://github.com/kataras/iris/blob/master/_examples/request-body/read-custom-via-unmarshaler/main.go // Example: https://github.com/kataras/iris/blob/main/_examples/request-body/read-custom-via-unmarshaler/main.go
UnmarshalerFunc func(data []byte, outPtr interface{}) error UnmarshalerFunc func(data []byte, outPtr interface{}) error
// DecodeFunc is a generic type of decoder function. // DecodeFunc is a generic type of decoder function.
@ -1080,7 +1080,7 @@ func (ctx *Context) Subdomain() (subdomain string) {
// this request based on subdomain and request path. // this request based on subdomain and request path.
// //
// Order may change. // Order may change.
// Example: https://github.com/kataras/iris/tree/master/_examples/routing/intelligence/manual // Example: https://github.com/kataras/iris/tree/main/_examples/routing/intelligence/manual
func (ctx *Context) FindClosest(n int) []string { func (ctx *Context) FindClosest(n int) []string {
return ctx.app.FindClosestPaths(ctx.Subdomain(), ctx.Path(), n) return ctx.app.FindClosestPaths(ctx.Subdomain(), ctx.Path(), n)
} }
@ -1358,7 +1358,7 @@ func (ctx *Context) GetLocale() Locale {
// Tr returns a i18n localized message based on format with optional arguments. // Tr returns a i18n localized message based on format with optional arguments.
// See `GetLocale` too. // See `GetLocale` too.
// //
// Example: https://github.com/kataras/iris/tree/master/_examples/i18n // Example: https://github.com/kataras/iris/tree/main/_examples/i18n
func (ctx *Context) Tr(key string, args ...interface{}) string { func (ctx *Context) Tr(key string, args ...interface{}) string {
return ctx.app.I18nReadOnly().TrContext(ctx, key, args...) return ctx.app.I18nReadOnly().TrContext(ctx, key, args...)
} }
@ -2327,7 +2327,7 @@ func (ctx *Context) PostValueSimpleDate(name string) (time.Time, error) {
// The default form's memory maximum size is 32MB, it can be changed by the // The default form's memory maximum size is 32MB, it can be changed by the
// `iris#WithPostMaxMemory` configurator at main configuration passed on `app.Run`'s second argument. // `iris#WithPostMaxMemory` configurator at main configuration passed on `app.Run`'s second argument.
// //
// Example: https://github.com/kataras/iris/tree/master/_examples/file-server/upload-file // Example: https://github.com/kataras/iris/tree/main/_examples/file-server/upload-file
func (ctx *Context) FormFile(key string) (multipart.File, *multipart.FileHeader, error) { func (ctx *Context) FormFile(key string) (multipart.File, *multipart.FileHeader, error) {
// we don't have access to see if the request is body stream // we don't have access to see if the request is body stream
// and then the ParseMultipartForm can be useless // and then the ParseMultipartForm can be useless
@ -2406,7 +2406,7 @@ func (ctx *Context) FormFiles(key string, before ...func(*Context, *multipart.Fi
// //
// See `FormFile` and `FormFiles` to a more controlled way to receive a file. // See `FormFile` and `FormFiles` to a more controlled way to receive a file.
// //
// Example: https://github.com/kataras/iris/tree/master/_examples/file-server/upload-files // Example: https://github.com/kataras/iris/tree/main/_examples/file-server/upload-files
func (ctx *Context) UploadFormFiles(destDirectory string, before ...func(*Context, *multipart.FileHeader) bool) (uploaded []*multipart.FileHeader, n int64, err error) { func (ctx *Context) UploadFormFiles(destDirectory string, before ...func(*Context, *multipart.FileHeader) bool) (uploaded []*multipart.FileHeader, n int64, err error) {
err = ctx.request.ParseMultipartForm(ctx.app.ConfigurationReadOnly().GetPostMaxMemory()) err = ctx.request.ParseMultipartForm(ctx.app.ConfigurationReadOnly().GetPostMaxMemory())
if err != nil { if err != nil {
@ -2636,7 +2636,7 @@ type Validator interface {
// UnmarshalBody reads the request's body and binds it to a value or pointer of any type // UnmarshalBody reads the request's body and binds it to a value or pointer of any type
// Examples of usage: context.ReadJSON, context.ReadXML. // Examples of usage: context.ReadJSON, context.ReadXML.
// //
// Example: https://github.com/kataras/iris/blob/master/_examples/request-body/read-custom-via-unmarshaler/main.go // Example: https://github.com/kataras/iris/blob/main/_examples/request-body/read-custom-via-unmarshaler/main.go
func (ctx *Context) UnmarshalBody(outPtr interface{}, unmarshaler Unmarshaler) error { func (ctx *Context) UnmarshalBody(outPtr interface{}, unmarshaler Unmarshaler) error {
if ctx.request.Body == nil { if ctx.request.Body == nil {
return fmt.Errorf("unmarshal: empty body: %w", ErrNotFound) return fmt.Errorf("unmarshal: empty body: %w", ErrNotFound)
@ -2734,7 +2734,7 @@ var ReadJSON = func(ctx *Context, outPtr interface{}, opts ...JSONReader) error
// ReadJSON reads JSON from request's body and binds it to a value of any json-valid type. // ReadJSON reads JSON from request's body and binds it to a value of any json-valid type.
// //
// Example: https://github.com/kataras/iris/blob/master/_examples/request-body/read-json/main.go // Example: https://github.com/kataras/iris/blob/main/_examples/request-body/read-json/main.go
func (ctx *Context) ReadJSON(outPtr interface{}, opts ...JSONReader) error { func (ctx *Context) ReadJSON(outPtr interface{}, opts ...JSONReader) error {
return ReadJSON(ctx, outPtr, opts...) return ReadJSON(ctx, outPtr, opts...)
} }
@ -2748,7 +2748,7 @@ func (ctx *Context) ReadJSON(outPtr interface{}, opts ...JSONReader) error {
// It accepts a function which accepts the json Decode function and returns an error. // It accepts a function which accepts the json Decode function and returns an error.
// The second variadic argument is optional and can be used to customize the decoder even further. // The second variadic argument is optional and can be used to customize the decoder even further.
// //
// Example: https://github.com/kataras/iris/blob/master/_examples/request-body/read-json-stream/main.go // Example: https://github.com/kataras/iris/blob/main/_examples/request-body/read-json-stream/main.go
func (ctx *Context) ReadJSONStream(onDecode func(DecodeFunc) error, opts ...JSONReader) error { func (ctx *Context) ReadJSONStream(onDecode func(DecodeFunc) error, opts ...JSONReader) error {
decoder := json.NewDecoder(ctx.request.Body) decoder := json.NewDecoder(ctx.request.Body)
@ -2780,14 +2780,14 @@ func (ctx *Context) ReadJSONStream(onDecode func(DecodeFunc) error, opts ...JSON
// ReadXML reads XML from request's body and binds it to a value of any xml-valid type. // ReadXML reads XML from request's body and binds it to a value of any xml-valid type.
// //
// Example: https://github.com/kataras/iris/blob/master/_examples/request-body/read-xml/main.go // Example: https://github.com/kataras/iris/blob/main/_examples/request-body/read-xml/main.go
func (ctx *Context) ReadXML(outPtr interface{}) error { func (ctx *Context) ReadXML(outPtr interface{}) error {
return ctx.UnmarshalBody(outPtr, UnmarshalerFunc(xml.Unmarshal)) return ctx.UnmarshalBody(outPtr, UnmarshalerFunc(xml.Unmarshal))
} }
// ReadYAML reads YAML from request's body and binds it to the "outPtr" value. // ReadYAML reads YAML from request's body and binds it to the "outPtr" value.
// //
// Example: https://github.com/kataras/iris/blob/master/_examples/request-body/read-yaml/main.go // Example: https://github.com/kataras/iris/blob/main/_examples/request-body/read-yaml/main.go
func (ctx *Context) ReadYAML(outPtr interface{}) error { func (ctx *Context) ReadYAML(outPtr interface{}) error {
return ctx.UnmarshalBody(outPtr, UnmarshalerFunc(yaml.Unmarshal)) return ctx.UnmarshalBody(outPtr, UnmarshalerFunc(yaml.Unmarshal))
} }
@ -2900,7 +2900,7 @@ const CSRFTokenFormKey = "csrf.token"
// As of 15 Aug 2022, ReadForm does not return an error over unknown CSRF token form key, // As of 15 Aug 2022, ReadForm does not return an error over unknown CSRF token form key,
// to change this behavior globally, set the `context.CSRFTokenFormKey` to an empty value. // to change this behavior globally, set the `context.CSRFTokenFormKey` to an empty value.
// //
// Example: https://github.com/kataras/iris/blob/master/_examples/request-body/read-form/main.go // Example: https://github.com/kataras/iris/blob/main/_examples/request-body/read-form/main.go
func (ctx *Context) ReadForm(formObject interface{}) error { func (ctx *Context) ReadForm(formObject interface{}) error {
values := ctx.FormValues() values := ctx.FormValues()
if len(values) == 0 { if len(values) == 0 {
@ -3057,7 +3057,7 @@ func distinctStrings(values []string) []string {
// ReadQuery binds URL Query to "ptr". The struct field tag is "url". // ReadQuery binds URL Query to "ptr". The struct field tag is "url".
// //
// Example: https://github.com/kataras/iris/blob/master/_examples/request-body/read-query/main.go // Example: https://github.com/kataras/iris/blob/main/_examples/request-body/read-query/main.go
func (ctx *Context) ReadQuery(ptr interface{}) error { func (ctx *Context) ReadQuery(ptr interface{}) error {
values := ctx.getQuery() values := ctx.getQuery()
if len(values) == 0 { if len(values) == 0 {
@ -3077,7 +3077,7 @@ func (ctx *Context) ReadQuery(ptr interface{}) error {
// ReadHeaders binds request headers to "ptr". The struct field tag is "header". // ReadHeaders binds request headers to "ptr". The struct field tag is "header".
// //
// Example: https://github.com/kataras/iris/blob/master/_examples/request-body/read-headers/main.go // Example: https://github.com/kataras/iris/blob/main/_examples/request-body/read-headers/main.go
func (ctx *Context) ReadHeaders(ptr interface{}) error { func (ctx *Context) ReadHeaders(ptr interface{}) error {
err := schema.DecodeHeaders(ctx.request.Header, ptr) err := schema.DecodeHeaders(ctx.request.Header, ptr)
if err != nil { if err != nil {
@ -3089,7 +3089,7 @@ func (ctx *Context) ReadHeaders(ptr interface{}) error {
// ReadParams binds URI Dynamic Path Parameters to "ptr". The struct field tag is "param". // ReadParams binds URI Dynamic Path Parameters to "ptr". The struct field tag is "param".
// //
// Example: https://github.com/kataras/iris/blob/master/_examples/request-body/read-params/main.go // Example: https://github.com/kataras/iris/blob/main/_examples/request-body/read-params/main.go
func (ctx *Context) ReadParams(ptr interface{}) error { func (ctx *Context) ReadParams(ptr interface{}) error {
n := ctx.params.Len() n := ctx.params.Len()
if n == 0 { if n == 0 {
@ -3649,7 +3649,7 @@ func (ctx *Context) ViewEngine(engine ViewEngine) {
// //
// Look .ViewData and .View too. // Look .ViewData and .View too.
// //
// Example: https://github.com/kataras/iris/tree/master/_examples/view/context-view-data/ // Example: https://github.com/kataras/iris/tree/main/_examples/view/context-view-data/
func (ctx *Context) ViewLayout(layoutTmplFile string) { func (ctx *Context) ViewLayout(layoutTmplFile string) {
ctx.values.Set(ctx.app.ConfigurationReadOnly().GetViewLayoutContextKey(), layoutTmplFile) ctx.values.Set(ctx.app.ConfigurationReadOnly().GetViewLayoutContextKey(), layoutTmplFile)
} }
@ -3671,7 +3671,7 @@ func (ctx *Context) ViewLayout(layoutTmplFile string) {
// //
// Look .ViewLayout and .View too. // Look .ViewLayout and .View too.
// //
// Example: https://github.com/kataras/iris/tree/master/_examples/view/context-view-data/ // Example: https://github.com/kataras/iris/tree/main/_examples/view/context-view-data/
func (ctx *Context) ViewData(key string, value interface{}) { func (ctx *Context) ViewData(key string, value interface{}) {
viewDataContextKey := ctx.app.ConfigurationReadOnly().GetViewDataContextKey() viewDataContextKey := ctx.app.ConfigurationReadOnly().GetViewDataContextKey()
if key == "" { if key == "" {
@ -3869,7 +3869,7 @@ func (ctx *Context) FallbackView(providers ...FallbackViewProvider) {
// //
// Look .ViewData and .ViewLayout too. // Look .ViewData and .ViewLayout too.
// //
// Examples: https://github.com/kataras/iris/tree/master/_examples/view // Examples: https://github.com/kataras/iris/tree/main/_examples/view
func (ctx *Context) View(filename string, optionalViewModel ...interface{}) error { func (ctx *Context) View(filename string, optionalViewModel ...interface{}) error {
ctx.ContentType(ContentHTMLHeaderValue) ctx.ContentType(ContentHTMLHeaderValue)
@ -4428,7 +4428,7 @@ func (ctx *Context) XML(v interface{}, opts ...XML) (err error) {
// Use the options.RenderXML and XML fields to change this behavior and // Use the options.RenderXML and XML fields to change this behavior and
// send a response of content type "application/problem+xml" instead. // send a response of content type "application/problem+xml" instead.
// //
// Read more at: https://github.com/kataras/iris/blob/master/_examples/routing/http-errors. // Read more at: https://github.com/kataras/iris/blob/main/_examples/routing/http-errors.
func (ctx *Context) Problem(v interface{}, opts ...ProblemOptions) error { func (ctx *Context) Problem(v interface{}, opts ...ProblemOptions) error {
options := DefaultProblemOptions options := DefaultProblemOptions
if len(opts) > 0 { if len(opts) > 0 {
@ -4746,7 +4746,7 @@ func parseHeader(headerValue string) []string {
// //
// Supports the above without quality values. // Supports the above without quality values.
// //
// Read more at: https://github.com/kataras/iris/tree/master/_examples/response-writer/content-negotiation // Read more at: https://github.com/kataras/iris/tree/main/_examples/response-writer/content-negotiation
func (ctx *Context) Negotiate(v interface{}) (int, error) { func (ctx *Context) Negotiate(v interface{}) (int, error) {
contentType, charset, encoding, content := ctx.Negotiation().Build() contentType, charset, encoding, content := ctx.Negotiation().Build()
if v == nil { if v == nil {
@ -5651,7 +5651,7 @@ type SecureCookie interface {
// with that `Name` will be encoded on set and decoded on get, that way you can encrypt // with that `Name` will be encoded on set and decoded on get, that way you can encrypt
// specific cookie names (like the session id) and let the rest of the cookies "insecure". // specific cookie names (like the session id) and let the rest of the cookies "insecure".
// //
// Example: https://github.com/kataras/iris/tree/master/_examples/cookies/securecookie // Example: https://github.com/kataras/iris/tree/main/_examples/cookies/securecookie
func CookieEncoding(encoding SecureCookie, cookieNames ...string) CookieOption { func CookieEncoding(encoding SecureCookie, cookieNames ...string) CookieOption {
if encoding == nil { if encoding == nil {
return func(_ *Context, _ *http.Cookie, _ uint8) {} return func(_ *Context, _ *http.Cookie, _ uint8) {}
@ -5705,7 +5705,7 @@ const cookieOptionsContextKey = "iris.cookie.options"
// - CookieExpires // - CookieExpires
// - CookieEncoding // - CookieEncoding
// //
// Example at: https://github.com/kataras/iris/tree/master/_examples/cookies/securecookie // Example at: https://github.com/kataras/iris/tree/main/_examples/cookies/securecookie
func (ctx *Context) AddCookieOptions(options ...CookieOption) { func (ctx *Context) AddCookieOptions(options ...CookieOption) {
if len(options) == 0 { if len(options) == 0 {
return return
@ -5745,7 +5745,7 @@ func (ctx *Context) ClearCookieOptions() {
// SetCookie adds a cookie. // SetCookie adds a cookie.
// Use of the "options" is not required, they can be used to amend the "cookie". // Use of the "options" is not required, they can be used to amend the "cookie".
// //
// Example: https://github.com/kataras/iris/tree/master/_examples/cookies/basic // Example: https://github.com/kataras/iris/tree/main/_examples/cookies/basic
func (ctx *Context) SetCookie(cookie *http.Cookie, options ...CookieOption) { func (ctx *Context) SetCookie(cookie *http.Cookie, options ...CookieOption) {
ctx.applyCookieOptions(cookie, OpCookieSet, options) ctx.applyCookieOptions(cookie, OpCookieSet, options)
http.SetCookie(ctx.writer, cookie) http.SetCookie(ctx.writer, cookie)
@ -5815,7 +5815,7 @@ var SetCookieKVExpiration = 8760 * time.Hour
// iris.CookieExpires(time.Duration) // iris.CookieExpires(time.Duration)
// iris.CookieHTTPOnly(false) // iris.CookieHTTPOnly(false)
// //
// Examples: https://github.com/kataras/iris/tree/master/_examples/cookies/basic // Examples: https://github.com/kataras/iris/tree/main/_examples/cookies/basic
func (ctx *Context) SetCookieKV(name, value string, options ...CookieOption) { func (ctx *Context) SetCookieKV(name, value string, options ...CookieOption) {
c := &http.Cookie{} c := &http.Cookie{}
c.Path = "/" c.Path = "/"
@ -5838,7 +5838,7 @@ func (ctx *Context) SetCookieKV(name, value string, options ...CookieOption) {
// If you want more than the value then: // If you want more than the value then:
// cookie, err := ctx.GetRequestCookie("name") // cookie, err := ctx.GetRequestCookie("name")
// //
// Example: https://github.com/kataras/iris/tree/master/_examples/cookies/basic // Example: https://github.com/kataras/iris/tree/main/_examples/cookies/basic
func (ctx *Context) GetCookie(name string, options ...CookieOption) string { func (ctx *Context) GetCookie(name string, options ...CookieOption) string {
c, err := ctx.GetRequestCookie(name, options...) c, err := ctx.GetRequestCookie(name, options...)
if err != nil { if err != nil {
@ -5871,7 +5871,7 @@ var (
// RemoveCookie deletes a cookie by its name and path = "/". // RemoveCookie deletes a cookie by its name and path = "/".
// Tip: change the cookie's path to the current one by: RemoveCookie("name", iris.CookieCleanPath) // Tip: change the cookie's path to the current one by: RemoveCookie("name", iris.CookieCleanPath)
// //
// Example: https://github.com/kataras/iris/tree/master/_examples/cookies/basic // Example: https://github.com/kataras/iris/tree/main/_examples/cookies/basic
func (ctx *Context) RemoveCookie(name string, options ...CookieOption) { func (ctx *Context) RemoveCookie(name string, options ...CookieOption) {
c := &http.Cookie{} c := &http.Cookie{}
c.Name = name c.Name = name
@ -5966,7 +5966,7 @@ func (ctx *Context) IsRecording() (*ResponseRecorder, bool) {
// //
// app.None(...) and app.GetRoutes().Offline(route)/.Online(route, method) // app.None(...) and app.GetRoutes().Offline(route)/.Online(route, method)
// //
// Example: https://github.com/kataras/iris/tree/master/_examples/routing/route-state // Example: https://github.com/kataras/iris/tree/main/_examples/routing/route-state
// //
// User can get the response by simple using rec := ctx.Recorder(); rec.Body()/rec.StatusCode()/rec.Header(). // User can get the response by simple using rec := ctx.Recorder(); rec.Body()/rec.StatusCode()/rec.Header().
// //
@ -6291,7 +6291,7 @@ const (
// See its `CallFunc` to call the "fn" on the next handler. // See its `CallFunc` to call the "fn" on the next handler.
// //
// Example at: // Example at:
// https://github.com/kataras/iris/tree/master/_examples/routing/writing-a-middleware/share-funcs // https://github.com/kataras/iris/tree/main/_examples/routing/writing-a-middleware/share-funcs
func (ctx *Context) SetFunc(name string, fn interface{}, persistenceArgs ...interface{}) { func (ctx *Context) SetFunc(name string, fn interface{}, persistenceArgs ...interface{}) {
f := newFunc(name, fn, persistenceArgs...) f := newFunc(name, fn, persistenceArgs...)
ctx.values.Set(funcsContextPrefixKey+name, f) ctx.values.Set(funcsContextPrefixKey+name, f)

View File

@ -14,7 +14,7 @@ import (
// Pass a Problem value to `context.Problem` to // Pass a Problem value to `context.Problem` to
// write an "application/problem+json" response. // write an "application/problem+json" response.
// //
// Read more at: https://github.com/kataras/iris/blob/master/_examples/routing/http-errors. // Read more at: https://github.com/kataras/iris/blob/main/_examples/routing/http-errors.
type Problem map[string]interface{} type Problem map[string]interface{}
// NewProblem retruns a new Problem. // NewProblem retruns a new Problem.

View File

@ -233,7 +233,7 @@ func (r *RequestParams) GetIntUnslashed(key string) (int, bool) {
// } // }
// } // }
// //
// Read https://github.com/kataras/iris/tree/master/_examples/routing/macros for more details. // Read https://github.com/kataras/iris/tree/main/_examples/routing/macros for more details.
// Checks for total available request parameters length // Checks for total available request parameters length
// and parameter index based on the hero/mvc function added // and parameter index based on the hero/mvc function added
// in order to support the MVC.HandleMany("GET", "/path/{ps}/{pssecond} /path/{ps}") // in order to support the MVC.HandleMany("GET", "/path/{ps}/{pssecond} /path/{ps}")

View File

@ -496,7 +496,7 @@ func (api *APIBuilder) AllowMethods(methods ...string) Party {
// //
// Returns this Party. // Returns this Party.
// //
// Example: https://github.com/kataras/iris/tree/master/_examples/mvc/middleware/without-ctx-next // Example: https://github.com/kataras/iris/tree/main/_examples/mvc/middleware/without-ctx-next
func (api *APIBuilder) SetExecutionRules(executionRules ExecutionRules) Party { func (api *APIBuilder) SetExecutionRules(executionRules ExecutionRules) Party {
api.handlerExecutionRules = executionRules api.handlerExecutionRules = executionRules
return api return api
@ -631,7 +631,7 @@ func (api *APIBuilder) HandleMany(methodOrMulti string, relativePathorMulti stri
// HandleDir("/public",subFilesystem, DirOptions{...}) // HandleDir("/public",subFilesystem, DirOptions{...})
// //
// Examples: // Examples:
// https://github.com/kataras/iris/tree/master/_examples/file-server // https://github.com/kataras/iris/tree/main/_examples/file-server
func (api *APIBuilder) HandleDir(requestPath string, fsOrDir interface{}, opts ...DirOptions) (routes []*Route) { func (api *APIBuilder) HandleDir(requestPath string, fsOrDir interface{}, opts ...DirOptions) (routes []*Route) {
options := DefaultDirOptions options := DefaultDirOptions
if len(opts) > 0 { if len(opts) > 0 {
@ -1036,7 +1036,7 @@ func (api *APIBuilder) WildcardSubdomain(middleware ...context.Handler) Party {
// Macros returns the macro collection that is responsible // Macros returns the macro collection that is responsible
// to register custom macros with their own parameter types and their macro functions for all routes. // to register custom macros with their own parameter types and their macro functions for all routes.
// //
// Learn more at: https://github.com/kataras/iris/tree/master/_examples/routing/dynamic-path // Learn more at: https://github.com/kataras/iris/tree/main/_examples/routing/dynamic-path
func (api *APIBuilder) Macros() *macro.Macros { func (api *APIBuilder) Macros() *macro.Macros {
return api.macros return api.macros
} }
@ -1692,7 +1692,7 @@ func (api *APIBuilder) FallbackView(provider context.FallbackViewProvider) {
// } // }
// }) // })
// //
// Examples: https://github.com/kataras/iris/tree/master/_examples/view // Examples: https://github.com/kataras/iris/tree/main/_examples/view
func (api *APIBuilder) Layout(tmplLayoutFile string) Party { func (api *APIBuilder) Layout(tmplLayoutFile string) Party {
handler := func(ctx *context.Context) { handler := func(ctx *context.Context) {
ctx.ViewLayout(tmplLayoutFile) ctx.ViewLayout(tmplLayoutFile)

View File

@ -161,7 +161,7 @@ var DefaultDirOptions = DirOptions{
// The second parameter is the settings that the caller can use to customize the behavior. // The second parameter is the settings that the caller can use to customize the behavior.
// //
// See `Party#HandleDir` too. // See `Party#HandleDir` too.
// Examples can be found at: https://github.com/kataras/iris/tree/master/_examples/file-server // Examples can be found at: https://github.com/kataras/iris/tree/main/_examples/file-server
func FileServer(fs http.FileSystem, options DirOptions) context.Handler { func FileServer(fs http.FileSystem, options DirOptions) context.Handler {
if fs == nil { if fs == nil {
panic("FileServer: fs is nil. The fs parameter should point to a file system of physical system directory or to an embedded one") panic("FileServer: fs is nil. The fs parameter should point to a file system of physical system directory or to an embedded one")

View File

@ -119,7 +119,7 @@ type Party interface {
// Macros returns the macro collection that is responsible // Macros returns the macro collection that is responsible
// to register custom macros with their own parameter types and their macro functions for all routes. // to register custom macros with their own parameter types and their macro functions for all routes.
// //
// Learn more at: https://github.com/kataras/iris/tree/master/_examples/routing/dynamic-path // Learn more at: https://github.com/kataras/iris/tree/main/_examples/routing/dynamic-path
Macros() *macro.Macros Macros() *macro.Macros
// Properties returns the original Party's properties map, // Properties returns the original Party's properties map,
@ -285,7 +285,7 @@ type Party interface {
// //
// Returns this Party. // Returns this Party.
// //
// Example: https://github.com/kataras/iris/tree/master/_examples/mvc/middleware/without-ctx-next // Example: https://github.com/kataras/iris/tree/main/_examples/mvc/middleware/without-ctx-next
SetExecutionRules(executionRules ExecutionRules) Party SetExecutionRules(executionRules ExecutionRules) Party
// SetRegisterRule sets a `RouteRegisterRule` for this Party and its children. // SetRegisterRule sets a `RouteRegisterRule` for this Party and its children.
// Available values are: // Available values are:
@ -335,7 +335,7 @@ type Party interface {
// HandleDir("/public", iris.Dir("./assets"), DirOptions{...}) // HandleDir("/public", iris.Dir("./assets"), DirOptions{...})
// //
// Examples: // Examples:
// https://github.com/kataras/iris/tree/master/_examples/file-server // https://github.com/kataras/iris/tree/main/_examples/file-server
HandleDir(requestPath string, fileSystem interface{}, opts ...DirOptions) []*Route HandleDir(requestPath string, fileSystem interface{}, opts ...DirOptions) []*Route
// None registers an "offline" route // None registers an "offline" route
@ -458,6 +458,6 @@ type Party interface {
// } // }
// }) // })
// //
// Examples: https://github.com/kataras/iris/tree/master/_examples/view // Examples: https://github.com/kataras/iris/tree/main/_examples/view
Layout(tmplLayoutFile string) Party Layout(tmplLayoutFile string) Party
} }

View File

@ -62,7 +62,7 @@ func pathIsWildcard(partyRelPath string) bool {
// NewSubdomainRedirectWrapper may return nil if not allowed input arguments values were received // NewSubdomainRedirectWrapper may return nil if not allowed input arguments values were received
// but in that case, the `AddRouterWrapper` will, simply, ignore that wrapper. // but in that case, the `AddRouterWrapper` will, simply, ignore that wrapper.
// //
// Example: https://github.com/kataras/iris/tree/master/_examples/routing/subdomains/redirect // Example: https://github.com/kataras/iris/tree/main/_examples/routing/subdomains/redirect
func NewSubdomainRedirectWrapper(rootDomainGetter func() string, from, to string) WrapperFunc { func NewSubdomainRedirectWrapper(rootDomainGetter func() string, from, to string) WrapperFunc {
// we can return nil, // we can return nil,
// because if wrapper is nil then it's not be used on the `router#AddRouterWrapper`. // because if wrapper is nil then it's not be used on the `router#AddRouterWrapper`.

4
doc.go
View File

@ -24,11 +24,11 @@ Wiki:
Examples: Examples:
https://github.com/kataras/iris/tree/master/_examples https://github.com/kataras/iris/tree/main/_examples
Middleware: Middleware:
https://github.com/kataras/iris/tree/master/middleware https://github.com/kataras/iris/tree/main/middleware
https://github.com/iris-contrib/middleware https://github.com/iris-contrib/middleware
Home Page: Home Page:

View File

@ -51,7 +51,7 @@ func defaultResultHandler(ctx *context.Context, v interface{}) error {
// All types that complete this interface // All types that complete this interface
// can be returned as values from the method functions. // can be returned as values from the method functions.
// //
// Example at: https://github.com/kataras/iris/tree/master/_examples/dependency-injection/overview. // Example at: https://github.com/kataras/iris/tree/main/_examples/dependency-injection/overview.
type Result interface { type Result interface {
// Dispatch should send a response to the client. // Dispatch should send a response to the client.
Dispatch(*context.Context) Dispatch(*context.Context)
@ -84,7 +84,7 @@ var defaultFailureResponse = Response{Code: DefaultErrStatusCode}
// otherwise it returns the "failure" response if any, // otherwise it returns the "failure" response if any,
// if not then a 400 bad request is being sent. // if not then a 400 bad request is being sent.
// //
// Example usage at: https://github.com/kataras/iris/blob/master/hero/func_result_test.go. // Example usage at: https://github.com/kataras/iris/blob/main/hero/func_result_test.go.
func Try(fn func() Result, failure ...Result) Result { func Try(fn func() Result, failure ...Result) Result {
var failed bool var failed bool
var actionResponse Result var actionResponse Result
@ -465,7 +465,7 @@ func (r Response) Dispatch(ctx *context.Context) {
// wraps the template file name, layout, (any) view data, status code and error. // wraps the template file name, layout, (any) view data, status code and error.
// It's smart enough to complete the request and send the correct response to the client. // It's smart enough to complete the request and send the correct response to the client.
// //
// Example at: https://github.com/kataras/iris/blob/master/_examples/dependency-injection/overview/web/routes/hello.go. // Example at: https://github.com/kataras/iris/blob/main/_examples/dependency-injection/overview/web/routes/hello.go.
type View struct { type View struct {
Name string Name string
Layout string Layout string

View File

@ -104,8 +104,8 @@ func DefaultConfiguration() *Configuration {
// //
// httptest.New(t, app, httptest.URL(...), httptest.Debug(true), httptest.LogLevel("debug"), httptest.Strict(true)) // httptest.New(t, app, httptest.URL(...), httptest.Debug(true), httptest.LogLevel("debug"), httptest.Strict(true))
// //
// Examples at: https://github.com/kataras/iris/tree/master/_examples/testing/httptest and // Examples at: https://github.com/kataras/iris/tree/main/_examples/testing/httptest and
// https://github.com/kataras/iris/tree/master/_examples/testing/ginkgotest. // https://github.com/kataras/iris/tree/main/_examples/testing/ginkgotest.
func New(t IrisTesty, app *iris.Application, setters ...OptionSetter) *httpexpect.Expect { func New(t IrisTesty, app *iris.Application, setters ...OptionSetter) *httpexpect.Expect {
conf := DefaultConfiguration() conf := DefaultConfiguration()
for _, setter := range setters { for _, setter := range setters {

View File

@ -113,7 +113,7 @@ func makeTags(languages ...string) (tags []language.Tag) {
} }
// New returns a new `I18n` instance. Use its `Load` or `LoadAssets` to load languages. // New returns a new `I18n` instance. Use its `Load` or `LoadAssets` to load languages.
// Examples at: https://github.com/kataras/iris/tree/master/_examples/i18n. // Examples at: https://github.com/kataras/iris/tree/main/_examples/i18n.
func New() *I18n { func New() *I18n {
i := &I18n{ i := &I18n{
Loader: DefaultLoaderConfig, Loader: DefaultLoaderConfig,
@ -146,7 +146,7 @@ func (i *I18n) LoadAssets(assetNames func() []string, asset func(string) ([]byte
// The "pattern" is a classic glob pattern. // The "pattern" is a classic glob pattern.
// //
// See `New` and `FS` package-level functions for more. // See `New` and `FS` package-level functions for more.
// Example: https://github.com/kataras/iris/blob/master/_examples/i18n/template-embedded/main.go. // Example: https://github.com/kataras/iris/blob/main/_examples/i18n/template-embedded/main.go.
func (i *I18n) LoadFS(fileSystem fs.FS, pattern string, languages ...string) error { func (i *I18n) LoadFS(fileSystem fs.FS, pattern string, languages ...string) error {
loader, err := FS(fileSystem, pattern, i.Loader) loader, err := FS(fileSystem, pattern, i.Loader)
if err != nil { if err != nil {

12
iris.go
View File

@ -247,7 +247,7 @@ func (app *Application) WWW() router.Party {
// If you need more information about this implementation then you have to navigate through // If you need more information about this implementation then you have to navigate through
// the `core/router#NewSubdomainRedirectWrapper` function instead. // the `core/router#NewSubdomainRedirectWrapper` function instead.
// //
// Example: https://github.com/kataras/iris/tree/master/_examples/routing/subdomains/redirect // Example: https://github.com/kataras/iris/tree/main/_examples/routing/subdomains/redirect
func (app *Application) SubdomainRedirect(from, to router.Party) router.Party { func (app *Application) SubdomainRedirect(from, to router.Party) router.Party {
sd := router.NewSubdomainRedirectWrapper(app.ConfigurationReadOnly().GetVHost, from.GetRelPath(), to.GetRelPath()) sd := router.NewSubdomainRedirectWrapper(app.ConfigurationReadOnly().GetVHost, from.GetRelPath(), to.GetRelPath())
app.Router.AddRouterWrapper(sd) app.Router.AddRouterWrapper(sd)
@ -803,7 +803,7 @@ type Runner func(*Application) error
// Via host configurators you can configure the back-end host supervisor, // Via host configurators you can configure the back-end host supervisor,
// i.e to add events for shutdown, serve or error. // i.e to add events for shutdown, serve or error.
// An example of this use case can be found at: // An example of this use case can be found at:
// https://github.com/kataras/iris/blob/master/_examples/http-server/notify-on-shutdown/main.go // https://github.com/kataras/iris/blob/main/_examples/http-server/notify-on-shutdown/main.go
// Look at the `ConfigureHost` too. // Look at the `ConfigureHost` too.
// //
// See `Run` for more. // See `Run` for more.
@ -825,7 +825,7 @@ func Listener(l net.Listener, hostConfigs ...host.Configurator) Runner {
// Via host configurators you can configure the back-end host supervisor, // Via host configurators you can configure the back-end host supervisor,
// i.e to add events for shutdown, serve or error. // i.e to add events for shutdown, serve or error.
// An example of this use case can be found at: // An example of this use case can be found at:
// https://github.com/kataras/iris/blob/master/_examples/http-server/notify-on-shutdown/main.go // https://github.com/kataras/iris/blob/main/_examples/http-server/notify-on-shutdown/main.go
// Look at the `ConfigureHost` too. // Look at the `ConfigureHost` too.
// //
// See `Run` for more. // See `Run` for more.
@ -849,7 +849,7 @@ func Server(srv *http.Server, hostConfigs ...host.Configurator) Runner {
// Via host configurators you can configure the back-end host supervisor, // Via host configurators you can configure the back-end host supervisor,
// i.e to add events for shutdown, serve or error. // i.e to add events for shutdown, serve or error.
// An example of this use case can be found at: // An example of this use case can be found at:
// https://github.com/kataras/iris/blob/master/_examples/http-server/notify-on-shutdown/main.go // https://github.com/kataras/iris/blob/main/_examples/http-server/notify-on-shutdown/main.go
// Look at the `ConfigureHost` too. // Look at the `ConfigureHost` too.
// //
// See `Run` for more. // See `Run` for more.
@ -910,7 +910,7 @@ var (
// Via host configurators you can configure the back-end host supervisor, // Via host configurators you can configure the back-end host supervisor,
// i.e to add events for shutdown, serve or error. // i.e to add events for shutdown, serve or error.
// An example of this use case can be found at: // An example of this use case can be found at:
// https://github.com/kataras/iris/blob/master/_examples/http-server/notify-on-shutdown/main.go // https://github.com/kataras/iris/blob/main/_examples/http-server/notify-on-shutdown/main.go
// Look at the `ConfigureHost` too. // Look at the `ConfigureHost` too.
// //
// See `Run` for more. // See `Run` for more.
@ -949,7 +949,7 @@ func TLS(addr string, certFileOrContents, keyFileOrContents string, hostConfigs
// Via host configurators you can configure the back-end host supervisor, // Via host configurators you can configure the back-end host supervisor,
// i.e to add events for shutdown, serve or error. // i.e to add events for shutdown, serve or error.
// An example of this use case can be found at: // An example of this use case can be found at:
// https://github.com/kataras/iris/blob/master/_examples/http-server/notify-on-shutdown/main.go // https://github.com/kataras/iris/blob/main/_examples/http-server/notify-on-shutdown/main.go
// Look at the `ConfigureHost` too. // Look at the `ConfigureHost` too.
// //
// Usage: // Usage:

View File

@ -513,7 +513,7 @@ var (
// Defaults contains the defaults macro and parameters types for the router. // Defaults contains the defaults macro and parameters types for the router.
// //
// Read https://github.com/kataras/iris/tree/master/_examples/routing/macros for more details. // Read https://github.com/kataras/iris/tree/main/_examples/routing/macros for more details.
Defaults = &Macros{ Defaults = &Macros{
String, String,
Int, Int,
@ -549,7 +549,7 @@ type Macros []*Macro
// The "evaluator" is the function that is converted to an Iris handler which is executed every time // The "evaluator" is the function that is converted to an Iris handler which is executed every time
// before the main chain of a route's handlers that contains this macro of the specific parameter type. // before the main chain of a route's handlers that contains this macro of the specific parameter type.
// //
// Read https://github.com/kataras/iris/tree/master/_examples/routing/macros for more details. // Read https://github.com/kataras/iris/tree/main/_examples/routing/macros for more details.
func (ms *Macros) Register(indent, alias string, isMaster, isTrailing bool, evaluator ParamEvaluator) *Macro { func (ms *Macros) Register(indent, alias string, isMaster, isTrailing bool, evaluator ParamEvaluator) *Macro {
macro := NewMacro(indent, alias, isMaster, isTrailing, evaluator) macro := NewMacro(indent, alias, isMaster, isTrailing, evaluator)
if ms.register(macro) { if ms.register(macro) {

View File

@ -3,17 +3,17 @@ Builtin Handlers
| Middleware | Example | | Middleware | Example |
| -----------|-------------| | -----------|-------------|
| [rewrite](rewrite) | [iris/_examples/routing/rewrite](https://github.com/kataras/iris/tree/master/_examples/routing/rewrite) | | [rewrite](rewrite) | [iris/_examples/routing/rewrite](https://github.com/kataras/iris/tree/main/_examples/routing/rewrite) |
| [basic authentication](basicauth) | [iris/_examples/auth/basicauth](https://github.com/kataras/iris/tree/master/_examples/auth/basicauth) | | [basic authentication](basicauth) | [iris/_examples/auth/basicauth](https://github.com/kataras/iris/tree/main/_examples/auth/basicauth) |
| [request logger](logger) | [iris/_examples/logging/request-logger](https://github.com/kataras/iris/tree/master/_examples/logging/request-logger) | | [request logger](logger) | [iris/_examples/logging/request-logger](https://github.com/kataras/iris/tree/main/_examples/logging/request-logger) |
| [HTTP method override](methodoverride) | [iris/middleware/methodoverride/methodoverride_test.go](https://github.com/kataras/iris/blob/master/middleware/methodoverride/methodoverride_test.go) | | [HTTP method override](methodoverride) | [iris/middleware/methodoverride/methodoverride_test.go](https://github.com/kataras/iris/blob/main/middleware/methodoverride/methodoverride_test.go) |
| [profiling (pprof)](pprof) | [iris/_examples/pprof](https://github.com/kataras/iris/tree/master/_examples/pprof) | | [profiling (pprof)](pprof) | [iris/_examples/pprof](https://github.com/kataras/iris/tree/main/_examples/pprof) |
| [Google reCAPTCHA](recaptcha) | [iris/_examples/auth/recaptcha](https://github.com/kataras/iris/tree/master/_examples/auth/recaptcha) | | [Google reCAPTCHA](recaptcha) | [iris/_examples/auth/recaptcha](https://github.com/kataras/iris/tree/main/_examples/auth/recaptcha) |
| [hCaptcha](hcaptcha) | [iris/_examples/auth/recaptcha](https://github.com/kataras/iris/tree/master/_examples/auth/hcaptcha) | | [hCaptcha](hcaptcha) | [iris/_examples/auth/recaptcha](https://github.com/kataras/iris/tree/main/_examples/auth/hcaptcha) |
| [recovery](recover) | [iris/_examples/recover](https://github.com/kataras/iris/tree/master/_examples/recover) | | [recovery](recover) | [iris/_examples/recover](https://github.com/kataras/iris/tree/main/_examples/recover) |
| [rate](rate) | [iris/_examples/request-ratelimit](https://github.com/kataras/iris/tree/master/_examples/request-ratelimit) | | [rate](rate) | [iris/_examples/request-ratelimit](https://github.com/kataras/iris/tree/main/_examples/request-ratelimit) |
| [jwt](jwt) | [iris/_examples/auth/jwt](https://github.com/kataras/iris/tree/master/_examples/auth/jwt) | | [jwt](jwt) | [iris/_examples/auth/jwt](https://github.com/kataras/iris/tree/main/_examples/auth/jwt) |
| [requestid](requestid) | [iris/middleware/requestid/requestid_test.go](https://github.com/kataras/iris/blob/master/_examples/middleware/requestid/requestid_test.go) | | [requestid](requestid) | [iris/middleware/requestid/requestid_test.go](https://github.com/kataras/iris/blob/main/_examples/middleware/requestid/requestid_test.go) |
Community made Community made
------------ ------------
@ -38,14 +38,14 @@ Most of the experimental handlers are ported to work with _iris_'s handler form,
Third-Party Handlers Third-Party Handlers
------------ ------------
Iris has its own middleware form of `func(ctx iris.Context)` but it's also compatible with all `net/http` middleware forms. See [here](https://github.com/kataras/iris/tree/master/_examples/convert-handlers). Iris has its own middleware form of `func(ctx iris.Context)` but it's also compatible with all `net/http` middleware forms. See [here](https://github.com/kataras/iris/tree/main/_examples/convert-handlers).
Here's a small list of useful third-party handlers: Here's a small list of useful third-party handlers:
| Middleware | Description | | Middleware | Description |
| -----------|-------------| | -----------|-------------|
| [goth](https://github.com/markbates/goth) | OAuth, OAuth2 authentication. [Example](https://github.com/kataras/iris/tree/master/_examples/auth/goth) | | [goth](https://github.com/markbates/goth) | OAuth, OAuth2 authentication. [Example](https://github.com/kataras/iris/tree/main/_examples/auth/goth) |
| [permissions2](https://github.com/xyproto/permissions2) | Cookies, users and permissions. [Example](https://github.com/kataras/iris/tree/master/_examples/auth/permissions) | | [permissions2](https://github.com/xyproto/permissions2) | Cookies, users and permissions. [Example](https://github.com/kataras/iris/tree/main/_examples/auth/permissions) |
| [csp](https://github.com/awakenetworks/csp) | [Content Security Policy](https://www.w3.org/TR/CSP2/) (CSP) support | | [csp](https://github.com/awakenetworks/csp) | [Content Security Policy](https://www.w3.org/TR/CSP2/) (CSP) support |
| [delay](https://github.com/jeffbmartinez/delay) | Add delays/latency to endpoints. Useful when testing effects of high latency | | [delay](https://github.com/jeffbmartinez/delay) | Add delays/latency to endpoints. Useful when testing effects of high latency |
| [onthefly](https://github.com/xyproto/onthefly) | Generate TinySVG, HTML and CSS on the fly | | [onthefly](https://github.com/xyproto/onthefly) | Generate TinySVG, HTML and CSS on the fly |

View File

@ -260,9 +260,9 @@ const (
// See `File` package-level function too. // See `File` package-level function too.
// //
// Examples: // Examples:
// https://github.com/kataras/iris/tree/master/_examples/logging/request-logger/accesslog // https://github.com/kataras/iris/tree/main/_examples/logging/request-logger/accesslog
// https://github.com/kataras/iris/tree/master/_examples/logging/request-logger/accesslog-template // https://github.com/kataras/iris/tree/main/_examples/logging/request-logger/accesslog-template
// https://github.com/kataras/iris/tree/master/_examples/logging/request-logger/accesslog-broker // https://github.com/kataras/iris/tree/main/_examples/logging/request-logger/accesslog-broker
func New(w io.Writer) *AccessLog { func New(w io.Writer) *AccessLog {
ac := &AccessLog{ ac := &AccessLog{
Clock: clockFunc(time.Now), Clock: clockFunc(time.Now),

View File

@ -63,7 +63,10 @@ func LoadOptions(filename string) (opts Options) {
return return
} }
// Engine is the rewrite engine master structure. // Rewrite is a struct that represents a rewrite engine for Iris web framework.
// It contains a slice of redirect rules, an options struct, a logger, and a domain validator function.
// It provides methods to create, configure, and apply rewrite rules to HTTP requests and responses.
//
// Navigate through _examples/routing/rewrite for more. // Navigate through _examples/routing/rewrite for more.
type Engine struct { type Engine struct {
redirects []*redirectMatch redirects []*redirectMatch

View File

@ -258,7 +258,7 @@ var IgnoreEmbedded OptionFunc = func(c *ControllerActivator) {
// Default behavior can be changed through second, variadic, variable "options", // Default behavior can be changed through second, variadic, variable "options",
// e.g. Handle(controller, GRPC {Server: grpcServer, Strict: true}) // e.g. Handle(controller, GRPC {Server: grpcServer, Strict: true})
// //
// Examples at: https://github.com/kataras/iris/tree/master/_examples/mvc // Examples at: https://github.com/kataras/iris/tree/main/_examples/mvc
func (app *Application) Handle(controller interface{}, options ...Option) *Application { func (app *Application) Handle(controller interface{}, options ...Option) *Application {
c := app.handle(controller, options...) c := app.handle(controller, options...)
// Note: log on register-time, so they can catch any failures before build. // Note: log on register-time, so they can catch any failures before build.

View File

@ -16,11 +16,11 @@ Parse using embedded assets, Layouts and Party-specific layout, Template Funcs,
| 6 | Jet | [CloudyKit/jet](https://github.com/CloudyKit/jet) | | 6 | Jet | [CloudyKit/jet](https://github.com/CloudyKit/jet) |
| 7 | Ace | [yosssi/ace](https://github.com/yosssi/ace) | | 7 | Ace | [yosssi/ace](https://github.com/yosssi/ace) |
[List of Examples](https://github.com/kataras/iris/tree/master/_examples/view). [List of Examples](https://github.com/kataras/iris/tree/main/_examples/view).
[Benchmarks](https://github.com/kataras/iris/tree/master/_benchmarks/view). [Benchmarks](https://github.com/kataras/iris/tree/main/_benchmarks/view).
You can serve [quicktemplate](https://github.com/valyala/quicktemplate) files too, simply by using the `Context.ResponseWriter`, take a look at the [iris/_examples/view/quicktemplate](https://github.com/kataras/iris/tree/master/_examples/view/quicktemplate) example. You can serve [quicktemplate](https://github.com/valyala/quicktemplate) files too, simply by using the `Context.ResponseWriter`, take a look at the [iris/_examples/view/quicktemplate](https://github.com/kataras/iris/tree/main/_examples/view/quicktemplate) example.
## Overview ## Overview
@ -162,7 +162,7 @@ func hi(ctx iris.Context) {
} }
``` ```
Examples can be found here: https://github.com/kataras/iris/tree/master/_examples/view/embedding-templates-into-app and https://github.com/kataras/iris/tree/master/_examples/view/embedding-templates-into-app-bindata. Examples can be found here: https://github.com/kataras/iris/tree/main/_examples/view/embedding-templates-into-app and https://github.com/kataras/iris/tree/main/_examples/view/embedding-templates-into-app-bindata.
## Reload ## Reload

View File

@ -20,10 +20,10 @@ import (
// Pug(embed.FS, ".pug") or Pug(AssetFile(), ".pug") for embedded data. // Pug(embed.FS, ".pug") or Pug(AssetFile(), ".pug") for embedded data.
// //
// Examples: // Examples:
// https://github.com/kataras/iris/tree/master/_examples/view/template_pug_0 // https://github.com/kataras/iris/tree/main/_examples/view/template_pug_0
// https://github.com/kataras/iris/tree/master/_examples/view/template_pug_1 // https://github.com/kataras/iris/tree/main/_examples/view/template_pug_1
// https://github.com/kataras/iris/tree/master/_examples/view/template_pug_2 // https://github.com/kataras/iris/tree/main/_examples/view/template_pug_2
// https://github.com/kataras/iris/tree/master/_examples/view/template_pug_3 // https://github.com/kataras/iris/tree/main/_examples/view/template_pug_3
func Pug(fs interface{}, extension string) *HTMLEngine { func Pug(fs interface{}, extension string) *HTMLEngine {
s := HTML(fs, extension) s := HTML(fs, extension)
s.name = "Pug" s.name = "Pug"

View File

@ -240,7 +240,7 @@ var (
// //
// Examples can be found at: // Examples can be found at:
// //
// https://github.com/kataras/iris/tree/master/_examples/routing/http-wire-errors. // https://github.com/kataras/iris/tree/main/_examples/routing/http-wire-errors.
type Error struct { type Error struct {
ErrorCode ErrorCode `json:"http_error_code" yaml:"HTTPErrorCode"` ErrorCode ErrorCode `json:"http_error_code" yaml:"HTTPErrorCode"`
Message string `json:"message,omitempty" yaml:"Message"` Message string `json:"message,omitempty" yaml:"Message"`

View File

@ -14,7 +14,7 @@ import (
// //
// Example can be found at: // Example can be found at:
// //
// https://github.com/kataras/iris/tree/master/_examples/routing/http-wire-errors/custom-validation-errors // https://github.com/kataras/iris/tree/main/_examples/routing/http-wire-errors/custom-validation-errors
type ValidationError interface { type ValidationError interface {
error error