func new_server(env Env) *server { bikage, err := bikage.NewBikage(env["GOOGLE_APIKEY"], env["MONGODB_URI"]) if err != nil { panic(err) } return &server{ bk: bikage, refresh: make(chan *refresh_job, 10), } }
func main() { flag.Parse() if username == "" || password == "" || google_api_key == "" { flag.Usage() os.Exit(1) } bikage, err := bikage.NewBikage(google_api_key, mongo_url) if err != nil { log.Fatalln(err) } trips, err := bikage.GetTrips(username, password) if err != nil { log.Fatalln(err) } fmt.Println(bikage.ComputeStats(trips)) }