Exemplo n.º 1
0
func main() {
	listen := ":8899"
	logrus.Info("Starting Rancher V2 API on ", listen)
	server := server.New()
	r := router.New(server)
	http.ListenAndServe(listen, r)
}
Exemplo n.º 2
0
func main() {
	listen := ":8899"
	logrus.Info("Starting Rancher V2 API on ", listen)
	config := mysql.Config{
		User:      "******",
		Passwd:    "cattle",
		Net:       "tcp",
		Addr:      "localhost:3306",
		DBName:    "cattle",
		Collation: "utf8_general_ci",
	}
	server, err := server.New("mysql", config.FormatDSN())
	if err != nil {
		logrus.Fatal(err)
	}
	r := router.New(server)
	http.ListenAndServe(listen, r)
}