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)
}
Пример #2
0
func main() {
	fmt.Println(utils.NewVulcandClient("", "", 0))
}