Skip to content

Commit

Permalink
Merge pull request #241 from video-dev/v2
Browse files Browse the repository at this point in the history
V2: Rename import path
  • Loading branch information
fsouza authored Aug 23, 2019
2 parents ecae75a + 6436075 commit b883179
Show file tree
Hide file tree
Showing 63 changed files with 137 additions and 2,855 deletions.
14 changes: 0 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ The Video Transcoding API provides an agnostic API to transcode media assets
across different cloud services. Currently, it supports the following
providers:

- [Amazon Elastic Transcoder](https://aws.amazon.com/elastictranscoder/)
- [Bitmovin](http://bitmovin.com)
- [Elemental Conductor](http://www.elementaltechnologies.com/products/elemental-conductor)
- [Encoding.com](http://encoding.com)
Expand All @@ -25,19 +24,6 @@ environment variables:

### Providers configuration

#### For [Amazon Elastic Transcoder](https://aws.amazon.com/elastictranscoder/)

```
export AWS_ACCESS_KEY_ID=your.access.key.id
export AWS_SECRET_ACCESS_KEY=your.secret.access.key
export AWS_REGION="us-east-1"
export ELASTICTRANSCODER_PIPELINE_ID="yourpipeline-id"
```

Please notice that for Elastic Transcoder you don't specify the destination
bucket, as it is [defined in the Elastic Transcoder
Pipeline](https://docs.aws.amazon.com/elastictranscoder/latest/developerguide/pipeline-settings.html#pipeline-settings-configure-transcoded-bucket).

#### For [Bitmovin](http://bitmovin.com)

```
Expand Down
14 changes: 2 additions & 12 deletions config/config.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package config // import "github.com/NYTimes/video-transcoding-api/config"
package config

import (
"github.com/NYTimes/gizmo/server"
"github.com/NYTimes/video-transcoding-api/db/redis/storage"
logging "github.com/fsouza/gizmo-stackdriver-logging"
"github.com/kelseyhightower/envconfig"
"github.com/video-dev/video-transcoding-api/v2/db/redis/storage"
)

// Config is a struct to contain all the needed configuration for the
Expand All @@ -15,7 +15,6 @@ type Config struct {
DefaultSegmentDuration uint `envconfig:"DEFAULT_SEGMENT_DURATION" default:"5"`
Redis *storage.Config
EncodingCom *EncodingCom
ElasticTranscoder *ElasticTranscoder
ElementalConductor *ElementalConductor
Hybrik *Hybrik
Zencoder *Zencoder
Expand All @@ -41,15 +40,6 @@ type Zencoder struct {
Destination string `envconfig:"ZENCODER_DESTINATION"`
}

// ElasticTranscoder represents the set of configurations for the Elastic
// Transcoder provider.
type ElasticTranscoder struct {
AccessKeyID string `envconfig:"AWS_ACCESS_KEY_ID"`
SecretAccessKey string `envconfig:"AWS_SECRET_ACCESS_KEY"`
Region string `envconfig:"AWS_REGION"`
PipelineID string `envconfig:"ELASTICTRANSCODER_PIPELINE_ID"`
}

// ElementalConductor represents the set of configurations for the Elemental
// Conductor provider.
type ElementalConductor struct {
Expand Down
16 changes: 1 addition & 15 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
"testing"

"github.com/NYTimes/gizmo/server"
"github.com/NYTimes/video-transcoding-api/db/redis/storage"
logging "github.com/fsouza/gizmo-stackdriver-logging"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/video-dev/video-transcoding-api/v2/db/redis/storage"
)

func TestLoadConfigFromEnv(t *testing.T) {
Expand All @@ -29,7 +29,6 @@ func TestLoadConfigFromEnv(t *testing.T) {
"AWS_ACCESS_KEY_ID": "AKIANOTREALLY",
"AWS_SECRET_ACCESS_KEY": "secret-key",
"AWS_REGION": "us-east-1",
"ELASTICTRANSCODER_PIPELINE_ID": "mypipeline",
"ELEMENTALCONDUCTOR_HOST": "elemental-server",
"ELEMENTALCONDUCTOR_USER_LOGIN": "myuser",
"ELEMENTALCONDUCTOR_API_KEY": "secret-key",
Expand Down Expand Up @@ -83,12 +82,6 @@ func TestLoadConfigFromEnv(t *testing.T) {
PresetPath: "transcoding-api-presets",
},
Zencoder: &Zencoder{},
ElasticTranscoder: &ElasticTranscoder{
AccessKeyID: "AKIANOTREALLY",
SecretAccessKey: "secret-key",
Region: "us-east-1",
PipelineID: "mypipeline",
},
ElementalConductor: &ElementalConductor{
Host: "elemental-server",
UserLogin: "myuser",
Expand Down Expand Up @@ -151,7 +144,6 @@ func TestLoadConfigFromEnvWithDefaults(t *testing.T) {
"AWS_ACCESS_KEY_ID": "AKIANOTREALLY",
"AWS_SECRET_ACCESS_KEY": "secret-key",
"AWS_REGION": "us-east-1",
"ELASTICTRANSCODER_PIPELINE_ID": "mypipeline",
"ELEMENTALCONDUCTOR_HOST": "elemental-server",
"ELEMENTALCONDUCTOR_USER_LOGIN": "myuser",
"ELEMENTALCONDUCTOR_API_KEY": "secret-key",
Expand Down Expand Up @@ -187,12 +179,6 @@ func TestLoadConfigFromEnvWithDefaults(t *testing.T) {
Destination: "https://safe-stuff",
StatusEndpoint: "http://status.encoding.com",
},
ElasticTranscoder: &ElasticTranscoder{
AccessKeyID: "AKIANOTREALLY",
SecretAccessKey: "secret-key",
Region: "us-east-1",
PipelineID: "mypipeline",
},
ElementalConductor: &ElementalConductor{
Host: "elemental-server",
UserLogin: "myuser",
Expand Down
4 changes: 2 additions & 2 deletions db/dbtest/fake_db.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package dbtest // import "github.com/NYTimes/video-transcoding-api/db/dbtest"
package dbtest

import (
"errors"
"time"

"github.com/NYTimes/video-transcoding-api/db"
"github.com/video-dev/video-transcoding-api/v2/db"
)

type fakeRepository struct {
Expand Down
2 changes: 1 addition & 1 deletion db/dbtest/fake_db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"
"time"

"github.com/NYTimes/video-transcoding-api/db"
"github.com/video-dev/video-transcoding-api/v2/db"
)

const dbErrorMsg = "database error"
Expand Down
4 changes: 2 additions & 2 deletions db/redis/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"strconv"
"time"

"github.com/NYTimes/video-transcoding-api/db"
"github.com/NYTimes/video-transcoding-api/db/redis/storage"
"github.com/go-redis/redis"
"github.com/video-dev/video-transcoding-api/v2/db"
"github.com/video-dev/video-transcoding-api/v2/db/redis/storage"
)

const jobsSetKey = "jobs"
Expand Down
6 changes: 3 additions & 3 deletions db/redis/job_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import (
"testing"
"time"

"github.com/NYTimes/video-transcoding-api/config"
"github.com/NYTimes/video-transcoding-api/db"
"github.com/NYTimes/video-transcoding-api/db/redis/storage"
"github.com/go-redis/redis"
"github.com/kr/pretty"
"github.com/video-dev/video-transcoding-api/v2/config"
"github.com/video-dev/video-transcoding-api/v2/db"
"github.com/video-dev/video-transcoding-api/v2/db/redis/storage"
)

func TestCreateJob(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions db/redis/localpreset.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package redis
import (
"errors"

"github.com/NYTimes/video-transcoding-api/db"
"github.com/NYTimes/video-transcoding-api/db/redis/storage"
"github.com/go-redis/redis"
"github.com/video-dev/video-transcoding-api/v2/db"
"github.com/video-dev/video-transcoding-api/v2/db/redis/storage"
)

const localPresetsSetKey = "localpresets"
Expand Down
6 changes: 3 additions & 3 deletions db/redis/localpreset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"reflect"
"testing"

"github.com/NYTimes/video-transcoding-api/config"
"github.com/NYTimes/video-transcoding-api/db"
"github.com/NYTimes/video-transcoding-api/db/redis/storage"
"github.com/video-dev/video-transcoding-api/v2/config"
"github.com/video-dev/video-transcoding-api/v2/db"
"github.com/video-dev/video-transcoding-api/v2/db/redis/storage"
)

func TestCreateLocalPreset(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions db/redis/presetmap.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package redis

import (
"github.com/NYTimes/video-transcoding-api/db"
"github.com/NYTimes/video-transcoding-api/db/redis/storage"
"github.com/go-redis/redis"
"github.com/video-dev/video-transcoding-api/v2/db"
"github.com/video-dev/video-transcoding-api/v2/db/redis/storage"
)

const presetmapsSetKey = "presetmaps"
Expand Down
6 changes: 3 additions & 3 deletions db/redis/presetmap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"reflect"
"testing"

"github.com/NYTimes/video-transcoding-api/config"
"github.com/NYTimes/video-transcoding-api/db"
"github.com/NYTimes/video-transcoding-api/db/redis/storage"
"github.com/video-dev/video-transcoding-api/v2/config"
"github.com/video-dev/video-transcoding-api/v2/db"
"github.com/video-dev/video-transcoding-api/v2/db/redis/storage"
)

func TestCreatePresetMap(t *testing.T) {
Expand Down
8 changes: 4 additions & 4 deletions db/redis/redis.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package redis // import "github.com/NYTimes/video-transcoding-api/db/redis"
package redis

import (
"github.com/NYTimes/video-transcoding-api/config"
"github.com/NYTimes/video-transcoding-api/db"
"github.com/NYTimes/video-transcoding-api/db/redis/storage"
"github.com/video-dev/video-transcoding-api/v2/config"
"github.com/video-dev/video-transcoding-api/v2/db"
"github.com/video-dev/video-transcoding-api/v2/db/redis/storage"
)

// NewRepository creates a new Repository that uses Redis for persistence.
Expand Down
2 changes: 1 addition & 1 deletion db/redis/storage/redis.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Package storage provides a type for storing Go objects in Redis.
package storage // import "github.com/NYTimes/video-transcoding-api/db/redis/storage"
package storage

import (
"errors"
Expand Down
2 changes: 1 addition & 1 deletion db/repo.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package db // import "github.com/NYTimes/video-transcoding-api/db"
package db

import (
"errors"
Expand Down
21 changes: 0 additions & 21 deletions doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,4 @@
//
// HTTP API for transcoding media files into different formats using pluggable
// providers.
//
// ## Currently supported providers
//
// + [Amazon Elastic Transcoder](https://aws.amazon.com/elastictranscoder/)
// + [Elemental Conductor](https://www.elementaltechnologies.com/products/elemental-conductor)
// + [Encoding.com](http://api.encoding.com)
// + [Zencoder](http://zencoder.com)
//
// Schemes: http
// BasePath: /
// Version: 1.0.0
// License: Apache 2.0 http://www.apache.org/licenses/LICENSE-2.0.html
//
// Consumes:
// - application/json
//
//
// Produces:
// - application/json
//
// swagger:meta
package main
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
module github.com/NYTimes/video-transcoding-api
module github.com/video-dev/video-transcoding-api/v2

require (
github.com/NYTimes/gizmo v1.2.14
github.com/NYTimes/gziphandler v1.1.1
github.com/aws/aws-sdk-go v1.23.3
github.com/aws/aws-sdk-go-v2 v0.10.0
github.com/bitmovin/bitmovin-go v1.29.0
github.com/fsouza/ctxlogger v1.5.8
Expand Down
Loading

0 comments on commit b883179

Please sign in to comment.