[Iris] introduced Golang

Background

Go languages ​​is Google launched a new programming language that can reduce the complexity of the code in the application without loss of performance. Google's chief software engineer Rob Pike (Rob Pike) said: The reason why we developed Go, because of the difficulty of software development over the past 10 years or so frustrating.

Google senior software engineer Rob Pike (Rob Pike) expressed, "Go I never had to experience the efficiency of the development." Parker said, and today, like C or C ++, Go is a system language. He explained, "you can use it for rapid development, but it is a true compiled language, which is the reason why we now open source, because we think it has been very useful and powerful."

Features
  • Go to Google high hopes. It is designed to let software multi-core processors give full play to the advantages of the synchronous multiplex, and object-oriented programming to solve the trouble. It has a modern programming language features, such as garbage collection, to help programmers deal with the trivial and important memory management issues. Go the speed is very fast, almost as C or C ++ program as fast and quick production process.
  • Go site is created with Go, but Google has greater ambitions. The software is designed for building server software design (such as Google's Gmail). Google believes Go can also be applied to other areas, including the execution of software within the browser to replace the role of JavaScript.
    . .
Characteristic
  • concise
  • fast
  • Safety
  • parallel
  • interesting
  • Open source
  • Memory Management
  • An array of security
  • Compile quickly
Iris Introduction
  • Written once and run with minimal power machine in any place, such as Android, ios, Linux and Windows. It supports Google Go, only one service can be performed on all platforms.
  • Iris simple yet powerful api and famous. In addition to low-level access privileges Iris provides you. Iris is equally adept MVC. It is the only one with MVC architectural pattern rich support of Go Web framework, the performance cost is close to zero.
  • Iris provides a structure to build service-oriented applications for you. Construction of micro Iris is easy to use service.
Iris author says

Go is a great technology stack for building scalable Web applications, Web-based back-end systems.

When you consider building Web applications and Web API, or just build HTTP server in Go, do you think the standard net / http bag? Then you have to deal with common situations, such as dynamic routing (aka parametric), security and authentication, real-time communication and many other issues net / http can not be solved.

net / http package is incomplete, unable to quickly build a well-designed Web back-end systems. When this point you realize that you might think of these aspects:

Good, net / http package not for me, but there are a lot of framework, which is useful for me? !

Each of them told me it was the best. I do not know what to do!

I did some in-depth research and benchmarking with wrk and ab, in order to select the appropriate framework for me and my new project. Unfortunately, the result for me was really disappointed.

I began to wonder golang on the Internet is not as fast as I've ever read ... But before I let Golang continue to use nodejs development, I told myself:

'Makis, do not lose hope, at least to Golang a chance. Try to build something completely new, and not on before you see the "slow" Code; learn the secrets of this language, and let others follow your steps! '.

These are the words I told myself that day [13 March 2016].

The same night, I was reading a book about Greek mythology. I saw the name of an ancient goddess, and immediately inspired, for this new network framework (I've started writing) name - Iris.

Two months later, I was writing this introduction.

I'm still here, because Iris has successfully become the fastest network framework.

installation

iris Installation Requirements golang at least version 1.8, 1.9 is recommended

go get -u github.com/kataras/iris

Prior to Go 1.9, you must import the "github.com/kataras/iris/context" to create a Handler: such as what programs:

    package main
    import (
        "github.com/kataras/iris"
        "github.com/kataras/iris/context"//需要单独引入
    )
    func main() {
        app := iris.New()
        app.Get("/", func(ctx context.Context){})
        app.Run(iris.Addr(":8080"))
    }

Go 1.9 from the beginning, after that you do not have to import, you can optionally do this:

	package main
    import "github.com/kataras/iris"
    func main() {
        app := iris.New()
        app.Get("/", func(ctx iris.Context){})
        app.Run(iris.Addr(":8080"))
    }
reference

https://studyiris.com/doc/

Published 293 original articles · won praise 13 · views 80000 +

Guess you like

Origin blog.csdn.net/LU_ZHAO/article/details/105206397