The fastest HTTP/2 Go Web Framework. New, modern and easy to learn. Fast development with Code you control. Unbeatable cost-performance ratio 🚀
Go to file
Gerasimos (Makis) Maropoulos 4de98254fd (silly) Fix https://github.com/kataras/iris/issues/633
Former-commit-id: 0359fbf7dd3ff151db7b0575510e611bed683d0e
2017-02-22 16:38:55 +02:00
.github Add a simple and pure .Regex middleware for routers that don't support regex route path validations out-of-the-box 2017-02-22 00:51:50 +02:00
adaptors (silly) Fix https://github.com/kataras/iris/issues/633 2017-02-22 16:38:55 +02:00
httptest Make ExecRouteAgainst to work better and fix gorillamux and httprouter, remove of contextlinker policy it's useless now 2017-02-18 07:03:37 +02:00
iris 20 days of unstoppable work. Waiting fo go 1.8, I didn't finish yet, some touches remains. 2017-02-14 05:54:11 +02:00
middleware Fix history big mistakes, point links to /v6 tag only https://github.com/kataras/iris/issues/606 2017-02-18 07:22:57 +02:00
.gitignore Add tests for RedirectTo, Sessions, Flash messages and for Cookies. 2017-02-19 10:23:01 +02:00
.travis.yml Remove entirely go 1.7 travis 2017-02-17 05:08:52 +02:00
addr_test.go Add tests for RedirectTo, Sessions, Flash messages and for Cookies. 2017-02-19 10:23:01 +02:00
addr.go Add the new Go 1.8 Shutdown | Remove DisableBanner, is controlled by LoggerPolicy now. 2017-02-17 04:46:33 +02:00
configuration_test.go HTTP/2 Push https://github.com/kataras/iris/issues/565 2017-02-17 04:57:51 +02:00
configuration.go Add a simple and pure .Regex middleware for routers that don't support regex route path validations out-of-the-box 2017-02-22 00:51:50 +02:00
context_test.go Add tests for context binders, render policy and readform 2017-02-21 13:26:30 +02:00
context.go Add tests for context binders, render policy and readform 2017-02-21 13:26:30 +02:00
doc.go godoc.go: Run small paragraph 2017-02-17 09:38:06 +02:00
DONATIONS.md 20 days of unstoppable work. Waiting fo go 1.8, I didn't finish yet, some touches remains. 2017-02-14 05:54:11 +02:00
fs.go Add an example for httprouter_test, gofmt everything and misspel fixes. 2017-02-17 10:45:47 +02:00
handler_test.go Add a simple and pure .Regex middleware for routers that don't support regex route path validations out-of-the-box 2017-02-22 00:51:50 +02:00
handler.go 20 days of unstoppable work. Waiting fo go 1.8, I didn't finish yet, some touches remains. 2017-02-14 05:54:11 +02:00
HISTORY.md (silly) Fix https://github.com/kataras/iris/issues/633 2017-02-22 16:38:55 +02:00
iris.go Add error message when reverse routing using gorillamux happens before boot 2017-02-18 08:18:09 +02:00
LICENSE Happy new year! Update to 6.0.0 | HTTP/2 full support. https://github.com/kataras/iris/issues/565 2017-01-02 21:20:17 +02:00
logo.jpg Fix https://github.com/iris-contrib/middleware/issues/13 2016-09-30 18:48:48 +03:00
policy_gorillamux_test.go Add a simple and pure .Regex middleware for routers that don't support regex route path validations out-of-the-box 2017-02-22 00:51:50 +02:00
policy_httprouter_test.go Add a simple and pure .Regex middleware for routers that don't support regex route path validations out-of-the-box 2017-02-22 00:51:50 +02:00
policy_nativerouter_test.go Add tests for RedirectTo, Sessions, Flash messages and for Cookies. 2017-02-19 10:23:01 +02:00
policy_render_test.go Add tests for context binders, render policy and readform 2017-02-21 13:26:30 +02:00
policy_sessions_test.go Add tests for RedirectTo, Sessions, Flash messages and for Cookies. 2017-02-19 10:23:01 +02:00
policy.go (silly) Fix https://github.com/kataras/iris/issues/633 2017-02-22 16:38:55 +02:00
README.md Update README. 2017-02-21 15:08:28 +02:00
response_recorder.go HTTP/2 Push https://github.com/kataras/iris/issues/565 2017-02-17 04:57:51 +02:00
response_writer_test.go Add the new Go 1.8 Shutdown | Remove DisableBanner, is controlled by LoggerPolicy now. 2017-02-17 04:46:33 +02:00
response_writer.go Travis go 1.8 2017-02-17 05:05:55 +02:00
route_test.go Make ExecRouteAgainst to work better and fix gorillamux and httprouter, remove of contextlinker policy it's useless now 2017-02-18 07:03:37 +02:00
route.go Make ExecRouteAgainst to work better and fix gorillamux and httprouter, remove of contextlinker policy it's useless now 2017-02-18 07:03:37 +02:00
router.go (silly) Fix https://github.com/kataras/iris/issues/633 2017-02-22 16:38:55 +02:00
status_test.go Move the status code simplest tests to one file 2017-02-21 14:33:34 +02:00
status.go 20 days of unstoppable work. Waiting fo go 1.8, I didn't finish yet, some touches remains. 2017-02-14 05:54:11 +02:00
transaction_test.go add white box tests for transaction, response writer and some of the context's method 2017-02-17 02:14:46 +02:00
transaction.go 20 days of unstoppable work. Waiting fo go 1.8, I didn't finish yet, some touches remains. 2017-02-14 05:54:11 +02:00

Logo created by an Iris community member, https://github.com/OneebMalik

Build Status

http://goreportcard.com/report/kataras/iris

Runs everywhere

Built with GoLang

Donation


Iris is an efficient and well-designed toolbox with robust set of features.
Write your own perfect high-performance web applications
with unlimited potentials and portability.

Hashtag #Not_Just_YAWF

CHANGELOG/HISTORY

Examples for new Gophers

Docs

Chat

Iris is fully vendored. That means it is independent of any API changes in the used libraries and will work seamlessly in the future!

The size of the executable file is a critical part of the Application Deployment Process,

I made two very simple identical applications, the first written with a famous mini web framework named gin(=a Router, with logger, recover and pure Context out-of-the-box support) and the second in iris (=every feature that you will need at the first place is bundled when you install Iris. Including sessions, websockets, typescript support, a cloud-editor, the view engine with 5 different template parsers, two Routers to select from, an end-to-end framework to test your API, more than 60 handy helpers via Context, complete rest API implementation, and cors, basicauth, internalization i18n, logger and recover middleware out-of-the-box).

I ran go build for both of them,

  • gin had 9.029 KB overall file size,
  • iris had 8.505 KB overall file size!
  • net/http had produced an executable file with 5.380 KB size.

The app didn't used any third-party library. If you test the same thing I test and adapt other features like sessions and websockets then the size of gin and net/http could be doubled while iris' overall file size will remain almost the same.

Applications that are written using Iris produce smaller file size even if they use more features than a simple router library!

Q: How is that possible?

A: The Iris' vendor was done manually without any third-party tool. That means that I had the chance to remove any unnecessary code that Iris never uses internally.

Always follows the latest trends and best practices. Iris is the Secret To Staying One Step Ahead of Your Competition.

Iris is a high-performance tool, but it doesn't stops there. Performance depends on your application too, Iris helps you to make the right choices on every step.

Familiar and easy API. Sinatra-like REST API.

Contains examples and documentation for all its features.

Iris is a low-level access web framework, you always know what you're doing.

You'll never miss a thing from net/http, but if you do on some point, no problem because Iris is fully compatible with stdlib, you still have access to http.ResponseWriter and http.Request, you can adapt any third-party middleware of form func(http.ResponseWriter, *http.Request, next http.HandlerFunc) as well.

Iris is a community-driven project, you suggest and I code.

Unlike other repositories, this one is very active. When you post an issue, you get an answer at the next couple of minutes(hours at the worst). If you find a bug, I am obliged to fix that on the same day.

Q: Why this framework is better than alternatives, does the author is, simply, better than other developers?

A: Probably not, I don't think that I'm better than anyone else, I still learning every single day. The answer is that I have all the world's time to code for Iris the whole day, I don't have any obligations to anybody else, except you. I'd describe my self as a very dedicated FOSS developer.

Click the below animation to see what people say about Iris.

What people say

Installation

The only requirement is the Go Programming Language, at least 1.8

$ go get gopkg.in/kataras/iris.v6

Overview

package main

import (
	"gopkg.in/kataras/iris.v6"
	"gopkg.in/kataras/iris.v6/adaptors/view"
	"gopkg.in/kataras/iris.v6/adaptors/httprouter"
)

func main() {
	app := iris.New()
	app.Adapt(iris.Devlogger()) // adapt a logger which prints all errors to the os.Stdout
	app.Adapt(httprouter.New()) // adapt the adaptors/httprouter or adaptors/gorillamux

	// 5 template engines are supported out-of-the-box:
	//
	// - standard html/template
	// - amber
	// - django
	// - handlebars
	// - pug(jade)
	//
	// Use the html standard engine for all files inside "./views" folder with extension ".html"
	templates := view.HTML("./views", ".html")
	app.Adapt(templates)

	// http://localhost:6200
	// Method: "GET"
	// Render ./views/index.html
	app.Get("/", func(ctx *iris.Context) {
		ctx.Render("index.html", nil)
	})

	// Group routes, optionally: share middleware, template layout and custom http errors.
	userAPI := app.Party("/users", userAPIMiddleware).
		Layout("layouts/userLayout.html")
	{
		// Fire userNotFoundHandler when Not Found
		// inside http://localhost:6200/users/*anything
		userAPI.OnError(404, userNotFoundHandler)

		// http://localhost:6200/users
		// Method: "GET"
		userAPI.Get("/", getAllHandler)

		// http://localhost:6200/users/42
		// Method: "GET"
		userAPI.Get("/:id", getByIDHandler)

		// http://localhost:6200/users
		// Method: "POST"
		userAPI.Post("/", saveUserHandler)
	}

	// Start the server at 127.0.0.1:6200
	app.Listen(":6200")
}

func getByIDHandler(ctx *iris.Context) {
	// take the :id from the path, parse to integer
	// and set it to the new userID local variable.
	userID, _ := ctx.ParamInt("id")

	// userRepo, imaginary database service <- your only job.
	user := userRepo.GetByID(userID)

	// send back a response to the client,
	// .JSON: content type as application/json; charset="utf-8"
	// iris.StatusOK: with 200 http status code.
	//
	// send user as it is or make use of any json valid golang type,
	// like the iris.Map{"username" : user.Username}.
	ctx.JSON(iris.StatusOK, user)
}

TIP: Execute iris run main.go to enable hot-reload on .go source code changes.

TIP: Add templates.Reload(true) to monitor the template changes.

Documentation

  • New GOpher? Welcome! Take a look at the GopherBOOk

  • Numerous of examples can be found here

  • ./adaptors and ./middleware contains examples of their usage.

  • HISTORY.md is your best friend, version migrations are released there.

  • The most important is to know where to find the details

FAQ

Explore these questions and join to our community chat!

Testing

You can find End-To-End test examples by navigating to the source code.

A simple test is located to ./httptest/_example/main_test.go

Read more about gavv's httpexpect.

Philosophy

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 nginx itself.

Iris does not force you to use any specific ORM or template engine. With support for the most used template engines (6+), you can quickly craft the perfect application.

People & Support

The author of Iris is @kataras.

The Success of Iris belongs to YOU with your bug reports and feature requests that made this Framework so Unique.

Who is kataras?

Hi, my name is Gerasimos Maropoulos and I'm the author of this project, let me put a few words about me.

I started to design Iris the night of the 13 March 2016, some weeks later, iris started to became famous and I have to fix many issues and implement new features, but I didn't have time to work on Iris because I had a part time job and the (software engineering) colleague which I studied.

I wanted to make iris' users proud of the framework they're using, so I decided to interrupt my studies and colleague, two days later I left from my part time job also.

Today I spend all my days and nights coding for Iris, and I'm happy about this, therefore I have zero incoming value.

  • Star the project, will help you to follow the upcoming features.
  • Donate, if you can afford any cost.
  • Write an article about Iris or even post a Tweet.
  • Do Pull Requests on the iris-contrib organisation's repositories, like book, examples and to gopherbook.

If you are interested in contributing to the Iris project, please see the document CONTRIBUTING.

Contact

Besides the fact that we have a community chat for questions or reports and ideas, stackoverflow section for generic go+iris questions and the github issues for bug reports and feature requests, you can also contact with me, as a person who is always open to help you:

Versioning

Current: v6, code-named as "√Νεxτ"

v5: https://github.com/kataras/iris/tree/5.0.0

License

Unless otherwise noted, the source files are distributed under the MIT License found in the LICENSE file.

Note that some optional components that you may use with Iris requires different license agreements.

TODO

  • Refactor the Examples to be align with the latest version
  • Upgrade GitBook for the latest release
  • Add some missing tests from the previous version and find a way to share these end-to-end tests accross the adaptors and the root
  • Replace http://iris-go.com content to something more fancy, as suggested here
  • Make a table list of the most famous middleware(s) with their descriptions, in order to help new Gophers find what they're looking for

Iris is a Community-Driven project waiting for your feature requests!