mirror of
https://github.com/kataras/iris.git
synced 2025-02-02 15:30:36 +01:00
Update to 7.1.1. Read HISTORY.md
Fix https://github.com/iris-contrib/community-board/issues/11 Read the latest fixes and features by visiting: https://github.com/kataras/iris/blob/master/HISTORY.md Former-commit-id: 7f35481f917673d0bbb356a4816d9cf54cc0c9ba
This commit is contained in:
parent
56938636b2
commit
a10e80842f
|
@ -29,6 +29,11 @@ Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.co
|
||||||
|
|
||||||
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
|
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
|
||||||
|
|
||||||
|
|
||||||
|
# Tu, 13 June 2017 | v7.1.1
|
||||||
|
|
||||||
|
Fix [that](https://github.com/iris-contrib/community-board/issues/11).
|
||||||
|
|
||||||
# Mo, 12 June 2017 | v7.1.0
|
# Mo, 12 June 2017 | v7.1.0
|
||||||
|
|
||||||
Fix [that](https://github.com/iris-contrib/community-board/issues/10).
|
Fix [that](https://github.com/iris-contrib/community-board/issues/10).
|
||||||
|
|
|
@ -6,7 +6,7 @@ A fast, cross-platform and efficient web framework with robust set of well-desig
|
||||||
[![Report card](https://img.shields.io/badge/report%20card%20-a%2B-F44336.svg?style=flat-square)](http://goreportcard.com/report/kataras/iris)
|
[![Report card](https://img.shields.io/badge/report%20card%20-a%2B-F44336.svg?style=flat-square)](http://goreportcard.com/report/kataras/iris)
|
||||||
[![Support forum](https://img.shields.io/badge/support-page-ec2eb4.svg?style=flat-square)](http://support.iris-go.com)
|
[![Support forum](https://img.shields.io/badge/support-page-ec2eb4.svg?style=flat-square)](http://support.iris-go.com)
|
||||||
[![Examples](https://img.shields.io/badge/howto-examples-3362c2.svg?style=flat-square)](https://github.com/kataras/iris/tree/master/_examples#table-of-contents)
|
[![Examples](https://img.shields.io/badge/howto-examples-3362c2.svg?style=flat-square)](https://github.com/kataras/iris/tree/master/_examples#table-of-contents)
|
||||||
[![Godocs](https://img.shields.io/badge/7.1.0-%20documentation-5272B4.svg?style=flat-square)](https://godoc.org/github.com/kataras/iris)
|
[![Godocs](https://img.shields.io/badge/7.1.1-%20documentation-5272B4.svg?style=flat-square)](https://godoc.org/github.com/kataras/iris)
|
||||||
[![Chat](https://img.shields.io/badge/community-%20chat-00BCD4.svg?style=flat-square)](https://kataras.rocket.chat/channel/iris)
|
[![Chat](https://img.shields.io/badge/community-%20chat-00BCD4.svg?style=flat-square)](https://kataras.rocket.chat/channel/iris)
|
||||||
[![Buy me a cup of coffee](https://img.shields.io/badge/support-%20open--source-F4A460.svg?logo=data:image%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiPjxwYXRoIGZpbGw9InJnYigyMjAsMjIwLDIyMCkiIGQ9Ik04ODYuNiwzMDUuM2MtNDUuNywyMDMuMS0xODcsMzEwLjMtNDA5LjYsMzEwLjNoLTc0LjFsLTUxLjUsMzI2LjloLTYybC0zLjIsMjEuMWMtMi4xLDE0LDguNiwyNi40LDIyLjYsMjYuNGgxNTguNWMxOC44LDAsMzQuNy0xMy42LDM3LjctMzIuMmwxLjUtOGwyOS45LTE4OS4zbDEuOS0xMC4zYzIuOS0xOC42LDE4LjktMzIuMiwzNy43LTMyLjJoMjMuNWMxNTMuNSwwLDI3My43LTYyLjQsMzA4LjktMjQyLjdDOTIxLjYsNDA2LjgsOTE2LjcsMzQ4LjYsODg2LjYsMzA1LjN6Ii8%2BPHBhdGggZmlsbD0icmdiKDIyMCwyMjAsMjIwKSIgZD0iTTc5MS45LDgzLjlDNzQ2LjUsMzIuMiw2NjQuNCwxMCw1NTkuNSwxMEgyNTVjLTIxLjQsMC0zOS44LDE1LjUtNDMuMSwzNi44TDg1LDg1MWMtMi41LDE1LjksOS44LDMwLjIsMjUuOCwzMC4ySDI5OWw0Ny4zLTI5OS42bC0xLjUsOS40YzMuMi0yMS4zLDIxLjQtMzYuOCw0Mi45LTM2LjhINDc3YzE3NS41LDAsMzEzLTcxLjIsMzUzLjItMjc3LjVjMS4yLTYuMSwyLjMtMTIuMSwzLjEtMTcuOEM4NDUuMSwxODIuOCw4MzMuMiwxMzAuOCw3OTEuOSw4My45TDc5MS45LDgzLjl6Ii8%2BPC9zdmc%2B)](https://github.com/kataras/iris#buy-me-a-cup-of-coffee)
|
[![Buy me a cup of coffee](https://img.shields.io/badge/support-%20open--source-F4A460.svg?logo=data:image%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiPjxwYXRoIGZpbGw9InJnYigyMjAsMjIwLDIyMCkiIGQ9Ik04ODYuNiwzMDUuM2MtNDUuNywyMDMuMS0xODcsMzEwLjMtNDA5LjYsMzEwLjNoLTc0LjFsLTUxLjUsMzI2LjloLTYybC0zLjIsMjEuMWMtMi4xLDE0LDguNiwyNi40LDIyLjYsMjYuNGgxNTguNWMxOC44LDAsMzQuNy0xMy42LDM3LjctMzIuMmwxLjUtOGwyOS45LTE4OS4zbDEuOS0xMC4zYzIuOS0xOC42LDE4LjktMzIuMiwzNy43LTMyLjJoMjMuNWMxNTMuNSwwLDI3My43LTYyLjQsMzA4LjktMjQyLjdDOTIxLjYsNDA2LjgsOTE2LjcsMzQ4LjYsODg2LjYsMzA1LjN6Ii8%2BPHBhdGggZmlsbD0icmdiKDIyMCwyMjAsMjIwKSIgZD0iTTc5MS45LDgzLjlDNzQ2LjUsMzIuMiw2NjQuNCwxMCw1NTkuNSwxMEgyNTVjLTIxLjQsMC0zOS44LDE1LjUtNDMuMSwzNi44TDg1LDg1MWMtMi41LDE1LjksOS44LDMwLjIsMjUuOCwzMC4ySDI5OWw0Ny4zLTI5OS42bC0xLjUsOS40YzMuMi0yMS4zLDIxLjQtMzYuOCw0Mi45LTM2LjhINDc3YzE3NS41LDAsMzEzLTcxLjIsMzUzLjItMjc3LjVjMS4yLTYuMSwyLjMtMTIuMSwzLjEtMTcuOEM4NDUuMSwxODIuOCw4MzMuMiwxMzAuOCw3OTEuOSw4My45TDc5MS45LDgzLjl6Ii8%2BPC9zdmc%2B)](https://github.com/kataras/iris#buy-me-a-cup-of-coffee)
|
||||||
|
|
||||||
|
@ -409,7 +409,7 @@ Besides the fact that we have a [community chat][Chat] for questions or reports
|
||||||
Version
|
Version
|
||||||
------------
|
------------
|
||||||
|
|
||||||
Current: **7.1.0**
|
Current: **7.1.1**
|
||||||
|
|
||||||
Each new release is pushed to the master. It stays there until the next version. When a next version is released then the previous version goes to its own branch with `gopkg.in` as its import path (and its own vendor folder), in order to keep it working "for-ever".
|
Each new release is pushed to the master. It stays there until the next version. When a next version is released then the previous version goes to its own branch with `gopkg.in` as its import path (and its own vendor folder), in order to keep it working "for-ever".
|
||||||
|
|
||||||
|
|
|
@ -58,6 +58,7 @@ It doesn't contains "best ways" neither explains all its features. It's just a s
|
||||||
* [Graceful Shutdown](intermediate/graceful-shutdown)
|
* [Graceful Shutdown](intermediate/graceful-shutdown)
|
||||||
* [Basic and simple](intermediate/graceful-shutdown/basic/main.go)
|
* [Basic and simple](intermediate/graceful-shutdown/basic/main.go)
|
||||||
* [Custom Host](intermediate/graceful-shutdown/custom-host/main.go)
|
* [Custom Host](intermediate/graceful-shutdown/custom-host/main.go)
|
||||||
|
* [Custom notifier](intermediate/graceful-shutdown/custom-notifier/main.go)
|
||||||
* [Custom HTTP Server](intermediate/custom-httpserver)
|
* [Custom HTTP Server](intermediate/custom-httpserver)
|
||||||
* [Iris way](intermediate/custom-httpserver/iris-way/main.go)
|
* [Iris way](intermediate/custom-httpserver/iris-way/main.go)
|
||||||
* [Standar way](intermediate/custom-httpserver/std-way/main.go)
|
* [Standar way](intermediate/custom-httpserver/std-way/main.go)
|
||||||
|
|
|
@ -12,7 +12,7 @@ import (
|
||||||
// Before continue, please read the below notes:
|
// Before continue, please read the below notes:
|
||||||
//
|
//
|
||||||
// Current version of Iris is auto-graceful on control+C/command+C
|
// Current version of Iris is auto-graceful on control+C/command+C
|
||||||
// or whenever host's .Shutdown called.
|
// or kill command sent or whenever app.Shutdown called.
|
||||||
//
|
//
|
||||||
// In order to add a custom interrupt handler(ctrl+c/cmd+c) or
|
// In order to add a custom interrupt handler(ctrl+c/cmd+c) or
|
||||||
// shutdown manually you have to "schedule a host supervisor's task" or
|
// shutdown manually you have to "schedule a host supervisor's task" or
|
||||||
|
@ -29,7 +29,7 @@ func main() {
|
||||||
|
|
||||||
// tasks are always running in their go-routine by-default.
|
// tasks are always running in their go-routine by-default.
|
||||||
//
|
//
|
||||||
// register custom interrupt handler, fires when ctrl+C/cmd+C pressed.
|
// register custom interrupt handler, fires when ctrl+C/cmd+C pressed or kill command sent.
|
||||||
app.Scheduler.Schedule(host.OnInterrupt(func(proc host.TaskProcess) {
|
app.Scheduler.Schedule(host.OnInterrupt(func(proc host.TaskProcess) {
|
||||||
println("Shutdown the server gracefully...")
|
println("Shutdown the server gracefully...")
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ func main() {
|
||||||
|
|
||||||
// tasks are always running in their go-routine by-default.
|
// tasks are always running in their go-routine by-default.
|
||||||
//
|
//
|
||||||
// register custom interrupt handler, fires when ctrl+C/cmd+C pressed, as we did before.
|
// register custom interrupt handler, fires when ctrl+C/cmd+C pressed or kill command sent, as we did before.
|
||||||
srv.Schedule(host.OnInterrupt(func(proc host.TaskProcess) {
|
srv.Schedule(host.OnInterrupt(func(proc host.TaskProcess) {
|
||||||
println("Shutdown the server gracefully...")
|
println("Shutdown the server gracefully...")
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,48 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
stdContext "context"
|
||||||
|
"os"
|
||||||
|
"os/signal"
|
||||||
|
"syscall"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/kataras/iris"
|
||||||
|
"github.com/kataras/iris/context"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
app := iris.New()
|
||||||
|
// output startup banner and error logs on os.Stdout
|
||||||
|
|
||||||
|
app.Get("/", func(ctx context.Context) {
|
||||||
|
ctx.HTML(" <h1>hi, I just exist in order to see if the server is closed</h1>")
|
||||||
|
})
|
||||||
|
|
||||||
|
go func() {
|
||||||
|
ch := make(chan os.Signal, 1)
|
||||||
|
signal.Notify(ch,
|
||||||
|
// kill -SIGINT XXXX or Ctrl+c
|
||||||
|
os.Interrupt,
|
||||||
|
syscall.SIGINT, // register that too, it should be ok
|
||||||
|
// os.Kill is equivalent with the syscall.Kill
|
||||||
|
os.Kill,
|
||||||
|
syscall.SIGKILL, // register that too, it should be ok
|
||||||
|
// kill -SIGTERM XXXX
|
||||||
|
syscall.SIGTERM,
|
||||||
|
)
|
||||||
|
select {
|
||||||
|
case <-ch:
|
||||||
|
println("Shutdown the server gracefully...")
|
||||||
|
|
||||||
|
timeout := 5 * time.Second // give the server 5 seconds to wait for idle connections.
|
||||||
|
ctx, cancel := stdContext.WithTimeout(stdContext.Background(), timeout)
|
||||||
|
defer cancel()
|
||||||
|
app.Shutdown(ctx)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
|
// Start the server and disable the default interrupt handler in order to handle it clear and simple by our own, without
|
||||||
|
// any issues.
|
||||||
|
app.Run(iris.Addr(":8080"), iris.WithoutInterruptHandler)
|
||||||
|
}
|
|
@ -13,6 +13,7 @@ import (
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"sync"
|
"sync"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
|
"syscall"
|
||||||
|
|
||||||
"github.com/kataras/iris/core/errors"
|
"github.com/kataras/iris/core/errors"
|
||||||
"github.com/kataras/iris/core/nettools"
|
"github.com/kataras/iris/core/nettools"
|
||||||
|
@ -138,7 +139,16 @@ func (su *Supervisor) supervise(blockFunc func() error) error {
|
||||||
// we do it here. These tasks are canceled already too.
|
// we do it here. These tasks are canceled already too.
|
||||||
go func() {
|
go func() {
|
||||||
ch := make(chan os.Signal, 1)
|
ch := make(chan os.Signal, 1)
|
||||||
signal.Notify(ch, os.Interrupt, os.Kill)
|
signal.Notify(ch,
|
||||||
|
// kill -SIGINT XXXX or Ctrl+c
|
||||||
|
os.Interrupt,
|
||||||
|
syscall.SIGINT, // register that too, it should be ok
|
||||||
|
// os.Kill is equivalent with the syscall.SIGKILL
|
||||||
|
os.Kill,
|
||||||
|
syscall.SIGKILL, // register that too, it should be ok
|
||||||
|
// kill -SIGTERM XXXX
|
||||||
|
syscall.SIGTERM,
|
||||||
|
)
|
||||||
select {
|
select {
|
||||||
case <-ch:
|
case <-ch:
|
||||||
su.Scheduler.runOnInterrupt(host)
|
su.Scheduler.runOnInterrupt(host)
|
||||||
|
|
2
iris.go
2
iris.go
|
@ -41,7 +41,7 @@ const (
|
||||||
// Version is the current version number of the Iris Web framework.
|
// Version is the current version number of the Iris Web framework.
|
||||||
//
|
//
|
||||||
// Look https://github.com/kataras/iris#where-can-i-find-older-versions for older versions.
|
// Look https://github.com/kataras/iris#where-can-i-find-older-versions for older versions.
|
||||||
Version = "7.1.0"
|
Version = "7.1.1"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
Loading…
Reference in New Issue
Block a user