Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
github.com/codehakase/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.
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 package, we own many thanks to Brad Fitzpatrick for that.
If you're coming from Node.js world, this is the expressjs equivalent for the Go Programming Language.
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.
Star and watch this github repository to stay up to date.
Updated at: Friday, 29 September 2017
Help this project to continue deliver awesome and unique features with the higher code quality as possible by donating any amount via PayPal!
Name | Amount | Membership |
---|---|---|
Juan Sebastián Suárez Valencia | 20 EUR | Bronze |
Bob Lee | 20 EUR | Bronze |
Celso Luiz | 50 EUR | Silver |
Ankur Srivastava | 20 EUR | Bronze |
Damon Zhao | 20 EUR | Bronze |
Exponity - Tech Company | 30 EUR | Bronze |
Thomas Fritz | 25 EUR | Bronze |
Thanos V. | 20 EUR | Bronze |
George Opritescu | 20 EUR | Bronze |
Lex Tang | 20 EUR | Bronze |
Bill Q. | 600 EUR | Gold |
Conrad Steenberg | 25 EUR | Bronze |
http.Handler/HandlerFunc
context.Request() *http.Request
context.ResponseWriter() http.ResponseWriter
The only requirement is the Go Programming Language, at least version 1.8 but 1.9 is highly recommended.
$ 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.
// 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
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"))
}
<!-- file: ./views/hello.html -->
<html>
<head>
<title>Hello Page</title>
</head>
<body>
<h1>{{.message}}</h1>
</body>
</html>
$ go run main.go
> Now listening on: http://localhost:8080
> Application started. Press CTRL+C to shut down.
Examples and docs are updated to Go 1.9, please refer to that section before anything else.
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 file and opposite, if you use go 1.8 and you're new to Iris you can see that 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.
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"))
}
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)
}
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:
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
iris is easy, it has a familiar API while in the same has far more features than Gin or Martini.
You own your code —it will never generate (unfamiliar) code for you, like Beego, Revel and Buffalo do.
It's not just-another-router but its overall performance is equivalent with something like httprouter.
Unlike 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.
net/http
and negroni-like
handlers are compatible via iris.FromStd
go-bindata
net/http#Server
html/template
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 is a great place to get started!
Read the godocs for a better understanding.
Join the welcoming community of fellow iris developers in rocket.chat
The most useful community repository for iris developers is the 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!
$ go get -u github.com/iris-contrib/middleware/...
Iris exceeded all expectations, started as one-man project.
Current: 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 file.
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.
Previous versions can be found at releases page.
The original 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!
This software is licensed under the open-source 3-Clause BSD.
You can find the license file here, for any questions regarding the license please contact us.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.