Skip to content

Commit

Permalink
Rename import path to v2
Browse files Browse the repository at this point in the history
Related to #239.
  • Loading branch information
fsouza committed Jul 26, 2019
1 parent fbc0a10 commit dc8edc0
Show file tree
Hide file tree
Showing 56 changed files with 200 additions and 195 deletions.
4 changes: 2 additions & 2 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 Down
2 changes: 1 addition & 1 deletion 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 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
6 changes: 3 additions & 3 deletions db/redis/storage/redis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ func TestSaveMap(t *testing.T) {
}

func TestSaveErrors(t *testing.T) {
var tests = []struct {
tests := []struct {
input interface{}
errMsg string
}{
Expand Down Expand Up @@ -238,7 +238,7 @@ func TestFieldMap(t *testing.T) {
if err != nil {
t.Fatal(err)
}
var tests = []struct {
tests := []struct {
description string
hash interface{}
expected map[string]interface{}
Expand Down Expand Up @@ -399,7 +399,7 @@ func TestLoadMap(t *testing.T) {
func TestLoadErrors(t *testing.T) {
var n int
var invalidMap map[string]int
var tests = []struct {
tests := []struct {
key string
output interface{}
errMsg string
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
2 changes: 1 addition & 1 deletion db/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

func TestOutputOptionsValidation(t *testing.T) {
var tests = []struct {
tests := []struct {
testCase string
opts OutputOptions
errMsg string
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/NYTimes/video-transcoding-api
module github.com/video-dev/video-transcoding-api/v2

require (
github.com/NYTimes/encoding-wrapper v0.2.0
Expand Down
18 changes: 9 additions & 9 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ import (
"log"

"github.com/NYTimes/gizmo/server"
"github.com/NYTimes/video-transcoding-api/config"
_ "github.com/NYTimes/video-transcoding-api/provider/bitmovin"
_ "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/mediaconvert"
_ "github.com/NYTimes/video-transcoding-api/provider/zencoder"
"github.com/NYTimes/video-transcoding-api/service"
"github.com/google/gops/agent"
"github.com/video-dev/video-transcoding-api/v2/config"
_ "github.com/video-dev/video-transcoding-api/v2/provider/bitmovin"
_ "github.com/video-dev/video-transcoding-api/v2/provider/elastictranscoder"
_ "github.com/video-dev/video-transcoding-api/v2/provider/elementalconductor"
_ "github.com/video-dev/video-transcoding-api/v2/provider/encodingcom"
_ "github.com/video-dev/video-transcoding-api/v2/provider/hybrik"
_ "github.com/video-dev/video-transcoding-api/v2/provider/mediaconvert"
_ "github.com/video-dev/video-transcoding-api/v2/provider/zencoder"
"github.com/video-dev/video-transcoding-api/v2/service"
)

func main() {
Expand Down
18 changes: 9 additions & 9 deletions provider/bitmovin/bitmovin.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package bitmovin // import "github.com/NYTimes/video-transcoding-api/provider/bitmovin"
package bitmovin

import (
"errors"
Expand All @@ -11,13 +11,13 @@ import (
"strings"
"time"

"github.com/NYTimes/video-transcoding-api/config"
"github.com/NYTimes/video-transcoding-api/db"
"github.com/NYTimes/video-transcoding-api/provider"
"github.com/bitmovin/bitmovin-go/bitmovin"
"github.com/bitmovin/bitmovin-go/bitmovintypes"
"github.com/bitmovin/bitmovin-go/models"
"github.com/bitmovin/bitmovin-go/services"
"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/provider"
)

// Name is the name used for registering the bitmovin provider in the
Expand Down Expand Up @@ -82,7 +82,8 @@ var h264Levels = []bitmovintypes.H264Level{
bitmovintypes.H264Level4_2,
bitmovintypes.H264Level5,
bitmovintypes.H264Level5_1,
bitmovintypes.H264Level5_2}
bitmovintypes.H264Level5_2,
}

var errBitmovinInvalidConfig = provider.InvalidConfigError("Invalid configuration")

Expand Down Expand Up @@ -270,7 +271,7 @@ func (p *bitmovinProvider) DeletePreset(presetID string) error {
h264Response, err := h264.Retrieve(presetID)
if err == nil {
if h264Response.Status == bitmovinAPIErrorMsg {
//if it were merely to not exist, then the err would not be nil
// if it were merely to not exist, then the err would not be nil
return errors.New("api error")
}
cdResp, cdErr := h264.RetrieveCustomData(presetID)
Expand Down Expand Up @@ -317,7 +318,7 @@ func (p *bitmovinProvider) DeletePreset(presetID string) error {
vp8Response, err := vp8.Retrieve(presetID)
if err == nil {
if vp8Response.Status == bitmovinAPIErrorMsg {
//if it were merely to not exist, then the err would not be nil
// if it were merely to not exist, then the err would not be nil
return errors.New("api error")
}
cdResp, err := vp8.RetrieveCustomData(presetID)
Expand Down Expand Up @@ -508,7 +509,7 @@ func (p *bitmovinProvider) Transcode(job *db.Job) (*provider.JobStatus, error) {
outputtingHLS := false
manifestID := ""

//create the master manifest if needed so we can add it to the customData of the encoding response
// create the master manifest if needed so we can add it to the customData of the encoding response
for _, output := range job.Outputs {
if output.Preset.OutputOpts.Extension != "webm" {
videoPresetID := output.Preset.ProviderMapping[Name]
Expand Down Expand Up @@ -1351,7 +1352,6 @@ func getAACConfig(s *services.AACCodecConfigurationService, bitrate int, samplin
return "", errors.New("error in creating audio portion of preset")
}
return *audioResp.Data.Result.ID, nil

}

func getVorbisConfig(s *services.VorbisCodecConfigurationService, bitrate int, samplingRate float64) (string, error) {
Expand Down
7 changes: 3 additions & 4 deletions provider/bitmovin/bitmovin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import (
"testing"
"time"

"github.com/NYTimes/video-transcoding-api/config"
"github.com/NYTimes/video-transcoding-api/db"
"github.com/NYTimes/video-transcoding-api/provider"
"github.com/bitmovin/bitmovin-go/bitmovin"
"github.com/bitmovin/bitmovin-go/bitmovintypes"
"github.com/bitmovin/bitmovin-go/models"
"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/provider"
)

func TestFactoryIsRegistered(t *testing.T) {
Expand Down Expand Up @@ -1840,7 +1840,6 @@ func TestCancelJob(t *testing.T) {
if err != nil {
t.Fatal(err)
}

}

func TestCancelJobFailsOnAPIError(t *testing.T) {
Expand Down
14 changes: 7 additions & 7 deletions provider/elastictranscoder/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
// uses AWS Elastic Transcoder for transcoding media files.
//
// It doesn't expose any public type. In order to use the provider, one must
// import this package and then grab the factory from the provider package:

//
// import (
// "github.com/NYTimes/video-transcoding-api/provider"
// "github.com/NYTimes/video-transcoding-api/provider/elastictranscoder"
// "github.com/video-dev/video-transcoding-api/v2/provider"
// "github.com/video-dev/video-transcoding-api/v2/provider/elastictranscoder"
// )
//
// func UseProvider() {
// factory, err := provider.GetProviderFactory(elastictranscoder.Name)
// // handle err and use factory to get an instance of the provider.
// }
package elastictranscoder // import "github.com/NYTimes/video-transcoding-api/provider/elastictranscoder"
package elastictranscoder

import (
"errors"
Expand All @@ -24,14 +24,14 @@ import (
"strings"
"time"

"github.com/NYTimes/video-transcoding-api/config"
"github.com/NYTimes/video-transcoding-api/db"
"github.com/NYTimes/video-transcoding-api/provider"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/elastictranscoder"
"github.com/aws/aws-sdk-go/service/elastictranscoder/elastictranscoderiface"
"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/provider"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion provider/elastictranscoder/aws_fake_transcode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (c *fakeElasticTranscoder) CreateJob(input *elastictranscoder.CreateJobInpu
}

func (c *fakeElasticTranscoder) CreatePreset(input *elastictranscoder.CreatePresetInput) (*elastictranscoder.CreatePresetOutput, error) {
var presetID = *input.Name + "-abc123"
presetID := *input.Name + "-abc123"
return &elastictranscoder.CreatePresetOutput{
Preset: &elastictranscoder.Preset{
Audio: input.Audio,
Expand Down
Loading

0 comments on commit dc8edc0

Please sign in to comment.