Skip to content

Commit

Permalink
Add support for Hybrik as a transcoding provider
Browse files Browse the repository at this point in the history
Initial implementation of the video-transcoding-api provider interface for
Hybrik.

Majority coding credit to Leonardo Soares (leonardogcsoares)
  • Loading branch information
rajaksc committed May 10, 2017
1 parent c49c678 commit d354cbc
Show file tree
Hide file tree
Showing 3 changed files with 474 additions and 1 deletion.
16 changes: 15 additions & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ type Config struct {
EncodingCom *EncodingCom
ElasticTranscoder *ElasticTranscoder
ElementalConductor *ElementalConductor
Hybrik *Hybrik
Zencoder *Zencoder
Bitmovin *Bitmovin
}
Expand Down Expand Up @@ -72,6 +73,18 @@ type Bitmovin struct {
EncodingVersion string `envconfig:"BITMOVIN_ENCODING_VERSION" default:"STABLE"`
}

// Hybrik represents the set of configurations for the Hybrik
// provider.
type Hybrik struct {
URL string `envconfig:"HYBRIK_URL"`
ComplianceDate string `envconfig:"HYBRIK_COMPLIANCE_DATE"`
OAPIKey string `envconfig:"HYBRIK_OAPI_KEY"`
OAPISecret string `envconfig:"HYBRIK_OAPI_SECRET"`
AuthKey string `envconfig:"HYBRIK_AUTH_KEY"`
AuthSecret string `envconfig:"HYBRIK_AUTH_SECRET"`
Destination string `envconfig:"HYBRIK_DESTINATION"`
}

// LoadConfig loads the configuration of the API using environment variables.
func LoadConfig() *Config {
cfg := Config{
Expand All @@ -80,10 +93,11 @@ func LoadConfig() *Config {
ElasticTranscoder: new(ElasticTranscoder),
ElementalConductor: new(ElementalConductor),
Bitmovin: new(Bitmovin),
Hybrik: new(Hybrik),
Server: new(server.Config),
}
config.LoadEnvConfig(&cfg)
loadFromEnv(cfg.Redis, cfg.EncodingCom, cfg.ElasticTranscoder, cfg.ElementalConductor, cfg.Bitmovin, cfg.Server)
loadFromEnv(cfg.Redis, cfg.EncodingCom, cfg.ElasticTranscoder, cfg.ElementalConductor, cfg.Bitmovin, cfg.Hybrik, cfg.Server)
return &cfg
}

Expand Down
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
_ "github.com/NYTimes/video-transcoding-api/provider/elastictranscoder"
_ "github.com/NYTimes/video-transcoding-api/provider/elementalconductor"
_ "github.com/NYTimes/video-transcoding-api/provider/encodingcom"
_ "github.com/NYTimes/video-transcoding-api/provider/hybrik"
_ "github.com/NYTimes/video-transcoding-api/provider/zencoder"
"github.com/NYTimes/video-transcoding-api/service"
"github.com/google/gops/agent"
Expand All @@ -25,6 +26,7 @@ func main() {
server.Init("video-transcoding-api", cfg.Server)
server.Log.Hooks.Add(logrus_stack.StandardHook())
server.Log.Hooks.Add(logrus_env.NewHook([]string{"ENVIRONMENT"}))

gcpLoggingHook, err := sdhook.New(
sdhook.GoogleLoggingAgent(),
sdhook.ErrorReportingService("video-transcoding-api"),
Expand Down
Loading

0 comments on commit d354cbc

Please sign in to comment.