mirror of
https://github.com/kataras/iris.git
synced 2025-02-02 07:20:35 +01:00
Update to version 8.5.4 | Read HISTORY.md
https://github.com/kataras/iris/blob/master/HISTORY.md#th-26-october-2017--v854 Former-commit-id: 43a3b46b99085e0e0ed47b281e2f61dbb1ac6eb6
This commit is contained in:
parent
3c5f729f40
commit
4a63488948
|
@ -14,12 +14,33 @@ First of all read our [Code of Conduct](https://github.com/kataras/iris/tree/mas
|
|||
3. Make your changes.
|
||||
4. Compare & Push the PR from [here](https://github.com/kataras/iris/compare).
|
||||
|
||||
## Donate
|
||||
|
||||
Help this project to continue deliver awesome and unique features with the higher code quality as possible by donating any amount via [PayPal](https://www.paypal.me/kataras) or [BTC](https://iris-go.com/v8/donate)!
|
||||
|
||||
| Name | Amount | Membership |
|
||||
| -----------|--------|--------|
|
||||
| [Juan Sebastián Suárez Valencia](https://github.com/Juanses) | 20 EUR | Bronze |
|
||||
| [Bob Lee](https://github.com/li3p) | 20 EUR | Bronze |
|
||||
| [Celso Luiz](https://github.com/celsosz) | 50 EUR | **Silver** |
|
||||
| [Ankur Srivastava](https://github.com/ansrivas) | 20 EUR | Bronze |
|
||||
| [Damon Zhao](https://github.com/se77en) | 20 EUR | Bronze |
|
||||
| [Exponity - Tech Company](https://github.com/exponity) | 30 EUR | Bronze |
|
||||
| [Thomas Fritz](https://github.com/thomasfr) | 25 EUR | Bronze |
|
||||
| [Thanos V.](http://mykonosbiennale.com/) | 20 EUR | Bronze |
|
||||
| [George Opritescu](https://github.com/International) | 20 EUR | Bronze |
|
||||
| [Lex Tang](https://github.com/lexrus) | 20 EUR | Bronze |
|
||||
| [Bill Q.](https://github.com/hiveminded) | 600 EUR | **Gold** |
|
||||
| [Conrad Steenberg](https://github.com/hengestone) | 25 EUR | Bronze |
|
||||
|
||||
## Share
|
||||
|
||||
### Writing
|
||||
|
||||
Write an article about Iris in https://medium.com , https://dev.to or if you're being a hackathon at https://hackernoon.com, some examples:
|
||||
|
||||
* [How to build a file upload form using DropzoneJS and Go](https://hackernoon.com/how-to-build-a-file-upload-form-using-dropzonejs-and-go-8fb9f258a991)
|
||||
* [How to display existing files on server using DropzoneJS and Go](https://hackernoon.com/how-to-display-existing-files-on-server-using-dropzonejs-and-go-53e24b57ba19)
|
||||
* [Iris Go vs .NET Core Kestrel in terms of HTTP performance](https://hackernoon.com/iris-go-vs-net-core-kestrel-in-terms-of-http-performance-806195dc93d5)
|
||||
* [Go vs .NET Core in terms of HTTP performance](https://medium.com/@kataras/go-vs-net-core-in-terms-of-http-performance-7535a61b67b8)
|
||||
* [Iris, a modular web framework](https://medium.com/@corebreaker/iris-web-cd684b4685c7)
|
12
Gopkg.lock
generated
12
Gopkg.lock
generated
|
@ -139,6 +139,18 @@
|
|||
packages = [".","terminal"]
|
||||
revision = "825e39f34365e7db2c9fbc3692c16220e3bd7418"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "github.com/kataras/survey"
|
||||
packages = ["."]
|
||||
revision = "20e139a6d2469769ae88e0a3579ba5df71839ca7"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "github.com/skratchdot/open-golang"
|
||||
packages = ["."]
|
||||
revision = "75fb7ed4208cf72d323d7d02fd1a5964a7a9073c"
|
||||
|
||||
[[projects]]
|
||||
name = "github.com/klauspost/compress"
|
||||
packages = ["flate","gzip"]
|
||||
|
|
|
@ -58,6 +58,14 @@
|
|||
branch = "master"
|
||||
name = "github.com/kataras/golog"
|
||||
|
||||
[[constraint]]
|
||||
branch = "master"
|
||||
name = "github.com/kataras/survey"
|
||||
|
||||
[[constraint]]
|
||||
branch = "master"
|
||||
name = "github.com/skratchdot/open-golang"
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/klauspost/compress"
|
||||
version = "1.2.1"
|
||||
|
|
12
HISTORY.md
12
HISTORY.md
|
@ -2,7 +2,7 @@
|
|||
|
||||
### Looking for free and real-time support?
|
||||
|
||||
http://support.iris-go.com
|
||||
https://support.iris-go.com
|
||||
https://chat.iris-go.com
|
||||
|
||||
### Looking for previous versions?
|
||||
|
@ -17,6 +17,14 @@ Developers are not forced to upgrade if they don't really need it. Upgrade whene
|
|||
|
||||
**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.
|
||||
|
||||
# Th, 26 October 2017 | v8.5.4
|
||||
|
||||
No new features or fixes (all reported bugs are fixed) in this version, just a tiny improvement.
|
||||
|
||||
- ENHANCEMENT: More friendly version checker!
|
||||
|
||||
> Remember: If you don't want to keep the version checker and you're pretty sure that you will be able to keep your server up-to-date manually, then you can disable the auto updater via; `app.Run(..., iris.WithoutVersionChecker)`.
|
||||
|
||||
# Su, 22 October 2017 | v8.5.3
|
||||
|
||||
- FIX: [Websocket: memory leak on startPinger](https://github.com/kataras/iris/issues/787) by @jerson with PR: https://github.com/kataras/iris/pull/788
|
||||
|
@ -26,7 +34,7 @@ Developers are not forced to upgrade if they don't really need it. Upgrade whene
|
|||
|
||||
### 🎗️ People that you should follow
|
||||
|
||||
Help this project to continue deliver awesome and unique features with the higher code quality as possible by donating any amount via [PayPal](https://www.paypal.me/kataras) or [Bitcoins](https://iris-go.com/v8/donate)!
|
||||
Help this project to continue deliver awesome and unique features with the higher code quality as possible by donating any amount via [PayPal](https://www.paypal.me/kataras) or [BTC](https://iris-go.com/v8/donate)!
|
||||
|
||||
| Name | Amount | Membership |
|
||||
| -----------|--------|--------|
|
||||
|
|
194
README.md
194
README.md
|
@ -1,76 +1,10 @@
|
|||
<!-- Moved to README_NEXT.md only.
|
||||
# ![Logo created by @santoshanand](logo_white_35_24.png) Iris [![build status](https://img.shields.io/travis/kataras/iris/master.svg?style=flat-square)](https://travis-ci.org/kataras/iris) [![report card](https://img.shields.io/badge/report%20card-a%2B-ff3333.svg?style=flat-square)](http://goreportcard.com/report/kataras/iris) [![github issues](https://img.shields.io/github/issues/kataras/iris.svg?style=flat-square)](https://github.com/kataras/iris/issues?q=is%3Aopen+is%3Aissue) [![github closed issues](https://img.shields.io/github/issues-closed-raw/kataras/iris.svg?style=flat-square)](https://github.com/kataras/iris/issues?q=is%3Aissue+is%3Aclosed) [![release](https://img.shields.io/github/release/kataras/iris.svg?style=flat-square)](https://github.com/kataras/iris/releases) [![view examples](https://img.shields.io/badge/learn%20by-examples-0077b3.svg?style=flat-square)](https://github.com/kataras/iris/tree/master/_examples) [![chat](https://img.shields.io/badge/community-%20chat-00BCD4.svg?style=flat-square)](https://kataras.rocket.chat/channel/iris) [![CLA assistant](https://cla-assistant.io/readme/badge/kataras/iris?style=flat-square)](https://cla-assistant.io/kataras/iris)
|
||||
|
||||
# 03, October 2017 | Iris User Experience Report
|
||||
Iris is a fast, simple and efficient web framework for Go.
|
||||
|
||||
Be part of the Iris evolution!
|
||||
Iris provides a beautifully expressive and easy to use foundation for your next website, API, or distributed app.
|
||||
|
||||
Complete the **first** Iris User Experience Report by submitting a simple form, it won't take more than **2 minutes**.
|
||||
|
||||
The form contains some questions that you may need to answer in order to learn more about you; learning more about you helps us to serve you with the best possible way!
|
||||
|
||||
https://docs.google.com/forms/d/e/1FAIpQLSdCxZXPANg_xHWil4kVAdhmh7EBBHQZ_4_xSZVDL-oCC_z5pA/viewform?usp=sf_link
|
||||
-->
|
||||
# ![Logo created by @santoshanand](logo_white_35_24.png) Iris
|
||||
|
||||
Iris is a fast, simple and efficient micro web framework for Go. It provides a beautifully expressive and easy to use foundation for your next website, API, or distributed app.
|
||||
|
||||
<!-- When we have completed the overall results, re-write this section:
|
||||
### About our User Experience Report
|
||||
|
||||
A week ago, _at 03 October_, we announced the first [Iris User Experience form-based Report](https://docs.google.com/forms/d/e/1FAIpQLSdCxZXPANg_xHWil4kVAdhmh7EBBHQZ_4_xSZVDL-oCC_z5pA/viewform?usp=sf_link) to let us learn more about you and any issues that troubles you with Iris (if any).
|
||||
|
||||
At overall, the results (so far) are very promising, high number of participations and the answers to the questions are near to the green feedback we were receiving over the past months from Gophers worldwide via our [rocket chat](https://chat.iris-go.com) and [author's twitter](https://twitter.com/makismaropoulos). **If you didn't complete the form yet, [please do so](https://docs.google.com/forms/d/e/1FAIpQLSdCxZXPANg_xHWil4kVAdhmh7EBBHQZ_4_xSZVDL-oCC_z5pA/viewform?usp=sf_link) as soon as possible!**
|
||||
|
||||
However, as everything in life; nothing goes as expected, people are strange, we programmers even more. The last part of the form has a text area which participiations can add any "questions or comments", there we saw one comment that surprised me the most, in the bad sense. We respect all individual singularities the same, we do not discriminate between people. The data are anonymous, so the only place to answer to that person is, _surprisingly_, here!
|
||||
|
||||
<details>
|
||||
<summary>"I admire your dedication to iris and I am in love with its speed..."</summary>
|
||||
|
||||
The comment was "I admire your dedication to iris and I am in love with its speed but.. I've read some things on that blog and blablabla..." you get the point, at the first we were happy and suddenly we saw that "but... I've" and we broke xD.
|
||||
|
||||
The answer to this is clear in simple words so that anyone can understand; Did you really believed those unsubstantial things even if you could take some time off to read the source code?🤔
|
||||
|
||||
Iris was one of the top github trending projects written in Go Programming Language for the 2016 and the most trending web framework in the globe. We couldn't even imagine that we will be the receivers of countless "[thank you for iris, finally a web framework I can work on](https://twitter.com/_mgale/status/818591490305761280)" comments from hundreds strangers around the globe!
|
||||
|
||||
Please do research before digestion, those blog posts are not always telling the whole truth, they are not so innocent :)
|
||||
|
||||
Especially those from that kid that even don't correspond to reality;
|
||||
|
||||
```go
|
||||
/* start */
|
||||
```
|
||||
|
||||
First of all, that article **is referring 1.5 years ago**, to pretend that this article speaks for the present is hilariously ridiculous! Iris is on version 8 now and it's not a router any more, it's a fully featured web framework with its own ecosystem.
|
||||
|
||||
1. Iris does NOT use any third-party code inside it, like "httprouter" or "fasthttp". Just navigate to the source code. If you care about historical things you can search the project but it doesn't matter because the internal implementation of Iris changed a lot of times, a lot more than its public API changes:P.
|
||||
2. Iris makes use of its own routing mechanisms with a unique **language interpreter** in order to serve even the most demanding of us `/user/{id:int min(2)}`, `/alphabetical/{param:string regexp(^[a-zA-Z ]+$)}` et cetera.
|
||||
3. Iris has its own unique MVC architectural parser with heart-breaking performance.
|
||||
4. Was it possible to do all those things and [much more](_examples) before Iris? Exactly. Iris offers you all these for free, plus the unmatched performance.
|
||||
5. Iris is the result of hundreds(or thousands(?)) of hours of **FREE and UNPAID** work. There are people who actually found a decent job because of Iris. Thousands of Gophers are watching or/and helping to make Iris even better, the silent majority loves Iris even more.
|
||||
|
||||
That 23 years old, inhibited boy, who published that post had played you with the most immoral way! Reading the Iris' source code doesn't cost you a thing! Iris is free to use for everyone, Iris is an open-source software, no hidden spots. **Don't stuck in the past, get over that, Iris has succeed, move on now.**
|
||||
|
||||
```go
|
||||
/* end */
|
||||
```
|
||||
|
||||
</details>
|
||||
-->
|
||||
|
||||
Iris may have reached version 8, but we're not stopping there. We have many feature ideas on our board that we're anxious to add and other innovative web development solutions that we're planning to build into Iris.
|
||||
|
||||
[Star](https://github.com/kataras/iris/stargazers) and watch this github repository to stay up to date, we're pushing **new examples every single day!**
|
||||
|
||||
_Psst_, we've produced a small video about your feelings regrating to Iris! You can watch it via youtube at https://www.youtube.com/watch?v=jGx0LkuUs4A.
|
||||
|
||||
[![build status](https://img.shields.io/travis/kataras/iris/master.svg?style=flat-square)](https://travis-ci.org/kataras/iris)
|
||||
[![report card](https://img.shields.io/badge/report%20card-a%2B-ff3333.svg?style=flat-square)](http://goreportcard.com/report/kataras/iris)
|
||||
[![github issues](https://img.shields.io/github/issues/kataras/iris.svg?style=flat-square)](https://github.com/kataras/iris/issues?q=is%3Aopen+is%3Aissue)
|
||||
[![github closed issues](https://img.shields.io/github/issues-closed-raw/kataras/iris.svg?style=flat-square)](https://github.com/kataras/iris/issues?q=is%3Aissue+is%3Aclosed)
|
||||
[![release](https://img.shields.io/github/release/kataras/iris.svg?style=flat-square)](https://github.com/kataras/iris/releases)
|
||||
[![view examples](https://img.shields.io/badge/learn%20by-examples-0077b3.svg?style=flat-square)](https://github.com/kataras/iris/tree/master/_examples)
|
||||
[![chat](https://img.shields.io/badge/community-%20chat-00BCD4.svg?style=flat-square)](https://kataras.rocket.chat/channel/iris)
|
||||
[![CLA assistant](https://cla-assistant.io/readme/badge/kataras/iris?style=flat-square)](https://cla-assistant.io/kataras/iris)
|
||||
Learn what [others say about Iris](https://www.youtube.com/watch?v=jGx0LkuUs4A) and [star](https://github.com/kataras/iris/stargazers) this github repository to stay [up to date](https://facebook.com/iris.framework).
|
||||
|
||||
[![Iris vs .NET Core(C#) vs Node.js (Express)](https://iris-go.com/images/benchmark-new-gray.png)](_benchmarks)
|
||||
|
||||
|
@ -82,11 +16,67 @@ _Psst_, we've produced a small video about your feelings regrating to Iris! You
|
|||
_Updated at: [Friday, 29 September 2017](_benchmarks)_
|
||||
</details>
|
||||
|
||||
We have no doubt you will able to find other web frameworks written in Go
|
||||
and even put up a real fight to learn and use them for quite some time but
|
||||
make no mistake, sooner or later you will be using Iris, not because of the ergonomic, high-performant solution that it provides but its well-documented unique features, as these will transform you to a real rockstar geek.
|
||||
|
||||
No matter what you're trying to build, Iris covers
|
||||
every type of application, from micro services to large monolithic web applications.
|
||||
It's actually the best piece of software for back-end web developers
|
||||
you can find online.
|
||||
|
||||
Iris may have reached version 8, but we're not stopping there. We have many feature ideas on our board that we're anxious to add and other innovative web development solutions that we're planning to build into Iris.
|
||||
|
||||
## Built with ♥️
|
||||
|
||||
<a target='_blank' rel='nofollow' href='https://app.codesponsor.io/link/Qw6E1MTHvUJW6BtwUUf9qwsy/kataras/iris'>
|
||||
<img alt='Sponsor' width='888' height='68' src='https://app.codesponsor.io/embed/Qw6E1MTHvUJW6BtwUUf9qwsy/kataras/iris.svg' />
|
||||
<img alt='Sponsor' width='700' height='60' src='https://app.codesponsor.io/embed/Qw6E1MTHvUJW6BtwUUf9qwsy/kataras/iris.svg' />
|
||||
</a>
|
||||
|
||||
</p>
|
||||
Accelerated by [KeyCDN](https://www.keycdn.com/), a simple, fast and reliable CDN.
|
||||
|
||||
We are developing this project using the best code editor for Golang; [Visual Studio Code](https://code.visualstudio.com/) supported by [Microsoft](https://www.microsoft.com).
|
||||
|
||||
Iris was built on top of the the [net/http](https://golang.org/pkg/net/http/) package, we own many thanks to [Brad Fitzpatrick](https://github.com/bradfitz) for that.
|
||||
|
||||
If you're coming from [nodejs](https://nodejs.org) world, Iris is the [expressjs](https://github.com/expressjs/express) equivalent for Gophers.
|
||||
|
||||
## Table Of Content
|
||||
|
||||
* [Installation](#installation)
|
||||
* [Latest changes](#th-26-october-2017--v854)
|
||||
* [Getting started](#getting-started)
|
||||
* [Learn](_examples/)
|
||||
* [MVC (Model View Controller)](_examples/#mvc) **NEW**
|
||||
* [Structuring](_examples/#structuring) **NEW**
|
||||
* [HTTP Listening](_examples/#http-listening)
|
||||
* [Configuration](_examples/#configuration)
|
||||
* [Routing, Grouping, Dynamic Path Parameters, "Macros" and Custom Context](_examples/#routing-grouping-dynamic-path-parameters-macros-and-custom-context)
|
||||
* [Subdomains](_examples/#subdomains)
|
||||
* [Wrap `http.Handler/HandlerFunc`](_examples/#convert-httphandlerhandlerfunc)
|
||||
* [View](_examples/#view)
|
||||
* [Authentication](_examples/#authentication)
|
||||
* [File Server](_examples/#file-server)
|
||||
* [How to Read from `context.Request() *http.Request`](_examples/#how-to-read-from-contextrequest-httprequest)
|
||||
* [How to Write to `context.ResponseWriter() http.ResponseWriter`](_examples/#how-to-write-to-contextresponsewriter-httpresponsewriter)
|
||||
* [Test](_examples/#testing)
|
||||
* [Cache](_examples/#caching)
|
||||
* [Sessions](_examples/#sessions)
|
||||
* [Websockets](_examples/#websockets)
|
||||
* [Miscellaneous](_examples/#miscellaneous)
|
||||
* [POC: Convert the medium-sized project "Parrot" from native to Iris](https://github.com/iris-contrib/parrot)
|
||||
* [POC: Isomorphic react/hot reloadable/redux/css-modules starter kit](https://github.com/kataras/iris-starter-kit)
|
||||
* [Typescript Automation Tools](typescript/#table-of-contents)
|
||||
* [Tutorial: A URL Shortener Service using Go, Iris and Bolt](https://medium.com/@kataras/a-url-shortener-service-using-go-iris-and-bolt-4182f0b00ae7)
|
||||
* [Tutorial: Online Visitors](_examples/tutorial/online-visitors)
|
||||
* [Tutorial: Caddy](_examples/tutorial/caddy)
|
||||
* [Tutorial: DropzoneJS Uploader](https://hackernoon.com/how-to-build-a-file-upload-form-using-dropzonejs-and-go-8fb9f258a991)
|
||||
* [Middleware](middleware/)
|
||||
* [Dockerize](https://github.com/iris-contrib/cloud-native-go)
|
||||
* [Contributing](CONTRIBUTING.md)
|
||||
* [FAQ](FAQ.md)
|
||||
* [What's next?](#you-are-ready-to-move-to-the-next-step-and-get-closer-to-becoming-a-pro-gopher)
|
||||
* [People](#people)
|
||||
|
||||
## Installation
|
||||
|
||||
|
@ -98,8 +88,6 @@ $ go get -u github.com/kataras/iris
|
|||
|
||||
Iris takes advantage of the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature. You get truly reproducible builds, as this method guards against upstream renames and deletes.
|
||||
|
||||
[Latest changes | v8.5.3](https://github.com/kataras/iris/blob/master/HISTORY.md#su-22-october-2017--v853)
|
||||
|
||||
## Getting Started
|
||||
|
||||
```go
|
||||
|
@ -316,8 +304,6 @@ func main() {
|
|||
|
||||
// MoviesController is our /movies controller.
|
||||
type MoviesController struct {
|
||||
// mvc.C is just a lightweight alternative
|
||||
// to the "mvc.Controller" controller type.
|
||||
mvc.C
|
||||
}
|
||||
|
||||
|
@ -521,6 +507,7 @@ func (r *movieMemoryRepository) Exec(query Query, action Query, actionLimit int,
|
|||
ok = query(movie)
|
||||
if ok {
|
||||
if action(movie) {
|
||||
loops++
|
||||
if actionLimit >= loops {
|
||||
break // break
|
||||
}
|
||||
|
@ -785,10 +772,6 @@ import (
|
|||
|
||||
// MovieController is our /movies controller.
|
||||
type MovieController struct {
|
||||
// mvc.C is just a lightweight lightweight alternative
|
||||
// to the "mvc.Controller" controller type,
|
||||
// use it when you don't need mvc.Controller's fields
|
||||
// (you don't need those fields when you return values from the method functions).
|
||||
mvc.C
|
||||
|
||||
// Our MovieService, it's an interface which
|
||||
|
@ -1022,22 +1005,47 @@ func main() {
|
|||
|
||||
More folder structure guidelines can be found at the [_examples/#structuring](_examples/#structuring) section.
|
||||
|
||||
## 😃 Do you like what you learnt so far?
|
||||
## You are ready to move to the next step and get closer to becoming a pro gopher
|
||||
|
||||
> Prepare yourself a cup of coffee, or tea, whatever enjoys you the most!
|
||||
Congratulations, since you've made it so far, we've crafted just for you some next level content to turn you into a real pro gopher 😃
|
||||
|
||||
- [How to build a file upload form using DropzoneJS and Go](https://hackernoon.com/how-to-build-a-file-upload-form-using-dropzonejs-and-go-8fb9f258a991)
|
||||
- [How to display existing files on server using DropzoneJS and Go](https://hackernoon.com/how-to-display-existing-files-on-server-using-dropzonejs-and-go-53e24b57ba19)
|
||||
- [Iris Go vs .NET Core Kestrel in terms of HTTP performance](https://hackernoon.com/iris-go-vs-net-core-kestrel-in-terms-of-http-performance-806195dc93d5)
|
||||
- [Go vs .NET Core in terms of HTTP performance](https://medium.com/@kataras/go-vs-net-core-in-terms-of-http-performance-7535a61b67b8)
|
||||
- [Iris, a modular web framework](https://medium.com/@corebreaker/iris-web-cd684b4685c7)
|
||||
- [Deploying a Iris Golang app in hasura](https://medium.com/@HasuraHQ/deploy-an-iris-golang-app-with-backend-apis-in-minutes-25a559bf530b)
|
||||
- [How to Turn an Android Device into a Web Server](https://twitter.com/ThePracticalDev/status/892022594031017988)
|
||||
- [A URL Shortener Service using Go, Iris and Bolt](https://medium.com/@kataras/a-url-shortener-service-using-go-iris-and-bolt-4182f0b00ae7)
|
||||
- [Why I preferred Go over Node.js for simple Web Application](https://medium.com/@tigranbs/why-i-preferred-go-over-node-js-for-simple-web-application-d4a549e979b9)
|
||||
> Don't forget to prepare yourself a cup of coffee, or tea, whatever enjoys you the most!
|
||||
|
||||
Take some time, `don't say we didn't warn you`, and continue your journey by [navigating to the next README page](README_NEXT.md).
|
||||
* [How to build a file upload form using DropzoneJS and Go](https://hackernoon.com/how-to-build-a-file-upload-form-using-dropzonejs-and-go-8fb9f258a991)
|
||||
* [How to display existing files on server using DropzoneJS and Go](https://hackernoon.com/how-to-display-existing-files-on-server-using-dropzonejs-and-go-53e24b57ba19)
|
||||
* [Iris, a modular web framework](https://medium.com/@corebreaker/iris-web-cd684b4685c7)
|
||||
* [Go vs .NET Core in terms of HTTP performance](https://medium.com/@kataras/go-vs-net-core-in-terms-of-http-performance-7535a61b67b8)
|
||||
* [Iris Go vs .NET Core Kestrel in terms of HTTP performance](https://hackernoon.com/iris-go-vs-net-core-kestrel-in-terms-of-http-performance-806195dc93d5)
|
||||
* [How to Turn an Android Device into a Web Server](https://twitter.com/ThePracticalDev/status/892022594031017988)
|
||||
* [Deploying a Iris Golang app in hasura](https://medium.com/@HasuraHQ/deploy-an-iris-golang-app-with-backend-apis-in-minutes-25a559bf530b)
|
||||
* [A URL Shortener Service using Go, Iris and Bolt](https://medium.com/@kataras/a-url-shortener-service-using-go-iris-and-bolt-4182f0b00ae7)
|
||||
|
||||
## People
|
||||
|
||||
The author of Iris is [@kataras](https://github.com/kataras), you can reach him via;
|
||||
|
||||
* [Medium](https://medium.com/@kataras)
|
||||
* [Twitter](https://twitter.com/makismaropoulos)
|
||||
* [Dev.to](https://dev.to/@kataras)
|
||||
* [Facebook](https://facebook.com/iris.framework)
|
||||
* [Mail](mailto:kataras2006@hotmail.com?subject=Iris%20I%20need%20some%20help%20please)
|
||||
|
||||
[List of all Authors](AUTHORS)
|
||||
|
||||
[List of all Contributors](https://github.com/kataras/iris/graphs/contributors)
|
||||
|
||||
Help this project to continue deliver awesome and unique features with the higher code quality as possible by donating any amount via [PayPal](https://www.paypal.me/kataras) or [BTC](https://iris-go.com/v8/donate)!
|
||||
|
||||
### 03, October 2017 | Iris User Experience Report
|
||||
|
||||
Be part of the **first** Iris User Experience Report by submitting a simple form, it won't take more than **2 minutes**.
|
||||
|
||||
The form contains some questions that you may need to answer in order to learn more about you; learning more about you helps us to serve you with the best possible way!
|
||||
|
||||
https://docs.google.com/forms/d/e/1FAIpQLSdCxZXPANg_xHWil4kVAdhmh7EBBHQZ_4_xSZVDL-oCC_z5pA/viewform?usp=sf_link
|
||||
|
||||
## License
|
||||
|
||||
Iris is licensed under the 3-Clause BSD [License](LICENSE). Iris is 100% open-source software.
|
||||
Iris is licensed under the 3-Clause BSD [License](LICENSE). Iris is 100% open-source software.
|
||||
|
||||
For any questions regarding the license please [contact us](mailto:kataras2006@hotmail.com?subject=Iris%20License).
|
496
README_NEXT.md
496
README_NEXT.md
|
@ -1,496 +0,0 @@
|
|||
<!-- # ![Logo created by @santoshanand](logo_white_35_24.png) Iris -->
|
||||
|
||||
# 03, October 2017 | Iris User Experience Report
|
||||
|
||||
Be part of the **first** Iris User Experience Report by submitting a simple form, it won't take more than **2 minutes**.
|
||||
|
||||
The form contains some questions that you may need to answer in order to learn more about you; learning more about you helps us to serve you with the best possible way!
|
||||
|
||||
https://docs.google.com/forms/d/e/1FAIpQLSdCxZXPANg_xHWil4kVAdhmh7EBBHQZ_4_xSZVDL-oCC_z5pA/viewform?usp=sf_link
|
||||
|
||||
<a href="https://docs.google.com/forms/d/e/1FAIpQLSdCxZXPANg_xHWil4kVAdhmh7EBBHQZ_4_xSZVDL-oCC_z5pA/viewform?usp=sf_link"><img src="https://iris-go.com/public/images/user_experience_report.png" alt="Iris User Experience Report - Header" width="400"></a>
|
||||
|
||||
<p align="center">
|
||||
<img src="iris_the_new_machine.gif">
|
||||
</p>
|
||||
|
||||
Iris is a fast, simple and efficient micro web framework for Go. It provides a beautifully expressive and easy to use foundation for your next website, API, or distributed app.
|
||||
|
||||
We have no doubt you will able to find other web frameworks written in Go
|
||||
and even put up a real fight to learn and use them for quite some time but
|
||||
make no mistake, sooner or later you will be using Iris, not because of the ergonomic, high-performant solution that it provides but its well-documented unique features, as these will transform you to a real rockstar geek.
|
||||
|
||||
No matter what you're trying to build, Iris covers
|
||||
every type of application, from micro services to large monolithic web applications.
|
||||
It's actually the best piece of software for back-end web developers
|
||||
you can find online.
|
||||
|
||||
Iris may have reached version 8, but we're not stopping there. We have many feature ideas on our board that we're anxious to add and other innovative web development solutions that we're planning to build into Iris.
|
||||
|
||||
Iris was built on top of the the [net/http](https://golang.org/pkg/net/http/) package, we own many thanks to [Brad Fitzpatrick](https://github.com/bradfitz) for that.
|
||||
|
||||
If you're coming from <a href="https://nodejs.org/en/">Node.js</a> world, this is the <a href="https://github.com/expressjs/express">expressjs</a> equivalent for the <a href="https://golang.org">Go Programming Language.</a><br/>
|
||||
|
||||
**Accelerated** by [KeyCDN](https://www.keycdn.com/), A Simple, Fast and Reliable CDN.
|
||||
|
||||
**We are developing** this project using the best code editor for Golang; [Visual Studio Code](https://code.visualstudio.com/) supported by [Microsoft](https://www.microsoft.com).
|
||||
|
||||
[Star](https://github.com/kataras/iris/stargazers) and watch this github repository to stay up to date.
|
||||
|
||||
<!-- [![total used by](https://iris-go.com/graph?style=flat-square)](https://iris-go.com/graph) -->
|
||||
[![build status](https://img.shields.io/travis/kataras/iris/master.svg?style=flat-square)](https://travis-ci.org/kataras/iris)
|
||||
[![report card](https://img.shields.io/badge/report%20card-a%2B-ff3333.svg?style=flat-square)](http://goreportcard.com/report/kataras/iris)
|
||||
[![github issues](https://img.shields.io/github/issues/kataras/iris.svg?style=flat-square)](https://github.com/kataras/iris/issues?q=is%3Aopen+is%3Aissue)
|
||||
[![github closed issues](https://img.shields.io/github/issues-closed-raw/kataras/iris.svg?style=flat-square)](https://github.com/kataras/iris/issues?q=is%3Aissue+is%3Aclosed)
|
||||
[![release](https://img.shields.io/github/release/kataras/iris.svg?style=flat-square)](https://github.com/kataras/iris/releases)
|
||||
[![view examples](https://img.shields.io/badge/learn%20by-examples-0077b3.svg?style=flat-square)](https://github.com/kataras/iris/tree/master/_examples)
|
||||
[![chat](https://img.shields.io/badge/community-%20chat-00BCD4.svg?style=flat-square)](https://kataras.rocket.chat/channel/iris)
|
||||
|
||||
<!-- has issues, the img.shields.io's API is problematic for this resource: [![issue stats](https://img.shields.io/issuestats/i/github/kataras/iris.svg?style=flat-square)](https://github.com/kataras/iris/issues?q=is%3Aissue+is%3Aclosed) -->
|
||||
<!-- [![godocs](https://img.shields.io/badge/godocs-8.x.x-0366d6.svg?style=flat-square)](https://godoc.org/github.com/kataras/iris) -->
|
||||
|
||||
![Iris vs .NET Core(C#) vs Node.js (Express)](https://iris-go.com/images/benchmark-new-gray.png)
|
||||
|
||||
<details>
|
||||
<summary>Benchmarks from third-party source over the rest web frameworks</summary>
|
||||
|
||||
![Comparison with other frameworks](https://raw.githubusercontent.com/smallnest/go-web-framework-benchmark/4db507a22c964c9bc9774c5b31afdc199a0fe8b7/benchmark.png)
|
||||
|
||||
</details>
|
||||
|
||||
_Updated at: [Friday, 29 September 2017](_benchmarks)_
|
||||
|
||||
</p>
|
||||
|
||||
### [🎗️](#-people) Legends
|
||||
|
||||
Help this project to continue deliver awesome and unique features with the higher code quality as possible by donating any amount via [PayPal](https://www.paypal.me/kataras)!
|
||||
|
||||
| Name | Amount | Membership |
|
||||
| -----------|--------|--------|
|
||||
| [Juan Sebastián Suárez Valencia](https://github.com/Juanses) | 20 EUR | Bronze |
|
||||
| [Bob Lee](https://github.com/li3p) | 20 EUR | Bronze |
|
||||
| [Celso Luiz](https://github.com/celsosz) | 50 EUR | **Silver** |
|
||||
| [Ankur Srivastava](https://github.com/ansrivas) | 20 EUR | Bronze |
|
||||
| [Damon Zhao](https://github.com/se77en) | 20 EUR | Bronze |
|
||||
| [Exponity - Tech Company](https://github.com/exponity) | 30 EUR | Bronze |
|
||||
| [Thomas Fritz](https://github.com/thomasfr) | 25 EUR | Bronze |
|
||||
| [Thanos V.](http://mykonosbiennale.com/) | 20 EUR | Bronze |
|
||||
| [George Opritescu](https://github.com/International) | 20 EUR | Bronze |
|
||||
| [Lex Tang](https://github.com/lexrus) | 20 EUR | Bronze |
|
||||
| [Bill Q.](https://github.com/hiveminded) | 600 EUR | **Gold** |
|
||||
| [Conrad Steenberg](https://github.com/hengestone) | 25 EUR | Bronze |
|
||||
|
||||
_Psst_, we've produced a small video about your feelings regrating to Iris! You can watch the video at https://www.youtube.com/watch?v=jGx0LkuUs4A.
|
||||
|
||||
### 📑 Table Of Content
|
||||
|
||||
* [Installation](#-installation)
|
||||
* [Latest changes](https://github.com/kataras/iris/blob/master/HISTORY.md#th-12-october-2017--v852)
|
||||
* [Learn](#-learn)
|
||||
* [Structuring](_examples/#structuring)
|
||||
* [HTTP Listening](_examples/#http-listening)
|
||||
* [Configuration](_examples/#configuration)
|
||||
* [Routing, Grouping, Dynamic Path Parameters, "Macros" and Custom Context](_examples/#routing-grouping-dynamic-path-parameters-macros-and-custom-context)
|
||||
* [MVC (Model View Controller)](_examples/#mvc) **NEW**
|
||||
* [Subdomains](_examples/#subdomains)
|
||||
* [Wrap `http.Handler/HandlerFunc`](_examples/#convert-httphandlerhandlerfunc)
|
||||
* [View](_examples/#view)
|
||||
* [Authentication](_examples/#authentication)
|
||||
* [File Server](_examples/#file-server)
|
||||
* [How to Read from `context.Request() *http.Request`](_examples/#how-to-read-from-contextrequest-httprequest)
|
||||
* [How to Write to `context.ResponseWriter() http.ResponseWriter`](_examples/#how-to-write-to-contextresponsewriter-httpresponsewriter)
|
||||
* [Test](_examples/#testing)
|
||||
* [Cache](_examples/#caching)
|
||||
* [Sessions](_examples/#sessions)
|
||||
* [Websockets](_examples/#websockets)
|
||||
* [Miscellaneous](_examples/#miscellaneous)
|
||||
* [POC: Convert the medium-sized project "Parrot" from native to Iris](https://github.com/iris-contrib/parrot)
|
||||
* [POC: Isomorphic react/hot reloadable/redux/css-modules starter kit](https://github.com/kataras/iris-starter-kit)
|
||||
* [Typescript Automation Tools](typescript/#table-of-contents)
|
||||
* [Tutorial: Online Visitors](_examples/tutorial/online-visitors)
|
||||
* [Tutorial: Caddy](_examples/tutorial/caddy)
|
||||
* [Tutorial: DropzoneJS Uploader](_examples/tutorial/dropzonejs)
|
||||
* [Middleware](middleware/)
|
||||
* [Dockerize](https://github.com/iris-contrib/cloud-native-go)
|
||||
* [Community & Support](#-community)
|
||||
* [Blogs](https://iris-go.com/v8/blogs)
|
||||
- [How to build a file upload form using DropzoneJS and Go](https://hackernoon.com/how-to-build-a-file-upload-form-using-dropzonejs-and-go-8fb9f258a991)
|
||||
- [How to display existing files on server using DropzoneJS and Go](https://hackernoon.com/how-to-display-existing-files-on-server-using-dropzonejs-and-go-53e24b57ba19)
|
||||
- [Iris Go vs .NET Core Kestrel in terms of HTTP performance](https://hackernoon.com/iris-go-vs-net-core-kestrel-in-terms-of-http-performance-806195dc93d5)
|
||||
- [Go vs .NET Core in terms of HTTP performance](https://medium.com/@kataras/go-vs-net-core-in-terms-of-http-performance-7535a61b67b8)
|
||||
- [Iris, a modular web framework](https://medium.com/@corebreaker/iris-web-cd684b4685c7)
|
||||
- [Deploying a Iris Golang app in hasura](https://medium.com/@HasuraHQ/deploy-an-iris-golang-app-with-backend-apis-in-minutes-25a559bf530b)
|
||||
- [How to Turn an Android Device into a Web Server](https://twitter.com/ThePracticalDev/status/892022594031017988)
|
||||
- [A URL Shortener Service using Go, Iris and Bolt](https://medium.com/@kataras/a-url-shortener-service-using-go-iris-and-bolt-4182f0b00ae7)
|
||||
- [Why I preferred Go over Node.js for simple Web Application](https://medium.com/@tigranbs/why-i-preferred-go-over-node-js-for-simple-web-application-d4a549e979b9)
|
||||
* [Versioning](#-version)
|
||||
* [People](#-people)
|
||||
|
||||
### 🚀 Installation
|
||||
|
||||
The only requirement is the [Go Programming Language](https://golang.org/dl/), at least version 1.8, but **1.9** is highly recommended. [Docs](https://docs.iris-go.com) and [Examples](_examples) are written using the go 1.9 version.
|
||||
|
||||
```sh
|
||||
$ go get -u github.com/kataras/iris
|
||||
```
|
||||
|
||||
> _iris_ takes advantage of the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature. You get truly reproducible builds, as this method guards against upstream renames and deletes.
|
||||
|
||||
```go
|
||||
// file: main.go
|
||||
package main
|
||||
import "github.com/kataras/iris"
|
||||
|
||||
func main() {
|
||||
app := iris.New()
|
||||
// Load all templates from the "./views" folder
|
||||
// where extension is ".html" and parse them
|
||||
// using the standard `html/template` package.
|
||||
app.RegisterView(iris.HTML("./views", ".html"))
|
||||
|
||||
// Method: GET
|
||||
// Resource: http://localhost:8080
|
||||
app.Get("/", func(ctx iris.Context) {
|
||||
// Bind: {{.message}} with "Hello world!"
|
||||
ctx.ViewData("message", "Hello world!")
|
||||
// Render template file: ./views/hello.html
|
||||
ctx.View("hello.html")
|
||||
})
|
||||
|
||||
// Method: GET
|
||||
// Resource: http://localhost:8080/user/42
|
||||
//
|
||||
// Need to use a custom regexp instead?
|
||||
// Easy;
|
||||
// Just mark the parameter's type to 'string'
|
||||
// which accepts anything and make use of
|
||||
// its `regexp` macro function, i.e:
|
||||
// app.Get("/user/{id:string regexp(^[0-9]+$)}")
|
||||
app.Get("/user/{id:long}", func(ctx iris.Context) {
|
||||
userID, _ := ctx.Params().GetInt64("id")
|
||||
ctx.Writef("User ID: %d", userID)
|
||||
})
|
||||
|
||||
// Start the server using a network address.
|
||||
app.Run(iris.Addr(":8080"))
|
||||
}
|
||||
```
|
||||
|
||||
> See all available path parameter types at: https://github.com/kataras/iris/blob/master/_examples/routing/dynamic-path/main.go#L31
|
||||
|
||||
```html
|
||||
<!-- file: ./views/hello.html -->
|
||||
<html>
|
||||
<head>
|
||||
<title>Hello Page</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>{{.message}}</h1>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
```sh
|
||||
$ go run main.go
|
||||
> Now listening on: http://localhost:8080
|
||||
> Application started. Press CTRL+C to shut down.
|
||||
```
|
||||
|
||||
> Wanna re-start your app automatically when source code changes happens? Install the [rizla](https://github.com/kataras/rizla) tool and run `rizla main.go` instead of `go run main.go`.
|
||||
|
||||
Examples and docs are updated to Go 1.9, please refer to [that FAQ section](https://github.com/kataras/iris/blob/master/faq.md#type-aliases).
|
||||
|
||||
<details>
|
||||
<summary>Hello World with Go 1.8</summary>
|
||||
|
||||
Iris declares all of its type alias at the same file in order to be easy to be discovered.
|
||||
|
||||
> If you just upgraded to go 1.9 from 1.8 you can always search for a compatible type alias at the [context.go](context.go) file and opposite, if you use go 1.8 and you're new to Iris you can see [that](context.go) file to see the compatible packages.
|
||||
|
||||
If Go 1.8 remains the basic host for your go apps then you should declare and use the `github.com/kataras/iris/context` package on your source file's imports statement.
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/kataras/iris"
|
||||
"github.com/kataras/iris/context"
|
||||
)
|
||||
|
||||
func main() {
|
||||
app := iris.New()
|
||||
app.RegisterView(iris.HTML("./templates", ".html"))
|
||||
|
||||
app.Get("/", func(ctx context.Context) {
|
||||
ctx.ViewData("message", "Hello world!")
|
||||
ctx.View("hello.html")
|
||||
})
|
||||
|
||||
app.Run(iris.Addr(":8080"))
|
||||
}
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>Fan of the MVC Architectural Pattern? Click here</summary>
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import "github.com/kataras/iris"
|
||||
|
||||
func main() {
|
||||
app := iris.New()
|
||||
app.RegisterView(iris.HTML("./views", ".html"))
|
||||
|
||||
app.Controller("/", new(Controller))
|
||||
|
||||
app.Run(iris.Addr(":8080"))
|
||||
}
|
||||
|
||||
type Controller struct {
|
||||
iris.Controller
|
||||
}
|
||||
|
||||
// Method: GET
|
||||
// Resource: http://localhost:8080
|
||||
func (c *Controller) Get() {
|
||||
c.Data["message"] = "Hello world!"
|
||||
c.Tmpl = "hello.html"
|
||||
}
|
||||
|
||||
// Method: GET
|
||||
// Resource: http://localhost:8080/user/42
|
||||
func (c *Controller) GetUserBy(id int64) {
|
||||
c.Ctx.Writef("User ID: %d", id)
|
||||
}
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>Why a new web framework</summary>
|
||||
|
||||
### Why
|
||||
|
||||
Go is a great technology stack for building scalable, web-based, back-end systems for web
|
||||
applications.
|
||||
|
||||
When you think about building web applications and web APIs, or simply building HTTP servers in Go, does your mind go to the standard net/http package?
|
||||
Then you have to deal with some common situations like dynamic routing (a.k.a parameterized), security and authentication, real-time communication and many other issues that net/http doesn't solve.
|
||||
|
||||
The net/http package is not complete enough to quickly build well-designed back-end web systems. When you realize this, you might be thinking along these lines:
|
||||
|
||||
- Ok, the net/http package doesn't suit me, but there are so many frameworks, which one will work for me?!
|
||||
- Each one of them tells me that it is the best. I don't know what to do!
|
||||
|
||||
##### The truth
|
||||
|
||||
I did some deep research and benchmarks with 'wrk' and 'ab' in order to choose which framework would suit me and my new project. The results, sadly, were really disappointing to me.
|
||||
|
||||
I started wondering if golang wasn't as fast on the web as I had read... but, before I let Golang go and continued to develop with nodejs, I told myself:
|
||||
|
||||
> '**Makis, don't lose hope, give at least a chance to Golang. Try to build something totally new without basing it off the "slow" code you saw earlier; learn the secrets of this language and make *others* follow your steps!**'.
|
||||
|
||||
These are the words I told myself that day [**13 March 2016**].
|
||||
|
||||
The same day, later the night, I was reading a book about Greek mythology. I saw an ancient goddess' name and was inspired immediately to give a name to this new web framework (which I had already started writing) - **Iris**.
|
||||
|
||||
I'm still here [because Iris has succeed in being the fastest go web framework](https://raw.githubusercontent.com/smallnest/go-web-framework-benchmark/4db507a22c964c9bc9774c5b31afdc199a0fe8b7/benchmark.png)
|
||||
|
||||
[![](http://comments.iris-go.com/screens/comment37.png)](https://twitter.com/ThePracticalDev/status/892022594031017988)
|
||||
|
||||
![](https://comments.iris-go.com/comment36.png)
|
||||
|
||||
![](https://comments.iris-go.com/comment35.png)
|
||||
|
||||
![](https://comments.iris-go.com/comment34.png)
|
||||
|
||||
![](https://comments.iris-go.com/comment2.png)
|
||||
|
||||
![](https://comments.iris-go.com/comment30.png)
|
||||
|
||||
![](https://comments.iris-go.com/comment31.png)
|
||||
|
||||
![](https://comments.iris-go.com/comment32.png)
|
||||
|
||||
![](https://comments.iris-go.com/comment33.png)
|
||||
|
||||
![](https://comments.iris-go.com/comment26.png)
|
||||
|
||||
![](https://comments.iris-go.com/comment1.png)
|
||||
|
||||
![](https://comments.iris-go.com/comment3.png)
|
||||
|
||||
![](https://comments.iris-go.com/comment8.png)
|
||||
|
||||
![](https://comments.iris-go.com/comment12.png)
|
||||
|
||||
![](https://comments.iris-go.com/comment13.png)
|
||||
|
||||
![](https://comments.iris-go.com/comment14.png)
|
||||
|
||||
![](https://comments.iris-go.com/comment17.png)
|
||||
|
||||
![](https://comments.iris-go.com/comment21.png)
|
||||
|
||||
![](https://comments.iris-go.com/comment22.png)
|
||||
|
||||
![](https://comments.iris-go.com/comment24.png)
|
||||
|
||||
![](https://comments.iris-go.com/comment27.png)
|
||||
|
||||
----
|
||||
|
||||
_iris_ is easy, it has a familiar API while in the same has far more features than [Gin](https://github.com/gin-gonic/gin) or [Martini](https://github.com/go-martini/martini).
|
||||
|
||||
You own your code —it will never generate (unfamiliar) code for you, like [Beego](https://github.com/astaxie/beego), [Revel](https://github.com/revel/revel) and [Buffalo](https://github.com/gobuffalo/buffalo) do.
|
||||
|
||||
It's not just-another-router but its overall performance is equivalent with something like [httprouter](https://github.com/julienschmidt/httprouter).
|
||||
|
||||
Unlike [fasthttp](https://github.com/valyala/fasthttp), iris provides full HTTP/2 support for free.
|
||||
|
||||
Compared to the rest open source projects, this one is very active and you get answers almost immediately.
|
||||
|
||||
### 🔥 Hot Features
|
||||
|
||||
- Focus on high performance
|
||||
- Easy Fluent API
|
||||
- Highly customizable
|
||||
- Robust routing and middleware ecosystem
|
||||
* Build RESTful APIs with iris unique expressionist path interpreter
|
||||
* Dynamic path parameterized or wildcard routes are not conflict with static routes
|
||||
* Remove trailing slash from the URL with option to redirect
|
||||
* Virtual hosts and subdomains made easy
|
||||
* Group API's and static or even dynamic subdomains
|
||||
* MVC [**NEW**](_examples/mvc)
|
||||
* `net/http` and `negroni-like` handlers are compatible via `iris.FromStd`
|
||||
* Register custom handlers for any HTTP error
|
||||
* Transactions and rollback when you need it
|
||||
* Cache the response when you need it
|
||||
* A single function to serve your embedded assets, always compatible with `go-bindata`
|
||||
* HTTP to HTTPS
|
||||
* HTTP to HTTPS WWW
|
||||
* [learn the reasons that differ from what you've seen so far](_examples/#routing-grouping-dynamic-path-parameters-macros-and-custom-context)
|
||||
- Context
|
||||
* Highly scalable rich content render (Markdown, JSON, JSONP, XML...)
|
||||
* Body binders and handy functions to send HTTP responses
|
||||
* Limit request body
|
||||
* Serve static resources or embedded assets
|
||||
* Localization i18N
|
||||
* Compression (Gzip is built'n)
|
||||
- Authentication
|
||||
* Basic Authentication
|
||||
* OAuth, OAuth2 supporting 27+ popular websites
|
||||
* JWT
|
||||
- Server
|
||||
* Automatically install and serve certificates from https://letsencrypt.org when serving via TLS
|
||||
* Gracefully shutdown by-default
|
||||
* Register on shutdown, error or interrupt events
|
||||
* Attach more than one server, fully compatible with `net/http#Server`
|
||||
- View system: supporting 5 template engines. Fully compatible with `html/template`
|
||||
- HTTP Sessions library [you can still use your favorite if you want to]
|
||||
- Websocket library, its API similar to socket.io [you can still use your favorite if you want to]
|
||||
- Hot Reload on source code changes[*](https://github.com/kataras/rizla)
|
||||
- Typescript integration + Web IDE
|
||||
- And many other things that will surprise you
|
||||
|
||||
</details>
|
||||
|
||||
### 📖 Learn
|
||||
|
||||
<a href="https://github.com/kataras/iris/_examples" alt="documentation and examples">
|
||||
<img align="right" src="learn.jpg" width="125" />
|
||||
</a>
|
||||
|
||||
The _iris_ philosophy is to provide robust tooling for HTTP, making it a great solution for single page applications, web sites, hybrids, or public HTTP APIs. Keep note that, today, iris is faster than apache+nginx itself.
|
||||
|
||||
_iris_ does not force you to use any specific ORM. With support for the most popular template engines, websocket server and a fast sessions manager you can quickly craft your perfect application.
|
||||
|
||||
The awesome _iris_ community is always adding new examples, [_examples](_examples/) is a great place to get started!
|
||||
|
||||
Read the [godocs](https://godoc.org/github.com/kataras/iris) for a better understanding.
|
||||
|
||||
### 👥 Community
|
||||
|
||||
Join the welcoming community of fellow _iris_ developers in [rocket.chat](https://kataras.rocket.chat/channel/iris)
|
||||
|
||||
- [Post](http://support.iris-go.com) a feature request or report a bug
|
||||
- :star: and watch the public [repository](https://github.com/kataras/iris/stargazers), will keep you up to date
|
||||
- :earth_americas: publish [an article](https://medium.com/search?q=iris) or share a [tweet](https://twitter.com/hashtag/golang) about your personal experience with iris.
|
||||
|
||||
The most useful community repository for _iris_ developers is the
|
||||
[iris-contrib/middleware](https://github.com/iris-contrib/middleware) which contains some HTTP handlers that can help you finish a lot of your tasks even easier. Feel free to push your own middleware there!
|
||||
|
||||
```sh
|
||||
$ go get -u github.com/iris-contrib/middleware/...
|
||||
```
|
||||
|
||||
#### 📈 One and a half years...
|
||||
|
||||
[![total used by](https://iris-go.com/graph?style=flat-square)]()
|
||||
|
||||
Iris exceeded all expectations, started as one-man project.
|
||||
|
||||
- 7300 github stars
|
||||
- 778 github forks
|
||||
- 1m total views at its documentation
|
||||
- ~819$ at donations, small amount for the work we put here but it's a good start
|
||||
- ~557 reported bugs fixed
|
||||
- ~30 community feature requests have been implemented
|
||||
|
||||
### 📌 Version
|
||||
|
||||
Current: [VERSION](VERSION)
|
||||
|
||||
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".
|
||||
|
||||
Changelog of the current version can be found at the [HISTORY](HISTORY.md) file.
|
||||
|
||||
#### Should I upgrade my iris?
|
||||
|
||||
Developers are not forced to use the latest _iris_ version, they can use any version in production, they can update at any time they want.
|
||||
|
||||
Testers should upgrade immediately, if you're willing to use _iris_ in production you can wait a little more longer, transaction should be as safe as possible.
|
||||
|
||||
#### Where can I find older versions?
|
||||
|
||||
Previous versions can be found at [releases page](https://github.com/kataras/iris/releases).
|
||||
|
||||
<!--
|
||||
### 😃 Get Hired
|
||||
|
||||
Below you'll find a list of open positions that require at least **experience with the Iris web framework**.
|
||||
|
||||
| Company | Position | Job Details |
|
||||
| -----------|--------|-------------|
|
||||
| Kudo, an Indonesian startup technology company | Application Programming Interface Developer | Navigate to: https://glints.id/opportunities/jobs/5553 |
|
||||
|
||||
Employers that are looking for brilliant Software Engineers with good experience on Go Programming Language and Iris can put their startup's or company's name here or, if privacy is the key, [contact with us](mailto:kataras2006@hotmail.com?subject=Employer%20That%20Hires%20Smart%20Devs) to suggest some good and well-tested freelancers that suits your needs.
|
||||
|
||||
-->
|
||||
|
||||
### 🥇 People
|
||||
|
||||
The original author of _Iris_ is [@kataras](https://github.com/kataras), you can reach him via
|
||||
- [Medium](https://medium.com/@kataras)
|
||||
- [Twitter](https://twitter.com/makismaropoulos)
|
||||
- [Dev.to](https://dev.to/@kataras)
|
||||
- [Facebook](https://facebook.com/kataras.gopher)
|
||||
- [Mail](mailto:kataras2006@hotmail.com?subject=Iris%20I%20need%20some%20help%20please)
|
||||
|
||||
[List of all Authors](AUTHORS)
|
||||
|
||||
[List of all Contributors](https://github.com/kataras/iris/graphs/contributors)
|
||||
|
||||
Help this project to continue deliver awesome and unique features with the higher code quality as possible by donating any amount via [PayPal](https://www.paypal.me/kataras)!
|
||||
|
||||
[![](https://www.paypalobjects.com/webstatic/paypalme/images/pp_logo_small.png)](https://www.paypal.me/kataras/20)
|
||||
|
||||
## License
|
||||
|
||||
This software is licensed under the open-source 3-Clause BSD.
|
||||
|
||||
You can find the license file [here](LICENSE), for any questions regarding the license please [contact](mailto:kataras2006@hotmail.com?subject=Iris%20License) us.
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
8.5.3:https://github.com/kataras/iris/blob/master/HISTORY.md#su-22-october-2017--v853
|
||||
8.5.4:https://github.com/kataras/iris/blob/master/HISTORY.md#th-26-october-2017--v854
|
|
@ -58,6 +58,7 @@ func (r *userMemoryRepository) Exec(query Query, action Query, actionLimit int,
|
|||
ok = query(user)
|
||||
if ok {
|
||||
if action(user) {
|
||||
loops++
|
||||
if actionLimit >= loops {
|
||||
break // break
|
||||
}
|
||||
|
|
|
@ -60,6 +60,7 @@ func (r *movieMemoryRepository) Exec(query Query, action Query, actionLimit int,
|
|||
ok = query(movie)
|
||||
if ok {
|
||||
if action(movie) {
|
||||
loops++
|
||||
if actionLimit >= loops {
|
||||
break // break
|
||||
}
|
||||
|
|
|
@ -88,9 +88,9 @@ func profileByUsername(ctx iris.Context) {
|
|||
// .Params are used to get dynamic path parameters.
|
||||
username := ctx.Params().Get("username")
|
||||
ctx.ViewData("Username", username)
|
||||
// renders "./views/users/profile.html"
|
||||
// renders "./views/user/profile.html"
|
||||
// with {{ .Username }} equals to the username dynamic path parameter.
|
||||
ctx.View("users/profile.html")
|
||||
ctx.View("user/profile.html")
|
||||
}
|
||||
|
||||
func getUserByID(ctx iris.Context) {
|
||||
|
@ -109,8 +109,8 @@ func createUser(ctx iris.Context) {
|
|||
ctx.StatusCode(iris.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
// renders "./views/users/create_verification.html"
|
||||
// renders "./views/user/create_verification.html"
|
||||
// with {{ . }} equals to the User object, i.e {{ .Username }} , {{ .Firstname}} etc...
|
||||
ctx.ViewData("", user)
|
||||
ctx.View("users/create_verification.html")
|
||||
ctx.View("user/create_verification.html")
|
||||
}
|
||||
|
|
|
@ -279,6 +279,7 @@ type Context interface {
|
|||
// func(c *UsersController) Get() []models.User {
|
||||
// return c.Service.GetAll()
|
||||
//}
|
||||
// Alternative way is `!ctx.IsStopped()` if middleware make use of the `ctx.StopExecution()` on failure.
|
||||
Proceed(Handler) bool
|
||||
// HandlerName returns the current handler's name, helpful for debugging.
|
||||
HandlerName() string
|
||||
|
@ -1043,6 +1044,7 @@ func (ctx *context) HandlerIndex(n int) (currentIndex int) {
|
|||
// func(c *UsersController) Get() []models.User {
|
||||
// return c.Service.GetAll()
|
||||
//}
|
||||
// Alternative way is `!ctx.IsStopped()` if middleware make use of the `ctx.StopExecution()` on failure.
|
||||
func (ctx *context) Proceed(h Handler) bool {
|
||||
beforeIdx := ctx.currentHandlerIndex
|
||||
h(ctx)
|
||||
|
|
2
doc.go
2
doc.go
|
@ -35,7 +35,7 @@ Source code and other details for the project are available at GitHub:
|
|||
|
||||
Current Version
|
||||
|
||||
8.5.3
|
||||
8.5.4
|
||||
|
||||
Installation
|
||||
|
||||
|
|
2
iris.go
2
iris.go
|
@ -32,7 +32,7 @@ import (
|
|||
|
||||
const (
|
||||
// Version is the current version number of the Iris Web Framework.
|
||||
Version = "8.5.3"
|
||||
Version = "8.5.4"
|
||||
)
|
||||
|
||||
// HTTP status codes as registered with IANA.
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 93 KiB |
|
@ -103,6 +103,7 @@ func (b *basicAuthMiddleware) Serve(ctx context.Context) {
|
|||
auth, found := b.findAuth(ctx.GetHeader("Authorization"))
|
||||
if !found {
|
||||
b.askForCredentials(ctx)
|
||||
ctx.StopExecution()
|
||||
return
|
||||
// don't continue to the next handler
|
||||
}
|
||||
|
@ -115,6 +116,7 @@ func (b *basicAuthMiddleware) Serve(ctx context.Context) {
|
|||
|
||||
if time.Now().After(auth.expires) {
|
||||
b.askForCredentials(ctx) // ask for authentication again
|
||||
ctx.StopExecution()
|
||||
return
|
||||
}
|
||||
}
|
||||
|
|
113
version.go
113
version.go
|
@ -1,8 +1,8 @@
|
|||
package iris
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net/url"
|
||||
"os"
|
||||
|
@ -12,6 +12,9 @@ import (
|
|||
|
||||
"github.com/kataras/golog"
|
||||
"github.com/kataras/iris/core/netutil"
|
||||
"github.com/kataras/survey"
|
||||
|
||||
"github.com/skratchdot/open-golang/open"
|
||||
)
|
||||
|
||||
var checkVersionOnce = sync.Once{}
|
||||
|
@ -27,10 +30,11 @@ type versionInfo struct {
|
|||
Version string `json:"version"`
|
||||
ChangelogURL string `json:"changelog_url"`
|
||||
UpdateAvailable bool `json:"update_available"`
|
||||
FirstTime bool `json:"first_time"`
|
||||
}
|
||||
|
||||
func checkVersion() {
|
||||
client := netutil.Client(20 * time.Second)
|
||||
client := netutil.Client(30 * time.Second)
|
||||
r, err := client.PostForm("https://iris-go.com/version", url.Values{"current_version": {Version}})
|
||||
|
||||
if err != nil {
|
||||
|
@ -60,45 +64,88 @@ func checkVersion() {
|
|||
return
|
||||
}
|
||||
|
||||
format := "A new version is available online[%s > %s].\n"
|
||||
// shouldUpdate := false
|
||||
// prompt := &survey.Confirm{
|
||||
// Message: shouldUpdateNowMsg,
|
||||
// }
|
||||
|
||||
if v.ChangelogURL != "" {
|
||||
format += "Release notes: %s\n"
|
||||
// if err := survey.AskOne(prompt, &shouldUpdate, nil); err != nil {
|
||||
// return
|
||||
// }
|
||||
var qs []*survey.Question
|
||||
|
||||
// on help? when asking for installing the new update
|
||||
// and when answering "No".
|
||||
ignoreUpdatesMsg := "Would you like to ignore future updates? Disable the version checker via:\napp.Run(..., iris.WithoutVersionChecker)"
|
||||
|
||||
if v.UpdateAvailable {
|
||||
// if update available ask for update action.
|
||||
shouldUpdateNowMsg :=
|
||||
fmt.Sprintf("A new version is available online[%s > %s].\nRelease notes: %s.\nUpdate now?",
|
||||
v.Version, Version,
|
||||
v.ChangelogURL)
|
||||
|
||||
qs = append(qs, &survey.Question{
|
||||
Name: "shouldUpdateNow",
|
||||
Prompt: &survey.Confirm{
|
||||
Message: shouldUpdateNowMsg,
|
||||
Help: ignoreUpdatesMsg,
|
||||
},
|
||||
Validate: survey.Required,
|
||||
})
|
||||
}
|
||||
|
||||
format += "Update now?[%s]: "
|
||||
// firs time and update available is not relative because if no update often server will decide when to ask this,
|
||||
// so separate the actions and if statements here.
|
||||
if v.FirstTime {
|
||||
// if first time that this server was updated then ask if enjoying the framework.
|
||||
qs = append(qs, &survey.Question{
|
||||
Name: "enjoyingIris",
|
||||
Prompt: &survey.Confirm{
|
||||
Message: "Enjoying Iris Framework?",
|
||||
Help: "yes or no",
|
||||
},
|
||||
Validate: survey.Required,
|
||||
})
|
||||
}
|
||||
|
||||
// currentVersion.LessThan(latestVersion)
|
||||
updaterYesInput := [...]string{"y", "yes"}
|
||||
// Ask if should update(if available) and enjoying iris(if first time) in the same survey.
|
||||
ans := struct {
|
||||
ShouldUpdateNow bool `survey:"shouldUpdateNow"`
|
||||
EnjoyingIris bool `survey:"enjoyingIris"`
|
||||
}{}
|
||||
|
||||
golog.Warnf(format, v.Version, Version,
|
||||
v.ChangelogURL,
|
||||
updaterYesInput[0]+"/n")
|
||||
survey.Ask(qs, &ans)
|
||||
|
||||
silent := false
|
||||
|
||||
sc := bufio.NewScanner(os.Stdin)
|
||||
|
||||
shouldUpdate := silent
|
||||
|
||||
if !silent {
|
||||
if sc.Scan() {
|
||||
inputText := sc.Text()
|
||||
|
||||
for _, s := range updaterYesInput {
|
||||
if inputText == s {
|
||||
shouldUpdate = true
|
||||
}
|
||||
if ans.EnjoyingIris {
|
||||
// if the answer to the previous survey about enjoying the framework
|
||||
// was positive then do the survey (currently only one question and its action).
|
||||
qs2 := []*survey.Question{
|
||||
{
|
||||
Name: "starNow",
|
||||
Prompt: &survey.Confirm{
|
||||
Message: "Would you mind giving us a star on GitHub? It really helps us out! Thanks for your support:)",
|
||||
Help: "Its free so let's do that, type 'y'",
|
||||
},
|
||||
Validate: survey.Required,
|
||||
},
|
||||
/* any future questions should be here, at this second survey. */
|
||||
}
|
||||
ans2 := struct {
|
||||
StarNow bool `survey:"starNow"`
|
||||
}{}
|
||||
survey.Ask(qs2, &ans2)
|
||||
if ans2.StarNow {
|
||||
starRepo := "https://github.com/kataras/iris/stargazers"
|
||||
if err := open.Run(starRepo); err != nil {
|
||||
golog.Warnf("tried to open the browser for you but failed, please give us a star at: %s\n", starRepo)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if !shouldUpdate {
|
||||
golog.Infof("Ignore updates? Disable version checker via:\napp.Run(..., iris.WithoutVersionChecker)")
|
||||
return
|
||||
}
|
||||
|
||||
if shouldUpdate {
|
||||
// run the updater last, so the user can star the repo and at the same time
|
||||
// the app will update her/his local iris.
|
||||
if ans.ShouldUpdateNow { // it's true only when update was available and user typed "yes".
|
||||
repo := "github.com/kataras/iris/..."
|
||||
cmd := exec.Command("go", "get", "-u", "-v", repo)
|
||||
cmd.Stdout = os.Stdout
|
||||
|
@ -109,6 +156,8 @@ func checkVersion() {
|
|||
return
|
||||
}
|
||||
|
||||
golog.Infof("Update process finished.\nManual rebuild and restart is required to apply the changes...")
|
||||
golog.Infof("Update process finished.\nManual rebuild and restart is required to apply the changes...\n")
|
||||
} else {
|
||||
golog.Infof(ignoreUpdatesMsg)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user