Ejemplo n.º 1
0
// Run the tests using MongoRe
func setUpMongoreTest() account.Storable {
	cfg := mongore.Config{
		Host:         "127.0.0.1:27017",
		DatabaseName: "backstage_auth_test",
	}
	store := mongore.New(cfg)
	account.Storage(store)
	return store
}
Ejemplo n.º 2
0
// // Run the tests in memory
func setUpMemoryTest() account.Storable {
	store := mem.New()
	account.Storage(store)
	return store
}
Ejemplo n.º 3
0
// Run the tests in memory
func setUpMemoryTest(s *S) {
	account.Storage(mem.New())
}
Ejemplo n.º 4
0
// Run the tests using MongoRe
func setUpMongoreTest(s *S) {
	account.Storage(mongore.New(mongore.Config{
		Host:         "127.0.0.1:27017",
		DatabaseName: "backstage_account_test",
	}))
}
Ejemplo n.º 5
0
// Allow to override the default storage engine.
// To be compatible, it is needed to implement the Storable interface.
func (api *Api) Storage(store account.Storable) {
	api.store = store
	account.Storage(store)
	api.auth = auth.NewAuth(store)
}