框架简介
beego 是一个快速开发 Go 应用的 HTTP 框架,它可以用来快速开发 API、Web 及后端服务等各种应用,是一个 RESTful 的框架,主要设计灵感来源于 tornado、sinatra 和 flask 这三个框架,但是结合了 Go 本身的一些特性(interface、struct 嵌入等)而设计的一个框架。
我所使用的学习资料:
- beego 官方文档:https://beego.me/
- beego学习路线图(见文末)
MVC设计模式
beego是一个典型的MVC设计模式:
- Model(模型)是应用程序中用于处理应用程序数据逻辑的部分。通常模型对象负责在数据库中存取数据。
- View(视图)是应用程序中处理数据显示的部分。通常视图是依据模型数据创建的。
- Controller(控制器)是应用程序中处理用户交互的部分。通常控制器负责从视图读取数据,控制用户输入,并向模型发送数据。
项目结构
beego框架的结构树如下图所示:
├── conf│
└── app.conf
├── controllers│
├── admin│
└── default.go
├── main.go
├── models│
└── models.go
├── static│
├── css│
├── ico│
├── img│
└── js
└── views
├── admin
└── index.tpl
从上面的目录结构我们可以看出来 M(models 目录)、V(views 目录)和 C(controllers 目录)的结构, main.go 是入口文件,conf是配置文件目录,controllers是控制器目录、model是model文件存放目录、static是静态资源存放目录,views是界面目录。
搭建教程
现在以 Windows 10 + Golang 1.13 + Jetbrains GoLand 为开发环境演示搭建 beego 框架的教程。
- 安装
打开 Jetbrains GoLand ( PowerShell也可 ) ,在终端 Terminal 输入以下命令下载 beego包,需要挂载代理。
$ go get -u github.com/astaxie/beego
$ go get -u github.com/beego/bee
- 配置环境变量(如果事先已经配置好 Golang 的开发环境可以跳过这一步)
新建一个用户变量GOPATH,编辑写上你的Golang工作目录(用于存放开发者的工程项目及第三方包);新建一个用户变量GOROOT,填上你的Golang安装路径(根目录)。
【注】:GOPATH可以自定义位置,GOROOT必须遵从Golang的安装路径。
- 切换工作目录查看当前包
请注意,开发者的Golang源代码文件和第三方包都被保存在GOPATH的src文件夹下。可切换至工作目录查看beego包是否已经下载成功。
$ cd $GOPATH/src$ cd github.com
$ ls
- 构建beego项目
bee 工具是一个为了协助快速开发 beego 项目而创建的项目,通过 bee 您可以很容易的进行 beego 项目的创建、热编译、开发、测试、和部署。
$ bee new beegoProject
$ cd beegoProject
$ bee run
使用 bee new 命令新建一个名为“beegoProject”的项目文件。
切换至 beegoProject 项目文件夹,可以观察到它的项目树结构如下显示:
然后用cd命令切换至文件夹,最后用 bee run 初始化文件夹;如果输出以下信息,证明 beegoProject 项目文件已被初始化成功。
根据输出信息,返回一个URL:http://127.0.0.1:8080 ,在浏览器打开这个地址,如果能打开这个画面,就证明整个 beego 框架搭建教程就到此结束了!
学习路线
附:beego 学习路线规划
I think what you published was actually very reasonable. Marianna Craggie Gideon
Hello there, just became alert to your blog through Google, and found that it is truly informative. Stafani Hoyt Horne
I really like and appreciate your blog. Thanks Again. Fantastic. Corliss Roddie Riti
Hi there mates, its wonderful post about educationand entirely defined, keep it up all the time. Cindi Roberto Obau
Din nou scribd.com nu-mi permite afisarea documentelor incarcate pe acest site. Arabela Bond Etta
In this article we will cover benefits of its own. Lotti Nye Dry
My brother recommended I may like this website. He was totally right. Marjie Elsworth Afton
I really like your writing style, excellent info, regards for posting :D. Catherin Zachary Mable
Disadvantages: Heavier than road as well as fitness bikes. Becki Humbert Cruickshank
If you learn how to take a hit, you will be able to absorb the impact and protect yourself from any injuries. Hillary Derron Mungo
Thanks Tamalita, hope you enjoy the inspo this year! xo Ameline Ebenezer Barthol
Wow! This can be one particular of the most beneficial blogs We have ever arrive across on this subject. Actually Magnificent. I am also a specialist in this topic so I can understand your hard work. Corny Ellswerth Gebhardt
Keep up the excellent work , I read few articles on this website and I believe that your site is rattling interesting and has got sets of fantastic info . Gerianna Felipe Casey
I enjoy looking through an article that will make men and women think. Also, thanks for allowing for me to comment! Isadora Wells Stoecker
Sit amet velit metus. Proin posuere, ligula nec porttitor eget luctus, risus lectus tristique ligula, quis vivam pretium elit diam a nisi. Proin vehicula malesuada dolor, vel rutrum. quam sollicitudin. Jojo Claiborne Allsopp
Semoga kedepannya tidak ada lagi kasus seperti ini Mara Aleksandr Sylas
Well I really enjoyed studying it. This information offered by you is very useful for good planning. Beverie Hakim Randell
Excellent blog here! Additionally your web site a lot up fast! What host are you using? Can I get your associate link in your host? I desire my website loaded up as fast as yours lol Rubia Worthington Mellie
Very nice article. I definitely appreciate this website. Stick with it! Eddie Wilbert Ignazio
Wow, a splendidly created blog, dealing with all elements of the subject as well as the writing style is impressive. Your blog site not merely happy me however also surprised me that there are actually still great writers at blogging sites who adhere to real parts of creating. Typically folks center either on creating style or content information but you have actually fully dealt with both parts in details. II found your blog as an outstanding one in my entire time of reading. I additionally create blog sites to provide my adventure and also expertise with accurate visitors. Below is my blog post concerning the most effective cars and truck servicing as well as Maserati repair work Dubai. Read my blog site as well as let me understand about your customer review. Carin Thorvald Willey
Thank you for sharing your thoughts. I really appreciate your efforts and I am waiting for your further write ups thank you once again. Gerty Everett Noleta
Thanks for a marvelous posting! I certainly enjoyed reading it, you are a great author. I will always bookmark your blog and may come back sometime soon. I want to encourage you to continue your great posts, have a nice evening! Bev Erv Kooima
Have you ever thought about creating an ebook or guest authoring on other blogs? I have a blog based upon on the same topics you discuss and would love to have you share some stories/information. I know my readers would appreciate your work. If you are even remotely interested, feel free to send me an email. Pansy Cecilius Venu
Hey, I think your site might be having browser compatibility issues. When I look at your website in Chrome, it looks fine but when opening in Internet Explorer, it has some overlapping. I just wanted to give you a quick heads up! Other then that, very good blog!| Tammi Connie Andi
Amen to turning the media off for bit. And that Mr. Bean GIF put me in just the right mood to get going! Brandea Maximilien Marte
An additional issue is that video games are usually serious as the name indicated with the major focus on understanding rather than leisure. Although, it comes with an entertainment facet to keep children engaged, each one game is usually designed to focus on a specific group of skills or program, such as numbers or science. Thanks for your posting. Demeter Luciano Maybelle
Having read this I believed it was very informative. I appreciate you finding the time and energy to put this short article together. I once again find myself spending way too much time both reading and posting comments. But so what, it was still worthwhile! Emlynne Frans Noby
I really like the story. It was short bust spooky all the same! Ebony Garold Allys
magnificent points altogether, you simply gained a new reader. What may you suggest about your post that you just made a few days ago? Any positive?| Libbey ErvIn Camm
But it is important is usually to pick something which is comfortable to wear. Diena Haley Verlie
Excellent post! Loved the insight I got from this. Also dialling in time management and the 5am club.. the work that can be done is incredible. Betteann Trefor Goat
It was a excitement getting to your sitea short while ago. I came here at the current timehoping to discover interesting things. And I was not let down. Your ideas on new tactics on this subject material were helpful and an first-class help to my family members. Thank you for creating time to write out these things because wellbecause for sharing your thinking. Theodosia Lance Gaskill
Are countries allowed to record more than once and choose the best recording? Donni Langsdon Roderigo
I am final, I am sorry, but it absolutely another, instead of that is necessary for me.
ankara nakliyat, evden eve nakliyat, sehirler arasi nakliyat, sehir ici nakliyat
ankara asansörlü nakliye
SMM, kendinizi veya şirketinizi tanıtmak için Instagram, Facebook, Twitter, Youtube ve daha pek çok sosyal medya platformunun kullanılmasıdır. Çevrimiçi varlığınızı artırmanın bir yolunu arıyorsanız, en iyi ve en ucuz fiyatlarla panelimizi kullanabilirsiniz.
The men scrutinised her then started to pull at her clothing. Their foreign words were lost on her but she recognised lust in their eyes. She was pinned to the ground then one of the men kneeled between her legs whilst the other two held her arms apart. The man starter to remove the armor around his groin. She struggled and yelled again breaking one hand free until the other man drew a dagger and placed it at her neck. She froze with the words of father running through her mind �survive at all costs, there nothing you can do dead�.
Ok her tits, they were big and round, I don�t know what size they were, but I could cup them in my hands, squeeze them together and tit fuck her all night long. Then there was her nipples, oh sweet nipples, they fit prefect around my lips and in my mouth.
PDF kitap indir, ücretsiz PDF kitapları indirme sitesi. İnternette arayıp bulamadığınız tüm PDF kitaplar burada. Ücretsiz Pdf Kitap indir ve Oku. Yandex Disk E Kitap Arşivi İndirme Sitesi! Ücretsiz PDF formatında e-kitap indirebileceğiniz paylaşım sitesi. inlerce PDF Kitap indir içeriğini, EPUB Kitap ve PDF Kitap formatlarıyla sitemizde bulabilirsiniz! Dilediğiniz kitabı ücretsiz bir şekilde okuyabilirsiniz.
PDF kitap indir, ücretsiz PDF kitapları indirme sitesi. İnternette arayıp bulamadığınız tüm PDF kitaplar burada. Ücretsiz Pdf Kitap indir ve Oku. Yandex Disk E Kitap Arşivi İndirme Sitesi! Ücretsiz PDF formatında e-kitap indirebileceğiniz paylaşım sitesi. inlerce PDF Kitap indir içeriğini, EPUB Kitap ve PDF Kitap formatlarıyla sitemizde bulabilirsiniz! Dilediğiniz kitabı ücretsiz bir şekilde okuyabilirsiniz.
Yes, this is a good post without any doubts. You really doing a great Job. I inspired from you. So keep it up!
Nice post.
Consider producing through your personal experience.
Aenean lectus elit, fermentum non, convallis id, sagittis at, neque. Nullam mauris orci, aliquet et, iaculis et, viverra vitae, ligula. Nulla ut felis in purus aliquam imperdiet. Maecenas aliquet mollis lectus
Attractive component of content. I simply stumbled upon your website and in accession capital to say that I get in fact loved account your blog posts.Ken Park
I am actually happy to read this weblog posts which consists of tons of helpful facts, thanks for providing these kinds of information.
I have been searching all over a post about that for quite a long time. Thanks for publishing this great content without doubts is very useful. I absolutely love your blog. Excellent colors
Wow, that’s what I was looking for, what a information! present here at this
blog, thanks admin of this site.
Wow, that’s what I was looking for, what a information! present here at this
blog, thanks admin of this site.
wonderful post, very informative. I’m wondering why the opposite specialists of this sector don’t realize this.
You should continue your writing. I am confident, you’ve a great readers’ base
already!
I can see you understand my problem. Some person would find my best friend attractive, don�t you think so? Stroking her arm again softly.
Thanks for this article. I might also like to express that it can end up being hard when you find yourself in school and simply starting out to create a long credit rating. There are many scholars who are just trying to endure and have long or favourable credit history can occasionally be a difficult point to have.
hey there and thanks on your info ? I have definitely picked up something new from right here. I did then again expertise some technical issues the use of this website, as I skilled to reload the site lots of instances previous to I may get it to load properly. I have been considering in case your web hosting is OK? Now not that I’m complaining, however sluggish loading circumstances times will sometimes affect your placement in google and can damage your high quality rating if ads and ***********|advertising|advertising|advertising and *********** with Adwords. Well I?m including this RSS to my email and can look out for a lot extra of your respective exciting content. Ensure that you replace this again soon..
I?d have to test with you here. Which isn’t one thing I usually do! I take pleasure in reading a publish that may make people think. Also, thanks for allowing me to remark!
I would also like to add that if you do not surely have an insurance policy or you do not participate in any group insurance, you could possibly well make use of seeking the aid of a health broker. Self-employed or those that have medical conditions generally seek the help of an health insurance brokerage service. Thanks for your short article.
PDF kitap indir, ücretsiz PDF kitapları indirme sitesi. İnternette arayıp bulamadığınız tüm PDF kitaplar burada. Ücretsiz Pdf Kitap indir ve Oku. Yandex Disk E Kitap Arşivi İndirme Sitesi! Ücretsiz PDF formatında e-kitap indirebileceğiniz paylaşım sitesi. inlerce PDF Kitap indir içeriğini, EPUB Kitap ve PDF Kitap formatlarıyla sitemizde bulabilirsiniz! Dilediğiniz kitabı ücretsiz bir şekilde okuyabilirsiniz.
Malta Barber for impeccable men’s haircuts and grooming experiences. Our expert barbers skillfully blend modern and traditional techniques to craft unique looks that suit every individual’s style. Using carefully selected products and specialized grooming tools, we ensure a flawless shaving experience.