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 6f9a453160
DBUG API: mark overlapped routes, hide the builtin functionality (read description)
also reference the correct file:line on <autogenerated> (by searching for the file,line of method inside the embedded fields themselves, as go automatically generates the methods foreach struct for their embedded fields)

fix UseGlobal may override the overlap feature
2020-08-28 16:02:14 +03:00
_benchmarks move benchmarks to a repository which its results are re-calculated and its README re-generated on each run. This will allow dev community to participate and contribute 2020-03-12 01:51:21 +02:00
_examples fix https://github.com/kataras/iris/issues/1608 with the help of @AlbinoGeek for monitoring and together found the source of the problem 2020-08-28 06:21:26 +03:00
.github issue template: ask for the iris version 2020-07-24 22:51:00 +03:00
apps add on-site documentation for the new 'apps' subpackage 2020-08-21 04:19:13 +03:00
cache re-add the mutex on sessions.LifeTime 2020-08-12 07:48:45 +03:00
context fix https://github.com/kataras/iris/issues/1608 with the help of @AlbinoGeek for monitoring and together found the source of the problem 2020-08-28 06:21:26 +03:00
core DBUG API: mark overlapped routes, hide the builtin functionality (read description) 2020-08-28 16:02:14 +03:00
hero overlap routing: and mvc: allow setting status code from a dependency or a middleware 2020-08-28 04:11:56 +03:00
httptest minor 2020-07-20 13:36:39 +03:00
i18n implement #1593 - Read HISTORY.md 2020-08-18 08:05:51 +03:00
macro (#1554) Add support for all common compressions (write and read) 2020-07-10 23:21:09 +03:00
middleware DBUG API: mark overlapped routes, hide the builtin functionality (read description) 2020-08-28 16:02:14 +03:00
mvc DBUG API: mark overlapped routes, hide the builtin functionality (read description) 2020-08-28 16:02:14 +03:00
sessions see https://github.com/kataras/iris/issues/1591#issuecomment-674473247 2020-08-16 18:04:52 +03:00
versioning overlap routing: and mvc: allow setting status code from a dependency or a middleware 2020-08-28 04:11:56 +03:00
view various improvements and new 'UseOnce' method - read HISTORY.md 2020-08-06 03:35:58 +03:00
websocket (#1554) Add support for all common compressions (write and read) 2020-07-10 23:21:09 +03:00
.fossa.yml Add the new websocket package (which is just a helper for kataras/neffos) and an example for go server, client, browser client and nodejs client. Add a .fossa.yml and the generated NOTICE file for 3rd-party libs. Update go.mod, go.sum. Update the vendor folder for pongo2 to its latest master as well 2019-06-02 17:49:45 +03:00
.gitattributes minor 2020-01-05 18:27:21 +02:00
.gitignore new apps/switch (beta) 2020-08-17 21:53:17 +03:00
.travis.yml new apps/switch (beta) 2020-08-17 21:53:17 +03:00
aliases.go fix https://github.com/kataras/iris/issues/1608 with the help of @AlbinoGeek for monitoring and together found the source of the problem 2020-08-28 06:21:26 +03:00
AUTHORS Update to version 8.5.5 | Read HISTORY.md 2017-11-02 05:54:33 +02:00
cli.go see https://github.com/kataras/iris/issues/1591#issuecomment-674473247 2020-08-16 18:04:52 +03:00
CODE_OF_CONDUCT.md Update to version 8.5.5 | Read HISTORY.md 2017-11-02 05:54:33 +02:00
configuration_test.go Add Configuration.RemoteAddrHeadersForce as requested at #1567 and change RemoteAddrHeaders from map to string slice 2020-07-26 14:37:30 +03:00
configuration.go implement #1593 - Read HISTORY.md 2020-08-18 08:05:51 +03:00
CONTRIBUTING.md update faq, contributing and go workflow 2019-11-20 02:51:16 +02:00
doc.go implement #1536 with (SetRegisterRule(iris.RouteOverlap)) 2020-06-14 08:09:42 +03:00
FAQ.md FAQ: minor 2020-08-12 23:12:02 +03:00
go.mod add two new examples and share the app's specific logger instance with sessions databases and APIBuilder 2020-08-16 07:07:36 +03:00
HISTORY_ES.md reorganization of _examples and add some new examples such as iris+groupcache+mysql+docker 2020-06-07 15:26:06 +03:00
HISTORY.md Add Party.ResetRouterFilters 2020-08-26 06:57:36 +03:00
iris.go mvc: struct field and method dependency logs on debug level. Read HISTORY.md 2020-08-24 21:44:29 +03:00
LICENSE miscellaneous 2020-01-07 03:41:07 +02:00
NOTICE add iris.Minify middleware and Context.OnCloseErr/OnConnectionCloseErr 2020-08-15 17:21:57 +03:00
README_ES.md mvc: struct field and method dependency logs on debug level. Read HISTORY.md 2020-08-24 21:44:29 +03:00
README_FA.md mvc: struct field and method dependency logs on debug level. Read HISTORY.md 2020-08-24 21:44:29 +03:00
README_FR.md mvc: struct field and method dependency logs on debug level. Read HISTORY.md 2020-08-24 21:44:29 +03:00
README_GR.md mvc: struct field and method dependency logs on debug level. Read HISTORY.md 2020-08-24 21:44:29 +03:00
README_KO.md mvc: struct field and method dependency logs on debug level. Read HISTORY.md 2020-08-24 21:44:29 +03:00
README_RU.md mvc: struct field and method dependency logs on debug level. Read HISTORY.md 2020-08-24 21:44:29 +03:00
README_ZH.md mvc: struct field and method dependency logs on debug level. Read HISTORY.md 2020-08-24 21:44:29 +03:00
README.md Thanks @sumjoe ❤️ 2020-08-28 08:31:50 +03:00
VERSION Update to version 12.1.8 - Read HISTORY.md 2020-02-16 11:14:35 +02:00

Black Lives Matter

This is the under-development branch. Stay tuned for the upcoming release v12.2.0. Looking for a stable release? Head over to the v12.1.8 branch instead.

Try the official Iris Command Line Interface today!

Iris Web Framework

build status view examples chat donate

Iris is a fast, simple yet fully featured and very efficient web framework for Go.

It provides a beautifully expressive and easy to use foundation for your next website or API.

Learn what others saying about Iris and star this open-source project to support its potentials.

Benchmarks: Jul 18, 2020 at 10:46am (UTC)

👑 Supporters

Joseph De Paola Damon Blais 陆 轶丰 Weihang Ding Li Fang TechMaster lenses.io Celso Souza Altafino Thomas Fritz Conrad Steenberg Damon Zhao George Opritescu Juanses Ankur Srivastava Lex Tang li3p

📖 Learning Iris

# https://github.com/kataras/iris/wiki/Installation
$ go get github.com/kataras/iris/v12@master
# assume the following code in main.go file
$ cat main.go
package main

import "github.com/kataras/iris/v12"

func main() {
	app := iris.New()

	booksAPI := app.Party("/books")
	{
		booksAPI.Use(iris.Compression)

		// GET: http://localhost:8080/books
		booksAPI.Get("/", list)
		// POST: http://localhost:8080/books
		booksAPI.Post("/", create)
	}

	app.Listen(":8080")
}

// Book example.
type Book struct {
	Title string `json:"title"`
}

func list(ctx iris.Context) {
	books := []Book{
		{"Mastering Concurrency in Go"},
		{"Go Design Patterns"},
		{"Black Hat Go"},
	}

	ctx.JSON(books)
	// TIP: negotiate the response between server's prioritizes
	// and client's requirements, instead of ctx.JSON:
	// ctx.Negotiation().JSON().MsgPack().Protobuf()
	// ctx.Negotiate(books)
}

func create(ctx iris.Context) {
	var b Book
	err := ctx.ReadJSON(&b)
	// TIP: use ctx.ReadBody(&b) to bind
	// any type of incoming data instead.
	if err != nil {
		ctx.StopWithProblem(iris.StatusBadRequest, iris.NewProblem().
			Title("Book creation failure").DetailErr(err))
		// TIP: use ctx.StopWithError(code, err) when only
		// plain text responses are expected on errors.
		return
	}

	println("Received Book: " + b.Title)

	ctx.StatusCode(iris.StatusCreated)
}

MVC equivalent:

import "github.com/kataras/iris/v12/mvc"
m := mvc.New(booksAPI)
m.Handle(new(BookController))
type BookController struct {
	/* dependencies */
}

// GET: http://localhost:8080/books
func (c *BookController) Get() []Book {
	return []Book{
		{"Mastering Concurrency in Go"},
		{"Go Design Patterns"},
		{"Black Hat Go"},
	}
}

// POST: http://localhost:8080/books
func (c *BookController) Post(b Book) int {
	println("Received Book: " + b.Title)

	return iris.StatusCreated
}

Run your Iris web server:

$ go run main.go
> Now listening on: http://localhost:8080
> Application started. Press CTRL+C to shut down.

List Books:

$ curl --header 'Accept-Encoding:gzip' http://localhost:8080/books

[
  {
    "title": "Mastering Concurrency in Go"
  },
  {
    "title": "Go Design Patterns"
  },
  {
    "title": "Black Hat Go"
  }
]

Create a new Book:

$ curl -i -X POST \
--header 'Content-Encoding:gzip' \
--header 'Content-Type:application/json' \
--data "{\"title\":\"Writing An Interpreter In Go\"}" \
http://localhost:8080/books

> HTTP/1.1 201 Created

That's how an error response looks like:

$ curl -X POST --data "{\"title\" \"not valid one\"}" \
http://localhost:8080/books

> HTTP/1.1 400 Bad Request

{
  "status": 400,
  "title": "Book creation failure"
  "detail": "invalid character '\"' after object key",
}

run in the browser

Iris contains extensive and thorough wiki making it easy to get started with the framework.

For a more detailed technical documentation you can head over to our godocs. And for executable code you can always visit the ./_examples repository's subdirectory.

Do you like to read while traveling?

Book cover

follow Iris web framework on twitter

follow Iris web framework on facebook

You can request a PDF version and online access of the E-Book today and be participated in the development of Iris.

🙌 Contributing

We'd love to see your contribution to the Iris Web Framework! For more information about contributing to the Iris project please check the CONTRIBUTING.md file.

List of all Contributors

🛡 Security Vulnerabilities

If you discover a security vulnerability within Iris, please send an e-mail to iris-go@outlook.com. All security vulnerabilities will be promptly addressed.

📝 License

This project is licensed under the BSD 3-clause license, just like the Go project itself.

The project name "Iris" was inspired by the Greek mythology.