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
1
vote
0 answers

Beego - Annotation routing - Are there extra steps?

I'm using Beego and I don't think the annotation routing works as documented. My router.go looks like this: package routers import ( beego "github.com/beego/beego/v2/server/web" "project/controllers" ) func init() { …
Andy
  • 2,095
  • 1
  • 29
  • 59
1
vote
3 answers

Need help on setting up Beego and Bee dev tool

Go is already installed in my system. and path variable is in .bashrc file. # Golang export PATH=$PATH:/usr/local/go/bin $ go version go version go1.16.14 linux/amd64 Now, I am willing to work with Beego and bee dev tools. For that, I installed…
Ashutosh Yadav
  • 333
  • 1
  • 12
1
vote
0 answers

Error in Beego framework controller.go , cant figure out the error

ERROR: *controllers.ListController does not implement web.ControllerInterface (wrong type for Init method) have Init(*"github.com/astaxie/beego/context".Context, string, string, interface {}) want…
1
vote
1 answer

How to avoid generating Default primary key id in Golang (beego) model?

I am trying to create a rest API. I have already a database. I want to create a struct linked to a database table. But when I run the project beego automatically creates an "id" primary key for the model registered. How to avoid this in beego? My…
1
vote
0 answers

Beego, unable to query many to many relation field

I have the following models: type User struct { ID int64 `orm:"pk;auto;column(id)" json:"id"` FirstName *string `json:"first_name"` LastName *string …
Aashish Ailawadi
  • 206
  • 1
  • 2
  • 10
1
vote
0 answers

How to implement H2C (HTTP/2 Plain Text) on Beego Framework

Is there anybody that success implement h2c(HTTP/2 Plain text) Protocol in beego as a server? I have tried to use http/2 from golang.org/x/net/http2 package using this approach https://beego.me/docs/mvc/controller/router.md#handler-register I have…
1
vote
1 answer

module github.com/astaxie/beego@latest found (v1.12.3), but does not contain package github.com/astaxie/beego/client/orm

I get this error when I try to execute bee migrate, do anyone get the same error? how to handle it? thank you 2020/11/06 03:54:37 INFO ▶ 0001 Getting bee latest version... 2020/11/06 03:54:37 WARN ▶ 0002 Update available 2.0.0 ==>…
1
vote
2 answers

Beego: Routing issues with modules

Routing doesn't work at all for me in bee if I use modules while GOPATH old approach works perfectly. I am new in golang, correct me if I did something wrong. I have been trying to create API project with bee, but I found that all new projects have…
kkost
  • 3,640
  • 5
  • 41
  • 72
1
vote
1 answer

Beego endpoint can't find templatefile... but i'm not using template

I'm having trouble to create a endpoint on a Beego application So, I just put some object information on the returned JSON: // GetOne ... // @Title GetOne // @Description get Migration by id // @Param id path string true "The key…
Guilherme
  • 1,705
  • 1
  • 25
  • 45
1
vote
1 answer

Beego POST method always looks for template file

I am writing a simple login/logout feature using Beego. My init() in router.go file is given below: func init() { beego.Router("/", &controllers.MainController{}) beego.Router("/login", &controllers.AuthController{}) …
Anoop S
  • 141
  • 1
  • 12
1
vote
0 answers

Unexpected EOF and Invalid Connection Beego ORM

This happens when I already connected website and didn't do anything while and try to reconnect again I gets this error at first attempt. unexpected EOF, invalid connection I found the error log: [mysql] 2019/09/11 09:21:56 packets.go:36:…
Elliot
  • 598
  • 6
  • 25
1
vote
0 answers

Status changes by calling openstack api from Beego, Reactjs

We're using: Backend - Beego (golang) Frontend - Reactjs Server - Openstack So: When reactjs calls listSomethingAPI, I calls openstackAPI and Openstack gives me that List. it has some fields like this: id | name | status Problem is: When Frontend…
Elliot
  • 598
  • 6
  • 25
1
vote
0 answers

How to verify by public key in Beego

Problem is how to add Webhook in the router.go Beego // WebhookHandler ... func (c *AuthController) WebhookHandler(w http.ResponseWriter, r *http.Request) { publicKeyBytes, err := ioutil.ReadFile("***") if err != nil { panic(err) } block, _…
Elliot
  • 598
  • 6
  • 25
1
vote
1 answer

How to specify custom migration table in beego

I have 2 repo which uses the same database. I have different migrations in each repo. how can I specify a custom migration table in 1 repo rather than the default migration table in Beego? Beego version 1.10.1 Go version go1.10.3
priyesh
  • 45
  • 6
1
vote
0 answers

Beego get response body in middleware after processing

I have to append parameter in JSON response after request processing is completed and before sending. I can do in after exec filter. Here I defined filter like this, beego.InsertFilter("*", beego.AfterExec, AddRequestAfterExec, false) Now in this…
Ameer Hamza
  • 586
  • 3
  • 16