本文整理汇总了Golang中github.com/astaxie/beego.Run函数的典型用法代码示例。如果您正苦于以下问题:Golang Run函数的具体用法?Golang Run怎么用?Golang Run使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Run函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: mainCommands
func mainCommands() {
rootCmd := &cobra.Command{
Use: "openlandings",
Run: func(cmd *cobra.Command, args []string) {
beego.Run()
},
}
cmdWeb := &cobra.Command{
Use: "web",
Short: "Start the web server",
Run: func(cmd *cobra.Command, args []string) {
beego.Run()
},
}
cmdSiteCollector := &cobra.Command{
Use: "collect",
Short: "Collect the site templates from the host",
Run: func(cmd *cobra.Command, args []string) {
// collector.Run()
},
}
rootCmd.AddCommand(cmdWeb, cmdSiteCollector)
if err := rootCmd.Execute(); err != nil {
fmt.Println(err)
os.Exit(-1)
}
}
开发者ID:gophergala2016,项目名称:openlandings,代码行数:30,代码来源:commands.go
示例2: main
func main() {
beego.SessionOn = true
beego.SetStaticPath("/img", "static/img")
beego.SetStaticPath("/css", "static/css")
beego.SetStaticPath("/js", "static/js")
beego.Run()
}
开发者ID:kebikeyi,项目名称:Go_Mvc,代码行数:7,代码来源:main.go
示例3: main
func main() {
beego.DirectoryIndex = true
beego.StaticDir["/beeapi"] = "beeapi"
beego.Errorhandler("404", loadPageNotFound)
beego.Errorhandler("show-database-error", loadDatabaseError)
beego.Run()
}
开发者ID:cristian-sima,项目名称:Wisply,代码行数:7,代码来源:main.go
示例4: main
func main() {
initialize()
beego.Info(beego.AppName, APP_VER)
beego.InsertFilter("/docs/images/:all", beego.BeforeRouter, routers.DocsStatic)
if !routers.IsPro {
beego.SetStaticPath("/static_source", "static_source")
beego.DirectoryIndex = true
}
beego.SetStaticPath("/products/images", "products/images/")
// Register routers.
beego.Router("/", &routers.HomeRouter{})
beego.Router("/community", &routers.CommunityRouter{})
beego.Router("/quickstart", &routers.QuickStartRouter{})
beego.Router("/video", &routers.VideoRouter{})
beego.Router("/products", &routers.ProductsRouter{})
beego.Router("/team", &routers.PageRouter{})
beego.Router("/about", &routers.AboutRouter{})
beego.Router("/donate", &routers.DonateRouter{})
beego.Router("/docs/", &routers.DocsRouter{})
beego.Router("/docs/:all", &routers.DocsRouter{})
beego.Router("/blog", &routers.BlogRouter{})
beego.Router("/blog/:all", &routers.BlogRouter{})
// Register template functions.
beego.AddFuncMap("i18n", i18n.Tr)
beego.Run()
}
开发者ID:ningjh,项目名称:beeweb,代码行数:34,代码来源:beeweb.go
示例5: main
func main() {
models.InitDB(true, true)
beego.SetLogFuncCall(true)
beego.AutoRender = false
beego.Run()
}
开发者ID:mpetavy,项目名称:alexandria,代码行数:7,代码来源:main.go
示例6: main
func main() {
initialize()
go catchExit()
beego.Info(beego.AppName, APP_VER)
// Register routers.
beego.Router("/", &routers.HomeRouter{})
beego.Router("/refresh", &routers.RefreshRouter{})
beego.Router("/search", &routers.SearchRouter{})
beego.Router("/index", &routers.IndexRouter{})
// beego.Router("/label", &routers.LabelsRouter{})
beego.Router("/function", &routers.FuncsRouter{})
beego.Router("/example", &routers.ExamplesRouter{})
beego.Router("/about", &routers.AboutRouter{})
beego.Router("/api/v1/badge", &routers.ApiRouter{}, "get:Badge")
// Register template functions.
beego.AddFuncMap("i18n", i18n.Tr)
beego.AddFuncMap("isHasEleS", isHasEleS)
beego.AddFuncMap("isHasEleE", isHasEleE)
beego.AddFuncMap("isNotEmptyS", isNotEmptyS)
// "robot.txt"
beego.Router("/robots.txt", &routers.RobotRouter{})
// For all unknown pages.
beego.Router("/:all", &routers.HomeRouter{})
// Static path.
beego.SetStaticPath("/public", "public")
beego.Run()
}
开发者ID:juju2013,项目名称:gowalker,代码行数:34,代码来源:gowalker.go
示例7: main
func main() {
orm.Debug = true
orm.RunSyncdb("default", false, true)
/* 设置Session配置*/
beego.SessionOn = false
beego.Run()
}
开发者ID:jaguarWang,项目名称:webpage,代码行数:7,代码来源:main.go
示例8: main
func main() {
core.Router_register()
sso.Router_register()
im.Router_register()
schedule.Router_register()
pay.Router_register()
fmt.Println(beego.AppConfig.String("mysqluser"))
fmt.Println(beego.AppConfig.String("mysqlpass"))
fmt.Println(beego.AppConfig.String("mysqlurls"))
fmt.Println(beego.AppConfig.String("mysqldb"))
var FilterUser = func(ctx *context.Context) {
if v := ctx.Input.Query("access_token"); v != "" {
//data := "ok"
fmt.Println(v)
//ctx.Output.Json(data, false, true)
} else {
data := `{"error","err"}`
ctx.Output.Json(data, false, true)
}
}
beego.InsertFilter("*", beego.BeforeRouter, FilterUser)
beego.Run()
}
开发者ID:ccpony86,项目名称:haiti,代码行数:27,代码来源:main.go
示例9: main
// main starts the application
func main() {
beego.ErrorController(&controllers.ErrorController{})
beego.Router("/", &controllers.MainController{})
beego.Router("/streams", &controllers.StreamController{})
beego.Run()
}
开发者ID:onuryilmaz,项目名称:random-peek,代码行数:8,代码来源:main.go
示例10: main
func main() {
beego.AddFuncMap("Preview", common.Preview)
beego.AddFuncMap("GetId", common.GetId)
beego.AddFuncMap("LoadTimes", common.LoadTimes)
beego.AddFuncMap("GetTagSlug", common.GetTagSlug)
beego.Run()
}
开发者ID:vv1133,项目名称:vvblog,代码行数:7,代码来源:main.go
示例11: main
func main() {
if beego.AppConfig.String("runmode") == "dev" {
orm.Debug = false
}
beego.Run()
}
开发者ID:gezhixin,项目名称:goBlog,代码行数:7,代码来源:main.go
示例12: main
func main() {
beego.SessionOn = true
beego.InsertFilter("/appadmin/*", beego.BeforeRouter, auth.Basic("youradminname", "YourAdminPassword"))
beego.InsertFilter("/hosts", beego.BeforeRouter, controllers.FilterLogin)
beego.InsertFilter("/hosts/*", beego.BeforeRouter, controllers.FilterLogin)
beego.Run()
}
开发者ID:robfrut135,项目名称:DockerWebConsole,代码行数:7,代码来源:main.go
示例13: main
func main() {
if len(os.Args) > 1 {
switch len(os.Args) {
case 2:
if os.Args[1] == "init" {
models.Install()
}
}
return
}
docSwitch, err := beego.AppConfig.Bool("EnableDocs")
if err != nil {
log.Fatalln(err)
}
if docSwitch {
beego.DirectoryIndex = true
beego.StaticDir["/swagger"] = "swagger"
}
monitorSwitch, err := beego.AppConfig.Bool("EnableMonitor")
if err != nil {
log.Fatalln(err)
}
if monitorSwitch {
beego.StaticDir["/inspinia"] = "inspinia"
}
beego.Run()
}
开发者ID:CalvinNeo,项目名称:EasyMLPlatform,代码行数:32,代码来源:main.go
示例14: main
func main() {
conf := sockjs.NewConfig()
sockjshandler := sockjs.NewHandler("/chat", chatHandler, conf)
beego.Router("/", &MainController{})
beego.RouterHandler("/chat/:info(.*)", sockjshandler)
beego.Run()
}
开发者ID:johnvilsack,项目名称:golang-stuff,代码行数:7,代码来源:chat.go
示例15: main
func main() {
initialize()
beego.Info("AppPath:", beego.AppPath)
if setting.IsProMode {
beego.Info("Product mode enabled")
} else {
beego.Info("Develment mode enabled")
}
beego.Info(beego.AppName, setting.APP_VER, setting.AppUrl)
//initialize the routers
routers.Initialize()
if !setting.IsProMode {
beego.SetStaticPath("/static_source", "static_source")
beego.DirectoryIndex = true
}
if beego.RunMode == "dev" {
//enable debug for orm
//orm.Debug = false
orm.Debug = true
}
// For all unknown pages.
beego.Run()
}
开发者ID:varding,项目名称:wetalk,代码行数:28,代码来源:wetalk.go
示例16: main
func main() {
beego.Router("/", &controllers.MainController{})
beego.Router("/push/create", &controllers.IndexController{})
beego.Router("/push/test", &controllers.TestController{})
beego.Router("/push/query", &controllers.QueryController{})
beego.Run()
}
开发者ID:jcs7575,项目名称:push,代码行数:7,代码来源:main.go
示例17: main
func main() {
orm.Debug = true
orm.RunSyncdb("default", false, true)
//models.AddUser()
//models.AddTotalAndWin("martin", true)
beego.Run()
}
开发者ID:HYQMartin,项目名称:fivestone,代码行数:7,代码来源:main.go
示例18: main
func main() {
err := orm.RunSyncdb("default", false, false)
if err != nil {
beego.Error(err)
}
beego.Run()
}
开发者ID:lynndotconfig,项目名称:go-blog,代码行数:7,代码来源:main.go
示例19: main
func main() {
initialize()
beego.Info(beego.AppName, APP_VER)
beego.AddFilter("/docs/images/:all", "BeforeRouter", routers.DocsStatic)
// Register routers.
beego.Router("/", &routers.HomeRouter{})
beego.Router("/community", &routers.CommunityRouter{})
beego.Router("/quickstart", &routers.QuickStartRouter{})
beego.Router("/team", &routers.PageRouter{})
beego.Router("/about", &routers.AboutRouter{})
beego.Router("/donate", &routers.DonateRouter{})
beego.Router("/docs/", &routers.DocsRouter{})
beego.Router("/docs/:all", &routers.DocsRouter{})
beego.Router("/blog", &routers.BlogRouter{})
beego.Router("/blog/:all", &routers.BlogRouter{})
// beego.Router("/samples", &routers.SamplesRouter{})
// beego.Router("/samples/:all", &routers.SamplesRouter{})
// Register template functions.
beego.AddFuncMap("i18n", i18n.Tr)
beego.Run()
}
开发者ID:858806258,项目名称:beeweb,代码行数:27,代码来源:beeweb.go
示例20: main
func main() {
orm.Debug = true
orm.RunSyncdb("default", true, true)
beego.Router("/", &controllers.MainController{})
beego.Run()
}
开发者ID:zykzhang,项目名称:practice,代码行数:7,代码来源:main.go
注:本文中的github.com/astaxie/beego.Run函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论