From a34faef56c5695f35b9160d3b9f897dafaf7f36d Mon Sep 17 00:00:00 2001 From: James Yeh Date: Wed, 28 Dec 2016 11:31:40 -0800 Subject: [PATCH] adding rest of config for bitmovin clinet --- config/config.go | 4 +++- config/config_test.go | 10 ++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/config/config.go b/config/config.go index 0111c1a2..07599b5b 100644 --- a/config/config.go +++ b/config/config.go @@ -61,7 +61,9 @@ type ElementalConductor struct { // Bitmovin represents the set of configurations for the Bitmovin // provider. type Bitmovin struct { - APIKey string `envconfig:"BITMOVIN_API_KEY"` + APIKey string `envconfig:"BITMOVIN_API_KEY"` + Endpoint string `envconfig:"BITMOVIN_ENDPOINT" default:"https://api.bitmovin.com/v1/"` + Timeout uint `envconfig:"BITMOVIN_TIMEOUT" default:"5"` } // LoadConfig loads the configuration of the API using environment variables. diff --git a/config/config_test.go b/config/config_test.go index 5639f68c..c71409f4 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -36,6 +36,8 @@ func TestLoadConfigFromEnv(t *testing.T) { "ELEMENTALCONDUCTOR_AWS_SECRET_ACCESS_KEY": "secret-key", "ELEMENTALCONDUCTOR_DESTINATION": "https://safe-stuff", "BITMOVIN_API_KEY": "secret-key", + "BITMOVIN_ENDPOINT": "bitmovin", + "BITMOVIN_TIMEOUT": "3", "SWAGGER_MANIFEST_PATH": "/opt/video-transcoding-api-swagger.json", "HTTP_ACCESS_LOG": accessLog, "HTTP_PORT": "8080", @@ -76,7 +78,9 @@ func TestLoadConfigFromEnv(t *testing.T) { Destination: "https://safe-stuff", }, Bitmovin: &Bitmovin{ - APIKey: "secret-key", + APIKey: "secret-key", + Endpoint: "bitmovin", + Timeout: 3, }, Server: &server.Config{ HTTPPort: 8080, @@ -172,7 +176,9 @@ func TestLoadConfigFromEnvWithDefauts(t *testing.T) { Destination: "https://safe-stuff", }, Bitmovin: &Bitmovin{ - APIKey: "secret-key", + APIKey: "secret-key", + Endpoint: "https://api.bitmovin.com/v1/", + Timeout: 5, }, Server: &server.Config{ HTTPPort: 8080,