Ejemplo n.º 1
0
func main() {
	runtime.GOMAXPROCS(runtime.NumCPU())
	subscription := account.NewEtcdSubscription("/maestro_development", &db.EtcdConfig{Machines: []string{"http://localhost:2379"}})
	api := api.NewApi(mem.New(), subscription)

	api.AddHook(account.Hook{
		Name:   "backstage-maestro-slack",
		Team:   account.ALL_TEAMS,
		Events: []string{"service.create"},
		Config: account.HookConfig{Address: "http://localhost:8001"},
		// Text: `{"username": "******", "channel": "#backstage",
		// "icon_url": "http://www.albertoleal.me/images/maestro-pq.png",
		// "text": "Um novo serviço foi criado no Backstage Maestro, com o seguinte subdomínio: {{.Service.Subdomain}}."}`,
	})

	api.ListenEvents()
	api.Run()
}
Ejemplo n.º 2
0
// Run the tests in memory
func setUpMemoryTest(s *S) {
	s.store = mem.New()
}
Ejemplo n.º 3
0
// // Run the tests in memory
func setUpMemoryTest() account.Storable {
	store := mem.New()
	account.Storage(store)
	return store
}
Ejemplo n.º 4
0
// Run the tests in memory
func setUpMemoryTest(s *S) {
	account.Storage(mem.New())
}