aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Polden <mpolden@mpolden.no>2017-07-10 15:08:33 +0200
committerMartin Polden <mpolden@mpolden.no>2017-07-10 15:08:33 +0200
commit1b0b9665f72a7f08ece68225432c4a5487f53cd6 (patch)
treef5d4c865067f8673e7894620ab03298d3b879922
parentba50ce0989830da1a9b4ba95c19488586759ef23 (diff)
Rename fields
-rw-r--r--main.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/main.go b/main.go
index 783018d..f04ea0b 100644
--- a/main.go
+++ b/main.go
@@ -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 {