本文整理汇总了Golang中github.com/astaxie/beego.ErrorController函数的典型用法代码示例。如果您正苦于以下问题:Golang ErrorController函数的具体用法?Golang ErrorController怎么用?Golang ErrorController使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ErrorController函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: init
func init() {
beego.ErrorController(&controllers.ErrorController{})
beego.Handler("/mocku/detect/websocket", detect.WebSocketHandler())
// beego.Router("/", &controllers.MainController{})
beego.Router("/mocku", &controllers.MainController{})
beego.Router("/mocku/projects/:id", &controllers.MainController{}, "get:ShowProject")
beego.Router("/mocku/rules/create", &controllers.MainController{}, "get:EditRule")
beego.Router("/mocku/rules/:id", &controllers.MainController{}, "get:EditRule")
beego.Router("/mocku/detect", &controllers.MainController{}, "get:Detect")
beego.Router("/mocku/api/projects", &controllers.ProjectController{}, "get:List")
beego.Router("/mocku/api/projects", &controllers.ProjectController{}, "post:Post")
beego.Router("/mocku/api/projects/:id", &controllers.ProjectController{})
beego.Router("/mocku/api/projects/:id/toggle", &controllers.ProjectController{}, "post:Toggle")
beego.Router("/mocku/api/projects/:pid/rules", &controllers.MockRuleController{}, "get:List")
beego.Router("/mocku/api/rules", &controllers.MockRuleController{}, "get:List")
beego.Router("/mocku/api/rules", &controllers.MockRuleController{}, "post:Post")
beego.Router("/mocku/api/rules/:id", &controllers.MockRuleController{})
beego.Router("/mocku/api/rules/:id/toggle", &controllers.MockRuleController{}, "post:Toggle")
beego.Router("/mocku/api/contents/:id", &controllers.MockContentController{})
beego.Router("/mocku/api/contents/:id/enable", &controllers.MockContentController{}, "post:Enable")
// beego.Router("/**", &controllers.MockHandlerController{}, "*:Handler")
}
开发者ID:cxfksword,项目名称:mocku,代码行数:27,代码来源:router.go
示例2: init
func init() {
beego.Router("/", &controllers.RootController{})
beego.Router("/login/?:dest", &controllers.LoginController{})
beego.Router("/logout/?:dest", &controllers.LogoutController{})
beego.Router("/signup/?:dest", &controllers.SignupController{})
beego.Router("/live-editor/", &controllers.LiveEditorController{})
beego.Router("/graphics-animation/", &controllers.GraphicsController{})
beego.Router("/external/:file", &controllers.LiveEditorController{})
beego.SetStaticPath("/build", "bootstrap/live-editor/build")
var FilterUser = func(ctx *context.Context) {
_, ok := ctx.Input.Session("uid").(int)
if !ok {
ctx.Redirect(302, "/login")
}
}
beego.InsertFilter("/user/:id([0-9]+)", beego.BeforeRouter, FilterUser)
beego.ErrorController(&controllers.ErrorController{})
beego.SetLogger("file", `{"filename":"log/spielplatz.log"}`)
loadLanguages()
}
开发者ID:lafisrap,项目名称:Computer-Spielplatz,代码行数:25,代码来源:router.go
示例3: 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
示例4: init
func init() {
beego.Router("/", &index.MainController{})
beego.Router("/page/:page", &index.MainController{})
beego.Router("/tag/:tag/:page", &index.TagController{})
beego.Router("/article/:uri", &article.ArticleController{})
beego.Router("/article", &article.ArticleController{})
beego.Router("/archive/:year/:month/:page", &article.ArchiveController{})
beego.Router("/list", &article.ArticleListPageController{})
beego.Router("/list/:page", &article.ArticleListPageController{})
beego.Router("/project", &project.ProjectListController{})
beego.Router("/project/:page", &project.ProjectListController{})
beego.Router("/about/statistics", &index.StatisticsController{})
beego.Router("/about/blog", &index.AboutBlogController{})
beego.Router("/about/resume", &index.ResumeController{})
beego.Router("/logo", &index.LogoController{})
beego.Router("/favicon", &index.SiteIconController{})
beego.ErrorController(&controllers.ErrorController{})
model := beego.AppConfig.String("runmode")
if "dev" == model {
beego.Router("/test", &admin.TestController{})
}
}
开发者ID:royburns,项目名称:blog,代码行数:25,代码来源:router.go
示例5: main
func main() {
beego.SetLogger("file", `{"filename":"logs/output.log"}`)
beego.SetLogFuncCall(true)
controllers.DIYFunc()
beego.ErrorController(&controllers.ErrorController{})
beego.Run()
}
开发者ID:Hevi-Ye,项目名称:mini-ERP,代码行数:9,代码来源:main.go
示例6: main
func main() {
// 注册静态文件
beego.SetStaticPath("/static", "static")
// 自定义404错误页
beego.ErrorController(&controllers.ErrorController{})
// 首页路由
beego.Router("/", &controllers.IndexController{}, "get:Index")
// 文章路由
beego.Router("/:slug", &controllers.IndexController{}, "get:View")
// 内链跳转
beego.Router("/go/:caption", &controllers.IndexController{}, "get:GoLink")
// 搜索
beego.Router("/search", &controllers.IndexController{}, "get:Search")
// 标签页面
beego.Router("/tag/:tag", &controllers.IndexController{}, "get:TagList")
// 后台验证码
beego.Router("/captcha", &controllers.LoginController{}, "get:Captcha")
// 后台登录
beego.Router("/admin/login", &controllers.LoginController{}, "*:Index")
// 退出登录
beego.Router("/admin/logout", &controllers.LoginController{}, "*:Logout")
// 后台首页
beego.Router("/admin", &controllers.AdminController{}, "get:Index")
// 新建文章
beego.Router("/admin/new", &controllers.AdminController{}, "get:New")
// 编辑文章
beego.Router("/admin/edit/:id", &controllers.AdminController{}, "get:Edit")
// 提交文章
beego.Router("/admin/edit", &controllers.AdminController{}, "post:Edit")
// 删除文章
beego.Router("/admin/del/:id", &controllers.AdminController{}, "get:Del")
// 内链管理
beego.Router("/admin/redirect", &controllers.AdminController{}, "*:External")
// 内链修改
beego.Router("/admin/redirect/:id", &controllers.AdminController{}, "get:External")
// 内链删除
beego.Router("/admin/redirect/del/:id", &controllers.AdminController{}, "get:DelExternal")
// 系统设置
beego.Router("/admin/setting", &controllers.AdminController{}, "*:Setting")
// 获取汉字转拼音
beego.Router("/admin/pinyin/:str", &controllers.AdminController{}, "get:PinYin")
// 上传文件
beego.Router("/admin/upload", &controllers.AdminController{}, "post:Upload")
// 注册函数
beego.AddFuncMap("Preview", common.Preview)
beego.AddFuncMap("GetId", common.GetId)
beego.AddFuncMap("Gravatar", common.Gravatar)
beego.AddFuncMap("GetTagSlug", common.GetTagSlug)
beego.AddFuncMap("LoadTimes", common.LoadTimes)
beego.Run()
}
开发者ID:carvenli,项目名称:SCBlog,代码行数:56,代码来源:SCBlog.go
示例7: Init
func Init() {
beego.Router("/", &controllers.MainController{})
beego.ErrorController(&controllers.ErrorController{})
User()
Problem()
Teacher()
Api()
Teach()
}
开发者ID:jango2015,项目名称:ojsite,代码行数:10,代码来源:init.go
示例8: init
func init() {
beego.Include(&controllers.MainController{}, &controllers.RegisterController{})
beego.ErrorController(&controllers.ErrorController{})
// ns := beego.NewNamespace("/",
// // beego.NSRouter("/", &controllers.MainController{}),
// beego.NSInclude(&controllers.MainController{}),
// beego.NSInclude(&controllers.RegisterController{}),
// )
// beego.AddNamespace(ns)
}
开发者ID:shaalx,项目名称:bbs,代码行数:10,代码来源:router.go
示例9: main
func main() {
orm.Debug = true
beego.SessionOn = true
beego.ErrorController(&controllers.ErrorController{})
beego.SetStaticPath("/upload", "upload")
// beego.SetLogger("file", `{"filename":"./logs/logs.log"}`)
// beego.BeeLogger.DelLogger("console")
//注册模板函数
beego.AddFuncMap("getarticletrash", GetArticleTrashCount)
beego.Run()
}
开发者ID:ruoL,项目名称:code,代码行数:11,代码来源:main.go
示例10: main
func main() {
beego.SessionOn = true
beego.ErrorController(&controllers.ErrorController{})
beego.AddFuncMap("i18n", i18n.Tr)
beego.EnableAdmin = true // Port 8088
beego.SetLogger("file", `{"filename":"logs/juna.log"}`)
beego.SetLevel(beego.LevelInformational)
beego.SetLogFuncCall(true)
beego.AddFuncMap("news", news)
beego.Run()
}
开发者ID:shenyp09,项目名称:juna,代码行数:14,代码来源:main.go
示例11: init
func init() {
//Filter
beego.InsertFilter("/", beego.BeforeRouter, FilterHome)
beego.InsertFilter("/*", beego.BeforeRouter, FilterHome)
beego.InsertFilter("/incident-manager/admin/*", beego.BeforeRouter, FilterAdmin)
beego.InsertFilter("/incident-manager/admin/", beego.BeforeRouter, FilterAdmin)
beego.InsertFilter("/incident-manager/user/*", beego.BeforeRouter, FilterUser)
beego.InsertFilter("/incident-manager/user/", beego.BeforeRouter, FilterUser)
beego.InsertFilter("/incident-manager/", beego.BeforeRouter, FilterUser)
beego.InsertFilter("/incident-manager/user/*", beego.BeforeRouter, FilterLogin)
beego.InsertFilter("/incident-manager/admin/*", beego.BeforeRouter, FilterLogin)
//User Router
beego.Router("/incident-manager/", &user.IndexController{}, "post,get:Get")
beego.Router("/incident-manager/login", &auth.LoginController{}, "post,get:Login")
beego.Router("/incident-manager/register", &auth.RegisterController{}, "post,get:Register")
beego.Router("/mail/confirmation/:mail([-0-9a-z]+)", &auth.RegisterController{}, "post,get:Password")
beego.Router("/incident-manager/logout", &auth.LogoutController{}, "post,get:Logout")
beego.Router("/incident-manager/user/declaration", &user.IndexController{}, "get,post:Add")
beego.Router("/incident-manager/user/myincident", &user.IndexController{}, "get,post:ByMail")
beego.Router("/incident-manager/user/incident/:id([0-9]+)", &user.IndexController{}, "get:GetOne")
beego.Router("/incident-manager/user/incident/update/:id([0-9]+)", &user.IndexController{}, "post,get:Edit")
// admin Router
beego.Router("/incident-manager/admin", &admin.AdminController{}, "post,get:GetIncident")
beego.Router("/incident-manager/admin/user", &admin.AdminController{}, "post,get:GetUser")
beego.Router("/incident-manager/admin/user/add", &admin.AdminController{}, "post,get:AddUser")
beego.Router("/incident-manager/admin/user/update/:id([0-9]+)", &admin.AdminController{}, "post,get:EditUser")
beego.Router("/incident-manager/admin/user/delete/:id([0-9]+)", &admin.AdminController{}, "post,get:DeleteUser")
beego.Router("/incident-manager/admin/declaration", &admin.AdminController{}, "post,get:AddIncident")
beego.Router("/incident-manager/admin/myincident", &admin.AdminController{}, "post,get:ByMailIncident")
beego.Router("/incident-manager/admin/incident/:id([0-9]+)", &admin.AdminController{}, "get:GetOneIncident")
beego.Router("/incident-manager/admin/incident/update/:id([0-9]+)", &admin.AdminController{}, "post,get:EditIncident")
beego.Router("/incident-manager/admin/incident/delete/:id([0-9]+)", &admin.AdminController{}, "post,get:DeleteIncident")
beego.Router("/incident-manager/admin/register", &admin.AdminController{}, "post,get:RegisterDemand")
beego.Router("/incident-manager/admin/register/delete/:id([0-9]+)", &admin.AdminController{}, "post,get:DeleteDemand")
// beego.Router("/admin/incident/:id([0-9]+)", &admin.AdminController{}, "get:GetOne")
//Static Router
beego.SetStaticPath("/static", "static")
//Erreurs
beego.ErrorController(&controllers.ErrorController{})
}
开发者ID:kameleon83,项目名称:managIncident,代码行数:48,代码来源:router.go
示例12: main
func main() {
models.O = orm.NewOrm()
models.O.Using("default") // 默认使用 default,你可以指定为其他数据库
var err error
models.PageCache, err = cache.NewCache("memory", `{"interval":60}`)
if err != nil {
println(err.Error())
return
}
models.CDNInit()
beego.ErrorController(&controllers.Error{})
beego.Run()
}
开发者ID:manageryzy,项目名称:go-wikiiii,代码行数:16,代码来源:main.go
示例13: main
func main() {
beego.ErrorController(&controllers.FaultDataController{})
if beego.RunMode == "dev" {
beego.DirectoryIndex = true
beego.StaticDir["/swagger"] = "swagger"
}
beego.InsertFilter("*", beego.BeforeRouter, cors.Allow(&cors.Options{
AllowOrigins: []string{"*"},
AllowMethods: []string{"PUT", "PATCH", "POST", "DELETE"},
AllowHeaders: []string{"accept, content-type"},
ExposeHeaders: []string{"Content-Length"},
AllowCredentials: true,
}))
beego.Run()
}
开发者ID:guaiguaihw,项目名称:fault,代码行数:17,代码来源:main.go
示例14: main
func main() {
beego.AddFuncMap("VaildError", vaildError)
beego.SetStaticPath("amaze", "static/amaze")
beego.SetStaticPath("hp", "static/hp")
beego.SetStaticPath("term", "static/term")
beego.SetStaticPath("static", "static")
beego.ErrorController(&controllers.ErrorController{})
router()
loggerConfig := `{
"filename":"log/beego.log",
"maxlines" : 1000,
"maxsize" : 10240,
"rotate": true,
"daily":true,
"maxdays":10
}`
beego.SetLogger("file", loggerConfig)
beego.Run()
}
开发者ID:11101171,项目名称:violence,代码行数:19,代码来源:main.go
示例15: init
func init() {
beego.SetStaticPath("/static", "static")
beego.ErrorController(&controllers.ErrorController{})
beego.Router("/", &controllers.UserController{}, "get:Index")
beego.Router("/:slug", &controllers.UserController{}, "get:View")
beego.Router("/tag/:tag", &controllers.UserController{}, "get:TagList")
beego.Router("/admin", &controllers.AdminController{})
beego.Router("/admin/login", &controllers.AdminController{}, "get:Login")
beego.Router("/admin/logout", &controllers.AdminController{}, "get:Logout")
beego.Router("/admin/new", &controllers.ArticlesController{}, "get:New")
beego.Router("/admin/edit/:id", &controllers.ArticlesController{}, "get:Edit")
beego.Router("/admin/del/:id", &controllers.ArticlesController{}, "get:Del")
beego.Router("/admin/update", &controllers.ArticlesController{}, "post:Update")
beego.Router("/admin/setting", &controllers.SettingController{}, "get:Get")
}
开发者ID:vv1133,项目名称:vvblog,代码行数:20,代码来源:router.go
示例16: main
func main() {
// 初始化
models.Init()
// 启动dht
go common.Dht()
// 启动入库
go common.Put()
// 主页路由
beego.Router("/", &controllers.IndexController{}, "get:Index")
// 搜索页路由
beego.Router("/search/:k", &controllers.IndexController{}, "get:Search")
// 搜索页排序路由
beego.Router("/search/:k/:sort", &controllers.IndexController{}, "get:Search")
// 种子转磁力链
beego.Router("/magnet", &controllers.IndexController{}, "*:Magnet")
// 最新入库
beego.Router("/new", &controllers.IndexController{}, "get:Newly")
// 磁力链转种子
beego.Router("/torrent", &controllers.IndexController{}, "*:Torrent")
// 显示页路由
beego.Router("/:infohash", &controllers.IndexController{}, "get:View")
// 设置静态目录
beego.SetStaticPath("/static", "static")
// 增加自定义函数
beego.AddFuncMap("HightLight", common.HightLight)
beego.AddFuncMap("SizeFormat", common.Size)
beego.AddFuncMap("DateFormat", common.DateFormat)
beego.AddFuncMap("FileFormat", common.FileType)
beego.AddFuncMap("Thunder", common.Thunder)
beego.AddFuncMap("FileList", common.TreeShow)
beego.AddFuncMap("i18n", i18n.Tr)
// 自定义错误页
beego.ErrorController(&controllers.ErrorController{})
// 启动Web
beego.Run()
}
开发者ID:wangroot,项目名称:SCDht,代码行数:41,代码来源:SCDht.go
示例17: main
func main() {
//setUserId()
graceful, _ := beego.AppConfig.Bool("graceful")
if !graceful {
sigs := make(chan os.Signal, 1)
signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM,
syscall.SIGQUIT)
go handleSignals(sigs)
}
beego.SetLogger("file", `{"filename":"logs/test.log"}`)
mode := beego.AppConfig.String("runmode")
if mode == "prod" {
beego.SetLevel(beego.LevelInformational)
}
beego.ErrorController(&controllers.ErrorController{})
beego.Run()
}
开发者ID:hhy5861,项目名称:beego-demo,代码行数:21,代码来源:main.go
示例18: init
func init() {
beego.InsertFilter("/", beego.BeforeRouter, FilterLogin)
beego.InsertFilter("/*", beego.BeforeRouter, FilterLogin)
beego.Router("/login", &controllers.AuthController{}, "post,get:Login")
beego.Router("/register", &controllers.AuthController{}, "post,get:Register")
beego.Router("/", &controllers.ListController{})
beego.Router("/list/:dir*", &controllers.ListController{})
beego.Router("/vues/:files*.*", &controllers.VuesController{})
beego.Router("/pas-vues/:files*.*", &controllers.PasVuesController{})
beego.Router("/edit/:name*.*", &controllers.ChdirController{}, "get:Chdir;post:ChangeDir")
beego.Router("/srt/:video*.*", &controllers.CmdController{}, "*:Srt")
beego.Router("/delete/:f*.*", &controllers.DeleteController{}, "*:Delete")
beego.Router("/rename/:old*.*", &controllers.RenameController{}, "*:Rename")
beego.Router("/mkdir/:folder*.*", &controllers.CmdController{}, "*:Mkdir")
beego.Router("/chown", &controllers.CmdController{}, "*:Chown")
beego.Router("/cmdperso/:lien*.*", &controllers.CmdController{}, "*:CmdPerso")
beego.Router("/dtstoac3/:video*.*", &controllers.CmdController{}, "*:DtsToAc3")
beego.Router("/oneaudio/:video*.*", &controllers.CmdController{}, "*:KeepOneAudio")
//Erreurs
beego.ErrorController(&controllers.ErrorController{})
}
开发者ID:kameleon83,项目名称:raspDlna,代码行数:24,代码来源:router.go
示例19: init
func init() {
beego.ErrorController(&controllers.ErrorController{})
beego.AddFuncMap("add", Add)
}
开发者ID:migege,项目名称:milog,代码行数:4,代码来源:main.go
示例20: init
func init() {
// beego.Router("/", &controllers.MainController{})
beego.Include(&controllers.JudgeController{}, &controllers.LoginController{}, &controllers.RegistController{}, &controllers.PuzzleController{}, &controllers.UserController{}, &controllers.ListController{})
beego.ErrorController(&controllers.ErrorController{})
beego.SetStaticPath("public", "static")
}
开发者ID:shaalx,项目名称:gooj,代码行数:6,代码来源:router.go
注:本文中的github.com/astaxie/beego.ErrorController函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论