Esempio n. 1
0
//NewTestCore returns a roll.Core instance with mocked implementations of its internal dependencies
func NewTestCore() (*roll.Core, *roll.CoreConfig) {
	var coreConfig = roll.CoreConfig{}
	coreConfig.DeveloperRepo = new(mocks.DeveloperRepo)
	coreConfig.ApplicationRepo = new(mocks.ApplicationRepo)
	coreConfig.AdminRepo = new(mocks.AdminRepo)
	coreConfig.SecretsRepo = new(mocks.SecretsRepo)
	coreConfig.IdGenerator = TestIDGen{}
	coreConfig.Secure = false
	return roll.NewCore(&coreConfig), &coreConfig
}
Esempio n. 2
0
func RunRoll(port int, config *roll.CoreConfig) {
	core := roll.NewCore(config)
	log.Info("Starting roll - listening on port ", port)
	http.ListenAndServe(fmt.Sprintf(":%d", port), rollhttp.Handler(core))
}