• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Golang beego.NSNamespace函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Golang中github.com/astaxie/beego.NSNamespace函数的典型用法代码示例。如果您正苦于以下问题:Golang NSNamespace函数的具体用法?Golang NSNamespace怎么用?Golang NSNamespace使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了NSNamespace函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。

示例1: init

func init() {
	ns := beego.NewNamespace("/v1",

		beego.NSNamespace("/comments",
			beego.NSInclude(
				&controllers.CommentsController{},
			),
		),

		beego.NSNamespace("/posts",
			beego.NSInclude(
				&controllers.PostsController{},
			),
		),

		beego.NSNamespace("/users",
			beego.NSInclude(
				&controllers.UsersController{},
			),
		),
		beego.NSNamespace("/jwt",
			beego.NSInclude(
				&controllers.JwtController{},
			),
		),
	)
	beego.AddNamespace(ns)
}
开发者ID:thuongdinh,项目名称:beeblog,代码行数:28,代码来源:router.go


示例2: init

func init() {
	ns := beego.NewNamespace("/v1",
		beego.NSNamespace("/moment",
			beego.NSInclude(
				&controllers.MomentController{},
			),
		),
		beego.NSNamespace("/comment",
			beego.NSInclude(
				&controllers.CommentController{},
			),
		),
		beego.NSNamespace("/like",
			beego.NSInclude(
				&controllers.LikeController{},
			),
		),
		beego.NSNamespace("/block",
			beego.NSInclude(
				&controllers.BlockController{},
			),
		),
		beego.NSNamespace("/unshare",
			beego.NSInclude(
				&controllers.UnshareController{},
			),
		),
	)
	beego.AddNamespace(ns)
}
开发者ID:soyking,项目名称:MomentAPI,代码行数:30,代码来源:router.go


示例3: Get

// Get returns the Namespace for data
func Get() func(*beego.Namespace) {
	ns := beego.NSNamespace("/data/",
		beego.NSNamespace("/table",
			beego.NSRouter("", &data.Table{}, "GET:ShowList"),
			beego.NSRouter("generate/:name", &data.Table{}, "*:Generate"),
			beego.NSRouter("download/:name", &data.Table{}, "*:Download"),
		),
	)
	return ns
}
开发者ID:cristian-sima,项目名称:Wisply,代码行数:11,代码来源:table.go


示例4: getRepository

func getRepository() func(*beego.Namespace) {
	ns := beego.NSNamespace("/repository",
		beego.NSNamespace("/resources/:id",
			beego.NSNamespace("/get",
				beego.NSRouter("/:min/:number", &api.Repository{}, "GET:GetResources"),
			),
		),
	)
	return ns
}
开发者ID:cristian-sima,项目名称:Wisply,代码行数:10,代码来源:repository.go


示例5: Get

// Get returns the namespace for institutions
func Get() func(*beego.Namespace) {

	ns := beego.NSNamespace("/repositories",
		beego.NSRouter("", &repositories.Home{}, "*:Display"),
		beego.NSNamespace("/add",
			beego.NSRouter("", &repository.Repository{}, "GET:ShowChooseCategory"),
		),
		beego.NSNamespace("/newRepository",
			beego.NSRouter("", &repository.Repository{}, "GET:ShowInsertForm"),
			beego.NSRouter("", &repository.Repository{}, "POST:Insert"),
		),
		beego.NSNamespace("/:repository",
			beego.NSRouter("", &repository.Repository{}, "GET:Display"),
			beego.NSNamespace("/advance-options",
				beego.NSRouter("", &repository.Repository{}, "GET:ShowAdvanceOptions"),
				beego.NSNamespace("/modify",
					beego.NSRouter("", &repository.Repository{}, "GET:ShowModifyForm"),
					beego.NSRouter("", &repository.Repository{}, "POST:Modify"),
					beego.NSNamespace("/filter",
						beego.NSRouter("", &repository.Repository{}, "GET:ShowFilterForm"),
						beego.NSRouter("", &repository.Repository{}, "POST:ModifyFilter"),
					),
				),
			),
			beego.NSNamespace("/clear",
				beego.NSRouter("", &repository.Repository{}, "POST:ClearRepository"),
			),
			beego.NSNamespace("/delete",
				beego.NSRouter("", &repository.Repository{}, "POST:Delete"),
			),
		),
	)
	return ns
}
开发者ID:cristian-sima,项目名称:Wisply,代码行数:35,代码来源:repository.go


示例6: Get

// Get returns the Namespace for the repositories
func Get() *beego.Namespace {
	ns := beego.NewNamespace("/repositories/",
		beego.NSNamespace(":repository",
			beego.NSRouter("", &repository.Repository{}, "GET:Display"),
			beego.NSNamespace("/resources",
				beego.NSRouter("/:resource", &repository.Repository{}, "GET:DisplayResource"),
			),
		),
	)
	return ns
}
开发者ID:cristian-sima,项目名称:Wisply,代码行数:12,代码来源:repository.go


示例7: getSearch

// Get returns the namespace for api
func getSearch() func(*beego.Namespace) {
	ns := beego.NSNamespace("/search",
		beego.NSNamespace("/anything/:query",
			beego.NSRouter("", &api.Search{}, "*:SearchAnything"),
		),
		beego.NSNamespace("/save/:query",
			beego.NSRouter("", &api.Search{}, "POST:JustSaveAccountQuery"),
		),
	)
	return ns
}
开发者ID:cristian-sima,项目名称:Wisply,代码行数:12,代码来源:search.go


示例8: Get

// Get returns the Namespace for data
func Get() func(*beego.Namespace) {
	ns := beego.NSNamespace("/tools",
		beego.NSNamespace("/digester",
			beego.NSRouter("", &tools.Digester{}, "GET:Display"),
			beego.NSRouter("", &tools.Digester{}, "POST:Work"),
		),
		beego.NSNamespace("/web-digester",
			beego.NSRouter("", &tools.WebDigester{}, "GET:Display"),
			beego.NSRouter("", &tools.WebDigester{}, "POST:Work"),
		),
	)
	return ns
}
开发者ID:cristian-sima,项目名称:Wisply,代码行数:14,代码来源:tools.go


示例9: Get

// Get returns the Namespace for the accounts within administration area
func Get() func(*beego.Namespace) {
	ns := beego.NSNamespace("/accounts",
		beego.NSRouter("", &accountsController.Home{}, "*:Display"),
		beego.NSNamespace("/:account",
			beego.NSNamespace("/modify",
				beego.NSRouter("", &accountController.Account{}, "GET:ShowModifyForm"),
				beego.NSRouter("", &accountController.Account{}, "POST:Modify"),
			),
			beego.NSRouter("/delete", &accountController.Account{}, "POST:Delete"),
		),
	)
	return ns
}
开发者ID:cristian-sima,项目名称:Wisply,代码行数:14,代码来源:account.go


示例10: init

func init() {
	if beego.BConfig.RunMode == "dev" {
		beego.BConfig.WebConfig.DirectoryIndex = true
		beego.BConfig.WebConfig.StaticDir["/doc"] = "swagger"
	}

	ns := beego.NewNamespace("/v1.0",
		beego.NSNamespace("/auth", beego.NSInclude(&controllers.AuthController{})),
		beego.NSNamespace("/user", beego.NSInclude(&controllers.UserController{})),
		beego.NSNamespace("/host", beego.NSInclude(&controllers.HostController{})),
	)
	beego.AddNamespace(ns)

}
开发者ID:yubo,项目名称:falcon,代码行数:14,代码来源:router.go


示例11: getHarvest

func getHarvest() func(*beego.Namespace) {
	ns := beego.NSNamespace("/harvest",
		beego.NSNamespace("/process/:process",
			beego.NSRouter("", &process.Process{}, "*:Display"),
			beego.NSNamespace("/operation/:operation",
				beego.NSRouter("", &process.Operation{}, "*:Display"),
			),
			beego.NSRouter("/history", &process.Process{}, "*:ShowHistory"),
			beego.NSRouter("/advance-options", &process.Process{}, "*:ShowAdvanceOptions"),
			beego.NSRouter("/delete", &process.Process{}, "POST:Delete"),
		),
	)
	return ns
}
开发者ID:cristian-sima,项目名称:Wisply,代码行数:14,代码来源:harvest.go


示例12: init

func init() {
	ns := beego.NewNamespace("/v1",
		beego.NSNamespace("/ai",
			beego.NSInclude(
				&controllers.AIController{},
			),
		),
		beego.NSNamespace("/webchat",
			beego.NSInclude(
				&controllers.WebChatController{},
			),
		),
	)
	beego.AddNamespace(ns)
}
开发者ID:guojienumberone,项目名称:japi,代码行数:15,代码来源:router.go


示例13: init

func init() {
	ns := beego.NewNamespace("/v1",
		beego.NSNamespace("/object",
			beego.NSInclude(
				&controllers.ObjectController{},
			),
		),
		beego.NSNamespace("/user",
			beego.NSInclude(
				&controllers.UserController{},
			),
		),
	)
	beego.AddNamespace(ns)
}
开发者ID:kyawmyintthein,项目名称:donate.me_api,代码行数:15,代码来源:router.go


示例14: init

func init() {
	ns := beego.NewNamespace("/cddapi/SpeCpMobile",
		beego.NSNamespace("/get_sites_status",
			beego.NSInclude(
				&controllers.SitesStatusController{},
			),
		),
		beego.NSNamespace("/user",
			beego.NSInclude(
				&controllers.UserController{},
			),
		),
	)
	beego.AddNamespace(ns)
}
开发者ID:whiskerman,项目名称:nexusguard,代码行数:15,代码来源:router.go


示例15: getHarvest

func getHarvest() func(*beego.Namespace) {
	ns := beego.NSNamespace("/harvest",
		beego.NSNamespace("/init",
			beego.NSRouter(":id", &admin.Harvest{}, "POST:ShowPanel"),
			beego.NSRouter("/ws", &admin.Harvest{}, "GET:InitWebsocketConnection"),
		),
		beego.NSNamespace("/recover",
			beego.NSRouter(":id", &admin.Harvest{}, "POST:RecoverProcess"),
		),
		beego.NSNamespace("/finish",
			beego.NSRouter(":id", &admin.Harvest{}, "POST:ForceFinishProcess"),
		),
	)
	return ns
}
开发者ID:cristian-sima,项目名称:Wisply,代码行数:15,代码来源:harvest.go


示例16: Load

// Load tells the framework to load the addresses for the router
func Load() {
	accountNS :=
		beego.NewNamespace("/account",
			beego.NSRouter("", &account.Home{}, "GET:Show"),
			beego.NSNamespace("/searches/",
				beego.NSRouter("", &searches.List{}, "GET:Display"),
				beego.NSRouter("clear", &searches.List{}, "POST:Clear"),
			),
			beego.NSNamespace("/settings",
				beego.NSRouter("", &settings.Settings{}, "GET:Display"),
				beego.NSRouter("/delete", &settings.Settings{}, "POST:DeleteAccount"),
			),
		)
	beego.AddNamespace(accountNS)
}
开发者ID:cristian-sima,项目名称:Wisply,代码行数:16,代码来源:account.go


示例17: getAuth

func getAuth() *beego.Namespace {
	ns := beego.NewNamespace("auth",
		beego.NSNamespace("/login",
			beego.NSRouter("", &public.Auth{}, "GET:ShowLoginPage"),
			beego.NSRouter("", &public.Auth{}, "POST:LoginAccount"),
		),
		beego.NSNamespace("/register",
			beego.NSRouter("", &public.Auth{}, "GET:ShowRegisterForm"),
			beego.NSRouter("", &public.Auth{}, "POST:CreateNewAccount"),
		),
		beego.NSNamespace("/logout",
			beego.NSRouter("", &public.Auth{}, "POST:Logout"),
		),
	)
	return ns
}
开发者ID:cristian-sima,项目名称:Wisply,代码行数:16,代码来源:auth.go


示例18: init

func init() {
	ns := beego.NewNamespace("/fault",
		beego.NSNamespace("/fault_data",
			beego.NSInclude(
				&controllers.FaultDataController{},
			),
		),
		beego.NSNamespace("/down",
			beego.NSInclude(
				&controllers.DownController{},
			),
		),
	)
	beego.AddNamespace(ns)
	beego.Router("fault", &controllers.FaultDataController{})
}
开发者ID:guaiguaihw,项目名称:fault,代码行数:16,代码来源:router.go


示例19: init

func init() {
	ns := beego.NewNamespace("/v1",
		beego.NSNamespace("/lov",
			beego.NSInclude(
				&controllers.LovController{},
			),
		),
		beego.NSNamespace("/invest",
			beego.NSInclude(
				&controllers.InvestContractController{},
			),
		),
	)
	beego.AddNamespace(ns)

}
开发者ID:joyplus,项目名称:finprocess,代码行数:16,代码来源:router.go


示例20: Get

// Get returns the Namespace for API
func Get() func(*beego.Namespace) {
	ns := beego.NSNamespace("/api",
		getRepository(),
		getSearch(),
	)
	return ns
}
开发者ID:cristian-sima,项目名称:Wisply,代码行数:8,代码来源:main.go



注:本文中的github.com/astaxie/beego.NSNamespace函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Golang beego.NSRouter函数代码示例发布时间:2022-05-24
下一篇:
Golang beego.NSInclude函数代码示例发布时间:2022-05-24
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap