From b270159aae97359afe02f3c4843fa0f4e9a1a1b6 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Mon, 21 May 2018 12:19:56 -0700 Subject: Offer the possibility to set Pocket Consumer Key as environment variable --- config/config.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'config') diff --git a/config/config.go b/config/config.go index bc4fc60..2e08434 100644 --- a/config/config.go +++ b/config/config.go @@ -197,6 +197,11 @@ func (c *Config) CreateAdmin() bool { return c.get("CREATE_ADMIN", "") != "" } +// PocketConsumerKey returns the Pocket Consumer Key if defined as environment variable. +func (c *Config) PocketConsumerKey(defaultValue string) string { + return c.get("POCKET_CONSUMER_KEY", defaultValue) +} + // NewConfig returns a new Config. func NewConfig() *Config { return &Config{IsHTTPS: os.Getenv("HTTPS") != ""} -- cgit v1.2.3