Article source: studygolang.com/articles/53…

beego.me/

Github.com/astaxie/bee…

Beego. me/docs/intro/ 英 文

Beego. me/products Open source case

Beego is a fast development of Go application HTTP framework, the author is SegmentFault user, Go language technology leader @asta Xie. Beego can be used for rapid development of API, Web, back-end services and other applications. It is a RESTFul framework, mainly inspired by Tornado, Sinatra and Flask. But a framework designed to combine some of Go’s own features (interface, struct inheritance, etc.).

Beego architecture

The overall design architecture of Beego is as follows:

Beego is a highly decoupled framework built on eight independent modules. When designing BeeGo, we consider the modularization of functions. Even if the HTTP logic of Beego is not applicable to users, they can also use these independent modules. For example, you can use the cache module to do your cache logic, use the log module to record your operation information, use the Config module to parse your files in various formats. So not only in Beego development, your socket game development is a very useful module, which is one of the reasons why Beego is so popular. If you have ever played Lego, you should know that a lot of advanced things are built by building blocks, and when designing BeeGo, these modules are blocks, and advanced robots are Beego. The functions of these modules and how to use them are described in subsequent documents.

Beego’s execution logic

Since Beego is built around these modules, what is its execution logic? Beego is a typical MVC architecture, and its execution logic is shown in the figure below:

Beego project structure

The general List of Beego projects is as follows:

├ ─ ─ the conf │ └ ─ ─ app. Conf ├ ─ ─ controllers │ ├ ─ ─ the admin │ └ ─ ─ default. Go ├ ─ ─ main. Go ├ ─ ─ models │ └ ─ ─ models. Go ├ ─ ─ the static │ ├ ─ ─ CSS │ ├ ─ ─ ico │ ├ ─ ─ img │ └ ─ ─ js └ ─ ─ views ├ ─ ─ the admin └ ─ ─ index. The TPLCopy the code

M(The models directory), V(the views directory), C(the controllers directory), main.go is the entry file.