Former-commit-id: d5e804babf0edc0765a4195247071e410b27ea27
14 KiB
I'm working hard on the dev branch for the next release of Iris.
Do you remember, last Christmas? I did publish the version 6 with net/http and HTTP/2 support, and you've embraced Iris with so much love, ultimately it was a successful move.
I tend to make surprises by giving you the most unique and useful features, especially on Christmas period.
This year, I intend to give you more gifts.
Don't worry, it will not contain any breaking changes, except of some MVC concepts that are re-designed.
The new Iris' MVC Ecosystem is ready on the dev/mvc. It contains features that you've never saw before, in any programming language framework. It is also, by far, the fastest MVC implementation ever created, very close to raw handlers - it's Iris, it's superior, we couldn't expect something different after all :) Treat that with respect as it treats you :)
I'm doing my bests to get it ready before Christmas.
Star or watch the repository to stay up to date and get ready for the most amazing features!
Yours faithfully, Gerasimos Maropoulos.
Iris
Iris is a fast, simple and efficient web framework for Go.
Iris provides a beautifully expressive and easy to use foundation for your next website, API, or distributed app.
Learn what others say about Iris and star this github repository to stay up to date.
Benchmarks from third-party source over the rest web frameworks
Updated at: Tuesday, 21 November 2017
Built with ♥️
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.
Accelerated by KeyCDN, a simple, fast and reliable CDN.
We are developing this project using the best code editor for Golang; Visual Studio Code supported by Microsoft.
If you're coming from nodejs world, Iris is the expressjs equivalent for Gophers.
Table Of Content
- Installation
- Latest changes
- Getting started
- Learn
- MVC (Model View Controller) NEW
- Structuring NEW
- HTTP Listening
- Configuration
- Routing, Grouping, Dynamic Path Parameters, "Macros" and Custom Context
- Subdomains
- Wrap
http.Handler/HandlerFunc
- View
- Authentication
- File Server
- How to Read from
context.Request() *http.Request
- How to Write to
context.ResponseWriter() http.ResponseWriter
- Test
- Cache
- Sessions
- Websockets
- Miscellaneous
- POC: Convert the medium-sized project "Parrot" from native to Iris
- POC: Isomorphic react/hot reloadable/redux/css-modules starter kit
- Typescript Automation Tools
- Tutorial: A URL Shortener Service using Go, Iris and Bolt
- Tutorial: Online Visitors
- Tutorial: Caddy
- Tutorial: DropzoneJS Uploader
- Tutorial:Iris Go Framework + MongoDB
- Middleware
- Dockerize
- Contributing
- FAQ
- What's next?
- People
Installation
The only requirement is the Go Programming Language
$ go get -u github.com/kataras/iris
Iris takes advantage of the vendor directory feature. You get truly reproducible builds, as this method guards against upstream renames and deletes.
Getting Started
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"))
}
Learn more about path parameter's types by clicking here.
<!-- file: ./views/hello.html -->
<html>
<head>
<title>Hello Page</title>
</head>
<body>
<h1>{{.message}}</h1>
</body>
</html>
Wanna re-start your app automatically when source code changes happens? Install the rizla tool and run
rizla main.go
instead ofgo run main.go
.
Guidelines for bootstrapping applications can be found at the _examples/structuring.
Now you are ready to move to the next step and get closer to becoming a pro gopher
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 😃
Don't forget to prepare yourself a cup of coffee, or tea, whatever enjoys you the most!
- Top 6 web frameworks for Go as of 2017
- Iris Go Framework + MongoDB
- How to build a file upload form using DropzoneJS and Go
- How to display existing files on server using DropzoneJS and Go
- Iris, a modular web framework
- Go vs .NET Core in terms of HTTP performance
- Iris Go vs .NET Core Kestrel in terms of HTTP performance
- How to Turn an Android Device into a Web Server
- Deploying a Iris Golang app in hasura
- A URL Shortener Service using Go, Iris and Bolt
People
The author of Iris is @kataras, you can reach him via;
Help this project to continue deliver awesome and unique features with the higher code quality as possible by donating any amount via PayPal or BTC.
For more information about contributing to the Iris project please check the CONTRIBUTING.md file.
We need your help with translations into your native language
Iris needs your help, please think about contributing to the translation of the README and https://iris-go.com, you will be rewarded.
Instructions can be found at: https://github.com/kataras/iris/issues/796
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!
Sponsors
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. Become a sponsor
License
Iris is licensed under the 3-Clause BSD License. Iris is 100% open-source software.
For any questions regarding the license please contact us.