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 53c6f46941
README: minor
2020-07-28 13:56:52 +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 correctly handle recorded compressed response 2020-07-26 20:28:31 +03:00
.github issue template: ask for the iris version 2020-07-24 22:51:00 +03:00
cache New DirOptions.Cache field for in-memory caching and pre-compression for the fastest possible static file server 2020-07-24 13:03:49 +03:00
context minor, see prev commit 2020-07-26 20:32:31 +03:00
core fix https://github.com/kataras/iris/issues/1569#issuecomment-663739177 2020-07-25 09:23:34 +03:00
hero docfix #1566 2020-07-24 21:09:30 +03:00
httptest minor 2020-07-20 13:36:39 +03:00
i18n (#1554) Add support for all common compressions (write and read) 2020-07-10 23:21:09 +03:00
macro (#1554) Add support for all common compressions (write and read) 2020-07-10 23:21:09 +03:00
middleware add HashGenerator on requestid middleware 2020-07-15 11:18:40 +03:00
mvc docfix #1566 2020-07-24 21:09:30 +03:00
sessions fix #1553 2020-07-19 07:09:14 +03:00
versioning (#1554) Add support for all common compressions (write and read) 2020-07-10 23:21:09 +03:00
view New DirOptions.Cache field for in-memory caching and pre-compression for the fastest possible static file server 2020-07-24 13:03:49 +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 file-server: fix ShowList on root dir 2020-07-05 05:39:48 +03:00
.travis.yml remove the 'typescript' package entirely in favor of iris-cli and because the alm editor was deprecated by its author (consider using the designtsx.com instead) 2020-04-19 16:47:15 +03:00
aliases.go New DirOptions.Cache field for in-memory caching and pre-compression for the fastest possible static file server 2020-07-24 13:03:49 +03:00
AUTHORS Update to version 8.5.5 | Read HISTORY.md 2017-11-02 05:54:33 +02:00
cli.go fix #1557 2020-07-11 16:14:31 +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 Add Configuration.RemoteAddrHeadersForce as requested at #1567 and change RemoteAddrHeaders from map to string slice 2020-07-26 14:37:30 +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 README: add 'run in the browser' button 2020-06-24 00:13:31 +03:00
go.mod Update go.mod 2020-07-24 23:39:01 +02: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 Configuration.RemoteAddrHeadersForce as requested at #1567 and change RemoteAddrHeaders from map to string slice 2020-07-26 14:37:30 +03:00
iris.go minor 2020-07-20 13:36:39 +03:00
LICENSE miscellaneous 2020-01-07 03:41:07 +02:00
NOTICE (#1554) Add support for all common compressions (write and read) 2020-07-10 23:21:09 +03:00
README_ES.md README: add 'run in the browser' button 2020-06-24 00:13:31 +03:00
README_FA.md README: add 'run in the browser' button 2020-06-24 00:13:31 +03:00
README_FR.md README: add 'run in the browser' button 2020-06-24 00:13:31 +03:00
README_GR.md README: add 'run in the browser' button 2020-06-24 00:13:31 +03:00
README_KO.md README: add 'run in the browser' button 2020-06-24 00:13:31 +03:00
README_RU.md README: add 'run in the browser' button 2020-06-24 00:13:31 +03:00
README_ZH.md README: add 'run in the browser' button 2020-06-24 00:13:31 +03:00
README.md README: minor 2020-07-28 13:56:52 +03:00
VERSION Update to version 12.1.8 - Read HISTORY.md 2020-02-16 11:14:35 +02:00

News

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.

The official Iris Command Line Interface will soon be near you in 2020!

Support your favorite web framework through Github Sponsors Program!

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)

📖 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

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.