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


Golang beego.TestBeegoInit函数代码示例

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


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

示例1: init

func init() {
	_, file, _, _ := runtime.Caller(1)
	apppath, _ := filepath.Abs(filepath.Dir(filepath.Join(file,
		".."+string(filepath.Separator))))
	beego.TestBeegoInit(apppath)
	beego.SetLevel(logs.LevelInfo)
}
开发者ID:Lkyzlwj,项目名称:Graduate,代码行数:7,代码来源:rawtrainrecord_test.go

示例2: init

func init() {
	_, file, _, _ := runtime.Caller(1)
	apppath, _ := filepath.Abs(filepath.Dir(filepath.Join(file, ".."+string(filepath.Separator))))
	beego.TestBeegoInit(apppath)
	initORM()
	// switch to prod
	beego.BConfig.RunMode = "prod"
}
开发者ID:Piasy,项目名称:BeegoTDDBootStrap,代码行数:8,代码来源:common_ops.go

示例3: init

func init() {
	//orm.RegisterDriver("sqlite3", orm.DRSqlite)
	orm.RegisterDataBase("default", "sqlite3", "../db/persistence.db")
	//orm.RegisterModel(new(models.ClusterInfo), new(models.Storage)) //move in model init()

	dbdrop()
	dbcreate()
	clearDB()
	dataInsert()

	_, file, _, _ := runtime.Caller(1)
	apppath, _ := filepath.Abs(filepath.Dir(filepath.Join(file, ".."+string(filepath.Separator))))
	beego.TestBeegoInit(apppath)

}
开发者ID:fugr,项目名称:APIServer,代码行数:15,代码来源:default_test.go

示例4: init

func init() {
	dao.InitDatabase()
	_, file, _, _ := runtime.Caller(1)
	apppath, _ := filepath.Abs(filepath.Dir(filepath.Join(file, ".."+string(filepath.Separator))))
	beego.BConfig.WebConfig.Session.SessionOn = true
	beego.TestBeegoInit(apppath)

	beego.Router("/api/search/", &SearchAPI{})
	beego.Router("/api/projects/", &ProjectAPI{}, "get:List;post:Post;head:Head")
	beego.Router("/api/projects/:id", &ProjectAPI{}, "delete:Delete;get:Get")
	beego.Router("/api/users/?:id", &UserAPI{})
	beego.Router("/api/users/:id([0-9]+)/password", &UserAPI{}, "put:ChangePassword")
	beego.Router("/api/users/:id/sysadmin", &UserAPI{}, "put:ToggleUserAdminRole")
	beego.Router("/api/projects/:id/publicity", &ProjectAPI{}, "put:ToggleProjectPublic")
	beego.Router("/api/projects/:id([0-9]+)/logs/filter", &ProjectAPI{}, "post:FilterAccessLog")
	beego.Router("/api/projects/:pid([0-9]+)/members/?:mid", &ProjectMemberAPI{}, "get:Get;post:Post;delete:Delete;put:Put")
	beego.Router("/api/statistics", &StatisticAPI{})
	beego.Router("/api/users/?:id", &UserAPI{})
	beego.Router("/api/logs", &LogAPI{})
	beego.Router("/api/repositories", &RepositoryAPI{})
	beego.Router("/api/repositories/tags", &RepositoryAPI{}, "get:GetTags")
	beego.Router("/api/repositories/manifests", &RepositoryAPI{}, "get:GetManifests")
	beego.Router("/api/repositories/top", &RepositoryAPI{}, "get:GetTopRepos")
	beego.Router("/api/targets/", &TargetAPI{}, "get:List")
	beego.Router("/api/targets/", &TargetAPI{}, "post:Post")
	beego.Router("/api/targets/:id([0-9]+)", &TargetAPI{})
	beego.Router("/api/targets/:id([0-9]+)/policies/", &TargetAPI{}, "get:ListPolicies")
	beego.Router("/api/targets/ping", &TargetAPI{}, "post:Ping")
	beego.Router("/api/policies/replication/:id([0-9]+)", &RepPolicyAPI{})
	beego.Router("/api/policies/replication", &RepPolicyAPI{}, "get:List")
	beego.Router("/api/policies/replication", &RepPolicyAPI{}, "post:Post;delete:Delete")
	beego.Router("/api/policies/replication/:id([0-9]+)/enablement", &RepPolicyAPI{}, "put:UpdateEnablement")

	_ = updateInitPassword(1, "Harbor12345")

	//syncRegistry
	if err := SyncRegistry(); err != nil {
		log.Fatalf("failed to sync repositories from registry: %v", err)
	}

	//Init user Info
	admin = &usrInfo{adminName, adminPwd}
	unknownUsr = &usrInfo{"unknown", "unknown"}
	testUser = &usrInfo{TestUserName, TestUserPwd}

}
开发者ID:vmware,项目名称:harbor,代码行数:46,代码来源:harborapi_test.go

示例5: init

func init() {
	_, file, _, _ := runtime.Caller(1)
	apppath, _ := filepath.Abs(filepath.Dir(filepath.Join(file, ".."+filepath.Separator)))
	beego.TestBeegoInit(apppath)
}
开发者ID:kevinxu001,项目名称:goblog,代码行数:5,代码来源:default_test.go

示例6: init

func init() {
	_, file, _, _ := runtime.Caller(1)
	apppath, _ := filepath.Abs(filepath.Dir(filepath.Join(file, ".."+string(filepath.Separator))))
	beego.TestBeegoInit(apppath)
	models.RegistDB()
}
开发者ID:ckeyer,项目名称:website,代码行数:6,代码来源:default_test.go

示例7:

package test
开发者ID:shubhodeep9,项目名称:api-test,代码行数:1,代码来源:default_test.go


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