Skip to content

Commit

Permalink
adding rest of config for bitmovin clinet
Browse files Browse the repository at this point in the history
  • Loading branch information
James Yeh committed Dec 28, 2016
1 parent 02e97d3 commit a34faef
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 3 additions & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 8 additions & 2 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit a34faef

Please sign in to comment.