MCPcopy Index your code
hub / github.com/astaxie/beegae

github.com/astaxie/beegae @v1.6.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.6.1 ↗ · + Follow
646 symbols 2,061 edges 48 files 391 documented · 61%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

beegae

beego is a Go Framework inspired by tornado and sinatra. beego Build Status beego GoDoc

beego is used for rapid development of RESTful APIs, web apps and backend services in Go. It is inspired by Tornado, Sinatra and Flask. beego has some Go-specific features such as interfaces and struct embedding.

More info beego.me

beegae is a port of beego intended to be used on Google's AppEngine. There are a few subtle differences between how beego and beegae initializes applications which you can see for yourself here example

The aim of this project is to keep as much of beego unchanged as possible in beegae.

IMPORTANT UPDATE - Breaking Changes with beegae 1.6.1

There were changes made to the beego core that were updated in beegae for consistency between packages. Many of these changes are in relation to refactoring various objects in beego as well addressing golint recommendations to variable/function names. This may result in minor tweaks to your code (e.g. UrlFor is now URLFor on controllers).

This package now supports both classic AppEngine runtime as well as flexible (formerly Managed VM) runtime.

IMPORTANT UPDATE - Breaking Changes with beegae 1.5

With the latest update beegae now uses the google.golang.org/appengine AppEngine package. You can read the differences from the classic appengine package on the new package's repository. beegae users will need to update their apps to use this package as per the instructions on the repository. The controller.AppEngineCtx type was changed to context.Context so minimal changes to users' code should be necessary.

The session code was also updated to reflect these changes, most notably, the context.Context is now the first argument for the session interface functions. Additionally, the package was moved to be more in-line with how beego broke out its session implementations.

Like other session providers as part of beego, you need to do an blank import of the appengine session provider: import _ "github.com/astaxie/beegae/session/appengine" This will register the appengine session provider so you may use it in your application. You may do this in your main.go file. Look at the examples for guidance.

My apologies for any inconvenience this brings to your code. The new package is the recommended approach to Go on AppEngine as it works on both classic AppEngine and Managed VMs, and so beegae was updated to support this recommendation.

As always, if there any bugs with the package please open an issue and/or submit a PR.

Features

  • Datastore + Memcached backed session store! read more here to learn how to use it.
  • AppEngineCtx is part of the default Controller. View the included sessions package documentation for an example of using it!

beego Documentation

Community

Getting Started

This will be a quick overview of how to setup the repository and get started with beegae on AppEngine. It is already assumed that you have setup the AppEngine SDK for Go correctly and setup your GOPATH correctly

  • # goapp get github.com/astaxie/beegae
  • # goapp get github.com/beego/bee
  • # cd $GOPATH/src
  • # $GOPATH/bin/bee new hellogae
  • # cd hellogae
  • Make a new file app.yaml and fill it as such:
application: hellobeegae
version: 1
runtime: go
api_version: go1

handlers:
- url: /.*
  script: _go_app
  • # gofmt -r '"github.com/astaxie/beego" -> "github.com/astaxie/beegae"' -w ./
  • # gofmt -r 'beego -> beegae' -w ./
  • # mkdir main && mv main.go main/ && mv app.yaml main/ && mv conf/ main/ && mv views/ main/ && cd main/
  • If you are using the classic AppeEngine runtime, open main.go and change func main() to func init(), otherwise skip this step.
  • # goapp serve
  • Done!

LICENSE

beego source code is licensed under the Apache Licence, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.html).

Extension points exported contracts — how you extend this code

FilterHandler (Interface)
FilterHandler is an interface for [2 implementers]
router.go
Store (Interface)
Store contains all data for one session process with specific id. [2 implementers]
session/session.go
ControllerInterface (Interface)
ControllerInterface is an interface to uniform all controller handler. [1 implementers]
controller.go
FilterFunc (FuncType)
FilterFunc defines a filter function which is invoked before the controller handler is executed.
filter.go
LinkNamespace (FuncType)
LinkNamespace used as link action
namespace.go
Provider (Interface)
Provider contains global session methods and saved SessionStores. it can operate a SessionStore by its id. [2 implementers]
session/session.go

Core symbols most depended-on inside this repo

String
called by 81
config.go
Close
called by 42
memzipfile.go
ServeHTTP
called by 39
router.go
Error
called by 36
flash.go
NewControllerRegister
called by 35
router.go
Param
called by 34
context/input.go
Get
called by 30
session/session.go
Query
called by 26
context/input.go

Shape

Method 322
Function 265
Struct 49
Interface 5
FuncType 4
TypeAlias 1

Languages

Go100%

Modules by API surface

controller.go71 symbols
context/input.go59 symbols
router_test.go58 symbols
namespace.go39 symbols
router.go31 symbols
templatefunc.go30 symbols
session/session.go29 symbols
config.go26 symbols
context/output.go25 symbols
context/context.go20 symbols
session/appengine/sess_appengine.go19 symbols
session/sess_cookie.go18 symbols

For agents

$ claude mcp add beegae \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact