Display README


Path Synopsis
cache Package cache provide a Cache interface and some implement engine Usage: import( "github.com/astaxie/beego/cache" ) bm, err := cache.NewCache("memory", `{"interval":60}`) Use it like this: bm.Put("astaxie", 1, 10 * time.Second) bm.Get("astaxie") bm.IsExis
config Package config is used to parse config.
context Package context provide the context utils Usage: import "github.com/astaxie/beego/context" ctx := context.Context{Request:req,ResponseWriter:rw} more docs http://beego.me/docs/module/context.md
grace Package grace use to hot reload Description: http://grisha.org/blog/2014/06/03/graceful-restart-in-golang/ Usage: import( "log" "net/http" "os" "github.com/astaxie/beego/grace" ) func handler(w http.ResponseWriter, r *http.Request) { w.Write([]byte("WORLD
httplib Package httplib is used as http.Client Usage: import "github.com/astaxie/beego/httplib" b := httplib.Post("http://beego.me/") b.Param("username","astaxie") b.Param("password","123456") b.PostFile("uploadfile1", "httplib.pdf") b.PostFile("uploadfile2", "ht
logs Package logs provide a general log interface Usage: import "github.com/astaxie/beego/logs" log := NewLogger(10000) log.SetLogger("console", "") > the first params stand for how many channel Use it like this: log.Trace("trace") log.Info("info") log.Warn("w
migration Package migration enables you to generate migrations back and forth.
orm Package orm provide ORM for MySQL/PostgreSQL/sqlite Simple Usage package main import ( "fmt" "github.com/astaxie/beego/orm" _ "github.com/go-sql-driver/mysql" // import your used driver ) // Model Struct type User struct { Id int `orm:"auto"` Name string
session Package session provider Usage: import( "github.com/astaxie/beego/session" ) func init() { globalSessions, _ = session.NewManager("memory", `{"cookieName":"gosessionid", "enableSetCookie,omitempty": true, "gclifetime":3600, "maxLifetime": 3600, "secure":
swagger Package swagger struct definition
toolbox Package toolbox healthcheck type DatabaseCheck struct { } func (dc *DatabaseCheck) Check() error { if dc.isConnected() { return nil } else { return errors.New("can't connect database") } } AddHealthCheck("database",&DatabaseCheck{}) more docs: http://beeg
validation Package validation for validations import ( "github.com/astaxie/beego/validation" "log" ) type User struct { Name string Age int } func main() { u := User{"man", 40} valid := validation.Validation{} valid.Required(u.Name, "name") valid.MaxSize(u.Name, 15,

Package beego imports 43 packages, and is imported by 3653 packages. This documentation is generated 1 year ago. Refresh