Questions tagged [beego]

Beego is an open-source, high-performance, modular, full-stack web framework for the Go programming language.

Beego is a Web framework for rapid development of Go applications. It can be used to develop APIs, web apps and backend services quickly. It is a RESTful framework. It is inspired by Tornado, Sinatra and Flask and has integrated some of Go-specific features such as interfaces and struct embedding.

Features

  • RESTful support
  • MVC architecture
  • Modularity
  • Auto API documents
  • Annotation router
  • Namespace
  • Powerful development tools
  • Full stack for Web & API

Useful links

Official documentation

Github repo

Beego community

Beego Books

285 questions
4
votes
2 answers

JSON Response in Beego Controller

I'm a newbie to beego trying to get a JSON response on a route. I have a controller defined as such. package controllers import ( "github.com/astaxie/beego" ) type ErrorController struct { beego.Controller } type ErrorJson struct { s…
GokulSrinivas
  • 383
  • 2
  • 10
4
votes
2 answers

How to add a method for different structs which have one common field in golang

I'm using beego/orm for my app. Here I have 2 models type ModelA struct { Guid string `orm:"pk"` FiledA string } type ModelB struct { Guid string `orm:"pk"` FiledB string } I need to add a Save() method for each struct. In general,…
a.l.
  • 1,085
  • 12
  • 29
4
votes
4 answers

Bee command not found

I just started learning golang and beego. Yesterday I installed golang and bee. I had alot off trouble getting bee command in command line to work. At a point it started to work. Today I wanted to continue development. But again it cant find bee…
Anders Andersen
  • 2,377
  • 2
  • 17
  • 25
4
votes
1 answer

Output to csv file dumps the data to browser but not dump to file

I tried to ouput some data to csv file in golang beego framework, here is my code records := make([][]string,len(devicesData)) for k,v := range devicesData{ records[k] = []string{v.Fields.Country,v.Fields.Imei[0],v.Fields.Number[0]} } writer…
want_to_be_calm
  • 1,477
  • 3
  • 23
  • 41
4
votes
3 answers

How to do database migration with Beego framework?

I need to add a new field to existing table, what is the correct process to do this with Beego? I am familiar with Django's south: first you generate the migration script with manage.py schema_migration, then execute the migration script manage.py…
NeoWang
  • 17,361
  • 24
  • 78
  • 126
4
votes
2 answers

POST request treated as OPTIONS on beego framework

I'm using beego framework as my API framework and AngularJS on the client. I have set all CORS setting correctly. I can do GET request. But, when i try to POST, beego treat is as OPTIONS request. It also throw a warning: multiple…
under5hell
  • 997
  • 3
  • 16
  • 40
4
votes
2 answers

How to set Access-Control-Allow-Origin in Beego framework

I'm developing a RESTFul API using Beego framework on the server and AngularJS on the client side. Both server and client are in my laptop (still in dev). Client run on 127.0.0.1:8000 and server on 127.0.0.1:8080. When I try to hit an endpoint…
under5hell
  • 997
  • 3
  • 16
  • 40
3
votes
0 answers

How to mix namespace and restful routing in BeeGo

I'm building a simple project that has an API and serves a dashboard alongside it. My goal is to have a namespace router (for swagger docs) and a restful router (for the web pages) in the same project, is this possible? I'm able to get the normal…
nycynik
  • 7,371
  • 8
  • 62
  • 87
3
votes
1 answer

How to compare map[string]interface{} 's value string or not

How to compare map[string]interface{} 's value string or not m3 := map[string]interface{}{ "something":1, "brawba":"Bawrbawr", } for key, value := range m3{ if(reflect.TypeOf(value) == string or not){ ... // here }else{ …
Elliot
  • 598
  • 6
  • 25
3
votes
0 answers

Is there any way to middleware router with group router?

I am beginner in beego framework, I have completed few R&D inside on it. But I need few helps related routers. I have created few route with middleware and group router but I need few suggestions from expert. Let me share example which I…
kiran malvi
  • 1,058
  • 10
  • 21
3
votes
1 answer

How can I deploy beego app to Heroku

I'm creating a web app in beego that I need to have running in Heroku. I can get it running normally if I just specify the binary for the app in the Procfile. But I want to have swagger available in the app, so I need to use bee to start the app…
mjgalindo
  • 856
  • 11
  • 26
3
votes
0 answers

How to get response data from golang backend through @angular/http?

The fronted typescript code is: signIn(signInCredential: SignInCredential): Promise { //Build the form package let queryParam:string = 'principal=' + encodeURIComponent(signInCredential.principal) + '&password=' +…
卢焱鑫
  • 39
  • 3
3
votes
1 answer

Cannot update the timestamp with timezone in postgres using golang

I am using golang and postgreSQL version 9.5.5 in my application. I am using "github.com/lib/pq" as my database driver to connect to the database. One of my fields have the type timestamp with timezone. I would like to update to the current time. So…
rajesh kumar
  • 57
  • 1
  • 9
3
votes
1 answer

Skip field in Beego when sending JSON

When sending JSON with ServeJSON in Beego, is there a way to skip fields? I know one can skip field for ORM: http://beego.me/docs/mvc/model/models.md#ignore-field but that is just for skipping fields in the database model, it is not related to…
NaN
  • 598
  • 3
  • 15
3
votes
2 answers

Beego - Endpoint Testing

I am testing http custom endpoint for beego package test import ( "github.com/astaxie/beego" . "github.com/smartystreets/goconvey/convey" _ "golife-api-cons/routers" "net/http" "net/http/httptest" "path/filepath" …
poorva
  • 1,726
  • 1
  • 17
  • 15
1
2
3
18 19