当前位置: 首页>>代码示例>>Golang>>正文


Golang beego.NSNamespace函数代码示例

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


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


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