func (s *Service) Initialize() { // Get options from process arguments c := getOptions() s.Port = c.Port // Initialize store s.Store = store.New() s.Store.InitializeState() // Initialize service engine s.Engine = gin.Default() s.Engine.Use(gin.Logger()) s.Engine.Use(gin.Recovery()) routes.AddRepoRoutes(s.Store, s.Engine) }
func (s *Service) Initialize() { // Get options from process arguments c := getOptions() s.Port = c.Port // Initialize vulcan client s.VulcandClient = utils.NewVulcandClient(s.Name, s.Port, 10*time.Second) // Initialize store s.Store = store.New() s.Store.InitializeState() // Initialize service engine s.Router = gin.Default() s.Router.Use(gin.Logger()) s.Router.Use(gin.Recovery()) routes.AddRepoRoutes(s.Store, s.Router) }