diff options
author | Martin Polden <mpolden@mpolden.no> | 2017-07-10 15:08:33 +0200 |
---|---|---|
committer | Martin Polden <mpolden@mpolden.no> | 2017-07-10 15:08:33 +0200 |
commit | 1b0b9665f72a7f08ece68225432c4a5487f53cd6 (patch) | |
tree | f5d4c865067f8673e7894620ab03298d3b879922 | |
parent | ba50ce0989830da1a9b4ba95c19488586759ef23 (diff) |
Rename fields
-rw-r--r-- | main.go | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -13,11 +13,11 @@ import ( func main() { var opts struct { - Listen string `short:"l" long:"listen" description:"Listen address" value-name:"ADDRESS" default:":8080"` - Config string `short:"c" long:"config" description:"Path to config file" value-name:"FILE" default:"config.json"` - CacheStops time.Duration `short:"s" long:"cache-stops" description:"Bus stops cache duration" value-name:"DURATION" default:"168h"` - CacheDepartures time.Duration `short:"d" long:"cache-departures" description:"Departures cache duration" value-name:"DURATION" default:"1m"` - CORS bool `short:"x" long:"cors" description:"Allow requests from other domains"` + Listen string `short:"l" long:"listen" description:"Listen address" value-name:"ADDRESS" default:":8080"` + Config string `short:"c" long:"config" description:"Path to config file" value-name:"FILE" default:"config.json"` + StopTTL time.Duration `short:"s" long:"stops-ttl" description:"Bus stop cache duration" value-name:"DURATION" default:"168h"` + DepartureTTL time.Duration `short:"d" long:"departure-ttl" description:"Departure cache duration" value-name:"DURATION" default:"1m"` + CORS bool `short:"x" long:"cors" description:"Allow requests from other domains"` } _, err := flags.ParseArgs(&opts, os.Args) if err != nil { @@ -29,7 +29,7 @@ func main() { log.Fatal(err) } - api := api.New(client, opts.CacheStops, opts.CacheDepartures, opts.CORS) + api := api.New(client, opts.StopTTL, opts.DepartureTTL, opts.CORS) log.Printf("Listening on %s", opts.Listen) if err := http.ListenAndServe(opts.Listen, api.Handler()); err != nil { |