https://github.com/kataras/iris/issues
https://chat.iris-go.com
https://github.com/kataras/iris/releases
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
Iris uses the vendor directory feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
How to upgrade: Open your command-line and execute this command: go get -u github.com/kataras/iris
or let the automatic updater do that for you.
Every server should be upgraded to this version, it contains fixes for the tls-sni challenge disabled some days ago by letsencrypt.org which caused almost every https-enabled golang server to be unable to be functional, therefore support for the http-01 challenge type added. Now the server is testing all available letsencrypt challenges.
Read more at:
- https://letsencrypt.status.io/pages/incident/55957a99e800baa4470002da/5a55777ed9a9c1024c00b241
- https://github.com/golang/crypto/commit/13931e22f9e72ea58bb73048bc752b48c6d4d4ac
Not any serious problems were found to be resolved here but one, the first one which is important for devs that used the cache package.
- fix a single one cache handler didn't work across multiple route handlers at the same time kataras#852, as reported at kataras#850
- merge PR kataras#862
- do not allow concurrent access to the
ExecuteWriter -> Load
whenview#Engine##Reload
was true, as requested at kataras#872 - badge for open-source projects powered by Iris, learn how to add that badge to your open-source project at FAQ.md file
- upstream update for
golang/crypto
to apply the fix about the tls-sni challenge disabled https://github.com/golang/crypto/commit/13931e22f9e72ea58bb73048bc752b48c6d4d4ac (relative to iris.AutoTLS)
- The Chinese README_ZH.md and HISTORY_ZH.md was translated by @Zeno-Code via kataras#858
- New Russian README_RU.md translations by @merrydii via kataras#857
- New Greek README_GR.md and HISTORY_GR.md translations via https://github.com/kataras/iris/commit/8c4e17c2a5433c36c148a51a945c4dc35fbe502a#diff-74b06c740d860f847e7b577ad58ddde0 and https://github.com/kataras/iris/commit/bb5a81c540b34eaf5c6c8e993f644a0e66a78fb8
- A Todo MVC Application using Iris and Vue.js
- A Hasura starter project with a ready to deploy Golang hello-world web app with IRIS
We must thanks Mrs. Diana for our awesome new logo!
You can contact her for any design-related enquiries or explore and send a direct message via instagram.
At this version we have many internal improvements but just two major changes and one big feature, called hero.
The new version adds 75 plus new commits, the PR is located here read the internal changes if you are developing a web framework based on Iris. Why 9 was skipped? Because.
The new package hero contains features for binding any object or function that handlers
may use, these are called dependencies. Hero funcs can also return any type of values, these values will be dispatched to the client.
You may saw binding before but you didn't have code editor's support, with Iris you get truly safe binding thanks to the new
hero
package. It's also fast, near to raw handlers performance because Iris calculates everything before server ran!
Below you will see some screenshots we prepared for you in order to be easier to understand:
hero funcs
are very easy to understand and when you start using them you never go back.
Examples:
You have to understand the hero
package in order to use the mvc
, because mvc
uses the hero
internally for the controller's methods you use as routes, the same rules applied to those controller's methods of yours as well.
With this version you can register any controller's methods as routes manually, you can get a route based on a method name and change its Name
(useful for reverse routing inside templates), you can use any dependencies registered from hero.Register
or mvc.New(iris.Party).Register
per mvc application or per-controller, you can still use BeginRequest
and EndRequest
, you can catch BeforeActivation(b mvc.BeforeActivation)
to add dependencies per controller and AfterActivation(a mvc.AfterActivation)
to make any post-validations, singleton controllers when no dynamic dependencies are used, Websocket controller, as simple as a websocket.Connection
dependency and more...
Examples:
If you used MVC before then read very carefully: MVC CONTAINS SOME BREAKING CHANGES BUT YOU CAN DO A LOT MORE AND EVEN FASTER THAN BEFORE
PLEASE READ THE EXAMPLES CAREFULLY, WE'VE MADE THEM FOR YOU
Old examples are here as well. Compare the two different versions of each example to understand what you win if you upgrade now.
Remove the old static variable context.DefaultMaxMemory
and replace it with the configuration WithPostMaxMemory
.
// WithPostMaxMemory sets the maximum post data size
// that a client can send to the server, this differs
// from the overral request body size which can be modified
// by the `context#SetMaxRequestBodySize` or `iris#LimitRequestBodySize`.
//
// Defaults to 32MB or 32 << 20 if you prefer.
func WithPostMaxMemory(limit int64) Configurator
If you used that old static field you will have to change that single line.
Usage:
import "github.com/kataras/iris"
func main() {
app := iris.New()
// [...]
app.Run(iris.Addr(":8080"), iris.WithPostMaxMemory(10 << 20))
}
New method to upload multiple files, should be used for common upload actions, it's just a helper function.
// UploadFormFiles uploads any received file(s) from the client
// to the system physical location "destDirectory".
//
// The second optional argument "before" gives caller the chance to
// modify the *miltipart.FileHeader before saving to the disk,
// it can be used to change a file's name based on the current request,
// all FileHeader's options can be changed. You can ignore it if
// you don't need to use this capability before saving a file to the disk.
//
// Note that it doesn't check if request body streamed.
//
// Returns the copied length as int64 and
// a not nil error if at least one new file
// can't be created due to the operating system's permissions or
// http.ErrMissingFile if no file received.
//
// If you want to receive & accept files and manage them manually you can use the `context#FormFile`
// instead and create a copy function that suits your needs, the below is for generic usage.
//
// 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.
//
// See `FormFile` to a more controlled to receive a file.
func (ctx *context) UploadFormFiles(
destDirectory string,
before ...func(string, string),
) (int64, error)
Example can be found here.
Just a minor addition, add a second optional variadic argument to the context#View
method to accept a single value for template binding.
When you just want one value and not key-value pairs, you used to use an empty string on the ViewData
, which is fine, especially if you preload these from a previous handler/middleware in the request handlers chain.
func(ctx iris.Context) {
ctx.ViewData("", myItem{Name: "iris" })
ctx.View("item.html")
}
Same as:
func(ctx iris.Context) {
ctx.View("item.html", myItem{Name: "iris" })
}
Item's name: {{.Name}}
Add a new context#YAML
function, it renders a yaml from a structured value.
// YAML marshals the "v" using the yaml marshaler and renders its result to the client.
func YAML(v interface{}) (int, error)
sessions/session#GetString
can now return a filled value even if the stored value is a type of integer, just like the memstore, the context's temp store, the context's path parameters and the context's url parameters.