Update to 6.1.4 - Align with the improved kataras/go-sessions

This commit is contained in:
Gerasimos (Makis) Maropoulos 2017-02-07 02:37:35 +02:00
parent 84cd4ca6f4
commit 5aaec72634
4 changed files with 34 additions and 31 deletions

View File

@ -17,7 +17,7 @@ Users should prepare their apps for:
Iris is bigger than it was, we need to keep a limit on the exported functions to help users understand the flow much easier.
Users often asked questions about built'n features and functions usage because they are being confused of the big public API (`iris.` vs `app := iris.New(); app.`).
This removal will also let me to describe the types with more sense.
- NEW feature: `app.Adapt(iris.Policy)` which you will be able to adapt a **custom http router**, **custom template functions**, **custom http router wrappers**, **flow events** and much more. I'll cover these on book and examples when it will be released.
- Replace: `.Plugins.` with `EventPolicy`: `app.Adapt(iris.EventPolicy{ Boot: func(*iris.Framework){}} )`.
@ -29,19 +29,37 @@ Users should prepare their apps for:
- Replace: `.AcquireCtx/.ReleaseCtx` with `app.Context.Acquire/Release/Run`.
- NEW feature: able to pass an `func(http.ResponseWriter, *http.Request, http.HandlerFunc)` third-party net/http middleware like normal
iris.HandlerFunc with `iris.ToHandler`. (I already pushed that to the current version, because I think it will make your life easier now).
- IMPROVEMENT: Now you're able to pass an `func(http.ResponseWriter, *http.Request, http.HandlerFunc)` third-party net/http middleware(Chain-of-responsibility pattern) using the `iris.ToHandler` wrapper func without any other custom boilerplate.
* already pushed to the current version
- FIX: `iris run main.go` didn't reload the app on file changes when saving a source file via some IDEs,
- FIX: [iris run main.go](https://github.com/kataras/iris/tree/master/iris#run) not reloading when file changes maden by some of the IDEs,
because they do override the operating system's fs signals. The majority of
editors worked before but I couldn't let some developers without support. (I already pushed that to the current version)
editors worked before but I couldn't let some developers without support.
* already pushed to the current version
- FIX: custom routers not working well with static file serving, reverse routing and per-party http custom errors.
- IMPROVEMENT: [Sessions manager](https://github.com/kataras/go-sessions) works even faster now.
* already pushed to the current version
- NEW: HTTP/2 Push `context.Push`
The full list of next version's features among with one by one steps to refactor your code in breaking-cases will be noticed here when it will be released.
## 6.1.3 -> 6.1.4
- FIX: [iris run main.go](https://github.com/kataras/iris/tree/master/iris#run) not reloading when file changes maden by some of the IDEs,
because they do override the operating system's fs signals. The majority of
editors worked before but I couldn't let some developers without support.
- IMPROVEMENT: Now you're able to pass an `func(http.ResponseWriter, *http.Request, http.HandlerFunc)` third-party net/http middleware(Chain-of-responsibility pattern) using the `iris.ToHandler` wrapper func without any other custom boilerplate.
- IMPROVEMENT: [Sessions manager](https://github.com/kataras/go-sessions) works even faster now.
## 6.1.2 -> 6.1.3
- Added a configuration field `iris.Config.DisableBodyConsumptionOnUnmarshal`

View File

@ -1,7 +1,8 @@
<p align="center">
<a href="https://www.gitbook.com/book/kataras/iris/details">
<img width="500" src="https://raw.githubusercontent.com/kataras/iris/master/logo.jpg"
alt="Logo created by an Iris community member, @OneebMalik">
alt="Logo created by an Iris community member, https://github.com/OneebMalik"
title="Logo created by an Iris community member, https://github.com/OneebMalik">
</a>
<br/>
@ -20,7 +21,7 @@
<br/>
<a href="https://github.com/kataras/iris/blob/master/HISTORY.md"><img src="https://img.shields.io/badge/%20version%20-%206.1.3%20-blue.svg?style=flat-square" alt="CHANGELOG/HISTORY"></a>
<a href="https://github.com/kataras/iris/blob/master/HISTORY.md"><img src="https://img.shields.io/badge/%20version%20-%206.1.4%20-blue.svg?style=flat-square" alt="CHANGELOG/HISTORY"></a>
<a href="https://github.com/iris-contrib/examples"><img src="https://img.shields.io/badge/%20examples-repository-3362c2.svg?style=flat-square" alt="Examples"></a>
@ -199,6 +200,7 @@ Today I spend all my days and nights coding for Iris, and I'm happy about this,
- Star the project, will help you to follow the upcoming features.
- [Donate](https://github.com/kataras/iris/blob/master/DONATIONS.md), if you can afford any cost.
- Write an article about Iris or even post a Tweet.
- Do Pull Requests on the [iris-contrib](https://github.com/iris-contrib) organisation's repositories, like book and examples.
If you are interested in contributing to the Iris project, please see the document [CONTRIBUTING](https://github.com/kataras/iris/blob/master/.github/CONTRIBUTING.md).
@ -216,7 +218,7 @@ Besides the fact that we have a [community chat][Chat] for questions or reports
Versioning
------------
Current: **v6.1.3**
Current: **v6.1.4**
v5: https://github.com/kataras/iris/tree/5.0.0

View File

@ -557,17 +557,6 @@ var (
}
}
// OptionSessionsGcDuration every how much duration(GcDuration) the memory should be clear for unused cookies (GcDuration)
// for example: time.Duration(2)*time.Hour. it will check every 2 hours if cookie hasn't be used for 2 hours,
// deletes it from backend memory until the user comes back, then the session continue to work as it was
//
// Default 2 hours
OptionSessionsGcDuration = func(val time.Duration) OptionSet {
return func(c *Configuration) {
c.Sessions.GcDuration = val
}
}
// OptionSessionsDisableSubdomainPersistence set it to true in order dissallow your q subdomains to have access to the session cookie
// Defaults to false
OptionSessionsDisableSubdomainPersistence = func(val bool) OptionSet {
@ -585,8 +574,6 @@ var (
const (
// DefaultCookieName the secret cookie's name for sessions
DefaultCookieName = "irissessionid"
// DefaultSessionGcDuration is the default Session Manager's GCDuration , which is 2 hours
DefaultSessionGcDuration = time.Duration(2) * time.Hour
// DefaultCookieLength is the default Session Manager's CookieLength, which is 32
DefaultCookieLength = 32
)
@ -598,9 +585,7 @@ func DefaultSessionsConfiguration() SessionsConfiguration {
CookieLength: DefaultCookieLength,
DecodeCookie: false,
Expires: 0,
GcDuration: DefaultSessionGcDuration,
DisableSubdomainPersistence: false,
DisableAutoGC: true,
}
}

14
iris.go
View File

@ -81,7 +81,7 @@ const (
// IsLongTermSupport flag is true when the below version number is a long-term-support version
IsLongTermSupport = false
// Version is the current version number of the Iris web framework
Version = "6.1.3"
Version = "6.1.4"
banner = ` _____ _
|_ _| (_)
@ -315,8 +315,9 @@ func New(setters ...OptionSetter) *Framework {
// the whole ws configuration and websocket server is really initialized only on first OnConnection
s.Websocket = NewWebsocketServer(s)
// set the sessions, look .initialize for its GC
s.sessions = sessions.New(sessions.DisableAutoGC(true))
// set the sessions in order to UseSessionDB to work
// see Build state
s.sessions = sessions.New()
}
// routing
@ -423,11 +424,8 @@ func (s *Framework) Build() {
}
}
// init, starts the session manager if the Cookie configuration field is not empty
if s.Config.Sessions.Cookie != "" {
// re-set the configuration field for any case
s.sessions.Set(s.Config.Sessions, sessions.DisableAutoGC(false))
}
// set the user's configuration (may changed after .New())
s.sessions.Set(s.Config.Sessions)
// prepare the mux runtime fields again, for any case
s.mux.setCorrectPath(!s.Config.DisablePathCorrection)