本文整理汇总了Golang中github.com/astaxie/beego.Router函数的典型用法代码示例。如果您正苦于以下问题:Golang Router函数的具体用法?Golang Router怎么用?Golang Router使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Router函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: customRESTfulRouter
// 自定义RESTful路由,并创建对应路径的静态文件路径以解决静态文件加载不正确的问题
func customRESTfulRouter(URLPath string, c beego.ControllerInterface) {
beego.Router(URLPath, c, "get:Index;post:Create")
beego.Router(URLPath+"/new", c, "get:New")
beego.Router(URLPath+"/:id([0-9]+)", c, "get:Show;post:Update;Delete:Destroy")
beego.SetStaticPath(URLPath+"/static", "static")
}
开发者ID:xxoommd,项目名称:SimpleAccountSystem,代码行数:8,代码来源:router.go
示例2: main
func main() {
beego.BConfig.RunMode = "prod"
beego.Router("/json", &JsonController{})
beego.Router("/db", &DBController{})
beego.Router("/plaintext", &PlaintextController{})
beego.Run()
}
开发者ID:nathana1,项目名称:FrameworkBenchmarks,代码行数:7,代码来源:hello.go
示例3: init
func init() {
beego.Router("/", &controllers.WeChatController{})
beego.Router("/home", &controllers.WeChatController{})
// beego.Router("/test", &controllers.TestController{})
// beego.Router("/b", &controllers.BController{})
}
开发者ID:wcgh,项目名称:beewechat,代码行数:7,代码来源:router.go
示例4: init
func init() {
// main
beego.Router("/", &controllers.IndexController{})
beego.Router("/plan", &controllers.PlanController{})
// beego.Router("/report", &controllers.ReportController{})
beego.Router("/getlastexecution", &controllers.GetLastExecutionController{})
// Statistics
// beego.Router("/statistics", &controllers.StatisticsController{})
beego.Router("/statistics/sprint", &controllers.StatisticsController{})
beego.Router("/api/statistics/sprint", &controllers.StatisticsController{}, "get:Sprint")
// beego.Router("/api/statistics/stock", &controllers.StatisticsController{}, "get:Stock")
// Test
beego.Router("/test", &controllers.TestController{})
// About
beego.Router("/about", &controllers.AboutController{})
// cmd
// beego.Router("/cmd", &controllers.CmdController{})
// api
beego.Router("/api/getplan", &apis.ApiController{}, "get:GetPlan")
beego.Router("/api/getlastexecution", &apis.ApiController{}, "get:GetLastExecution")
beego.Router("/api/runcmd", &apis.ApiController{}, "get:RunCmd")
// static file
beego.SetStaticPath("/data", "data")
}
开发者ID:RoyburnsPeng,项目名称:goTestLinkReport,代码行数:32,代码来源:router.go
示例5: Problem
func Problem() {
beego.Router("/problems", &problem.ProblemListController{})
beego.Router("/problem/:title", &problem.ProblemDetailController{})
beego.Router("/problem/add", &problem.AddProblemController{})
beego.Router("/problem/submit", &problem.ProblemSubmitController{})
beego.Router("/problem/submit/status", &problem.ProblemSubmitStatusController{})
}
开发者ID:jango2015,项目名称:ojsite,代码行数:7,代码来源:problem.go
示例6: init
func init() {
beego.Router("/", &controllers.PostController{})
//beego.Router("/post/:id:int", &controllers.PostController{}, "get:ShowOne")
beego.Router("/list/:page:int", &controllers.PostController{}, "get:Get")
beego.Router("/cate/:cid:int/:page:int", &controllers.PostController{}, "get:ListByCate")
beego.Router("/month/:month/:page:int", &controllers.PostController{}, "get:ListByMonth")
}
开发者ID:xiaoyang2022,项目名称:goBlog,代码行数:7,代码来源:posts.go
示例7: init
func init() {
beego.SetStaticPath("/static", "public")
beego.Router("/", &controllers.MainController{})
beego.Router("/accounts/register", &controllers.RegistrationController{})
}
开发者ID:mjpeck,项目名称:hudunwut,代码行数:7,代码来源:router.go
示例8: init
func init() {
beego.Router("/", &controllers.MainController{})
beego.Router("/PartitionServer", &controllers.PartitionServer{}, "get:Profile")
beego.Router("/api/PartitionServer", &controllers.PartitionServer{}, "get:API_Prof")
// beego.Router("rootpath",&controllers , ...)
//将 域名的根目录映射给了 MainController方法
}
开发者ID:kaituoay,项目名称:TestApp,代码行数:7,代码来源:router.go
示例9: main
func main() {
beego.Router("/", &controllers.IndexController{}, "get:Get")
beego.Router("/login/", &controllers.LoginController{}, "get:Get;post:Post")
beego.Router("/logout/", &controllers.LogOutController{}, "get:Get")
beego.Router("/admin", &controllers.AdminController{}, "get:Get")
beego.Run(MyConfig.String("http_port"))
}
开发者ID:allen870409,项目名称:dcsolusion,代码行数:7,代码来源:main.go
示例10: main
func main() {
beego.Debug(beego.VERSION)
beego.Router("/test", &controllers.Test{})
beego.Router("/upload", &controllers.Upload{})
beego.Run()
}
开发者ID:elvizlai,项目名称:Blog-mysql,代码行数:7,代码来源:App.go
示例11: main
func main() {
//初始化
initialize()
beego.Info(beego.AppName, APP_VER)
if !controllers.IsPro {
beego.SetStaticPath("/static_source", "static_source")
beego.DirectoryIndex = true
}
// 开启 ORM 调试模式
orm.Debug = true
// 自动建表
orm.RunSyncdb("default", false, true)
beego.Router("/", &controllers.MainController{})
beego.Router("/user/reg", &controllers.UserController{}, "post:reg")
// Register template functions.
beego.AddFuncMap("i18n", i18n.Tr)
beego.Run()
}
开发者ID:javazhen,项目名称:blog,代码行数:25,代码来源:main.go
示例12: loadHelp
func loadHelp() {
beego.Router("/help", &public.Static{}, "*:ShowHelp")
beego.Router("/privacy", &public.Static{}, "*:ShowPrivacyPolicy")
beego.Router("/cookies", &public.Static{}, "*:ShowCookiesPolicy")
beego.Router("/terms-and-conditions", &public.Static{}, "*:ShowTerms")
beego.Router("/take-down-policy", &public.Static{}, "*:ShowTakeDownPolicy")
}
开发者ID:cristian-sima,项目名称:Wisply,代码行数:7,代码来源:main.go
示例13: init
func init() {
beego.Router("/", &controllers.MainController{})
beego.Router("/cmd", &controllers.CMDController{})
beego.Router("/cmd/:name", &controllers.CMDController{})
beego.RESTRouter("/object", &controllers.ObjectController{})
}
开发者ID:royburns,项目名称:goRemoteCMD,代码行数:7,代码来源:router.go
示例14: main
func main() {
beego.Router("/", &controllers.MainController{})
beego.Router("/tasks/?:taskId", &controllers.TaskController{})
// read conf/app.conf automatically
beego.Run()
}
开发者ID:zycbobby,项目名称:remote-downloader,代码行数:7,代码来源:main.go
示例15: init
func init() {
beego.Router("/", &controllers.MainController{})
beego.Router("/user/profile", &controllers.UserController{}, `get:Profile`)
beego.Router("/api/user/profile", &controllers.UserController{}, `get:API_Profile`)
}
开发者ID:yakun0622,项目名称:goblog,代码行数:7,代码来源:router.go
示例16: main
func main() {
initialize()
beego.Info(beego.AppName, APP_VER)
// Register routers.
beego.Router("/", &routers.HomeRouter{})
beego.Router("/login", &routers.LoginRouter{})
beego.Router("/register", &routers.RegisterRouter{})
beego.Router("/register/success", &routers.RegisterRouter{}, "get:Success")
beego.Router("/active/success", &routers.RegisterRouter{}, "get:ActiveSuccess")
beego.Router("/active/:code([0-9a-zA-Z]+)", &routers.RegisterRouter{}, "get:Active")
beego.Router("/active/resend", &routers.RegisterRouter{}, "post:Resend")
beego.Router("/forgot", &routers.ForgotRouter{})
beego.Router("/reset", &routers.ResetRouter{})
// Register template functions.
beego.AddFuncMap("i18n", i18n.Tr)
// "robot.txt"
beego.Router("/robot.txt", &routers.RobotRouter{})
// For all unknown pages.
beego.Run()
}
开发者ID:sirithink,项目名称:beebbs,代码行数:27,代码来源:beebbs.go
示例17: init
func init() {
beego.Router("/", &controllers.MainController{})
beego.Router("demo", &controllers.DemoController{})
beego.Router("dmpost", &controllers.DanmakuPost{})
beego.Router("dmget", &controllers.DanmakuGet{})
}
开发者ID:kice,项目名称:KiDanmaku,代码行数:7,代码来源:router.go
示例18: init
func init() {
beego.Router("/admin", &controllers.Dashboard{}, "*:Index")
beego.Router("/admin/login", &controllers.LoginController{}, "*:Login")
beego.Router("/admin/logout", &controllers.LoginController{}, "*:Logout")
beego.Router("/admin/recovery", &controllers.LoginController{}, "post:Recovery")
beego.Router("/admin/reset", &controllers.ResetController{})
}
开发者ID:e154,项目名称:www.novshin.ru,代码行数:7,代码来源:admin.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
// 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
注:本文中的github.com/astaxie/beego.Router函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论