From 8b7deba0c0c6252b16cffcf1ce040745fb31985a Mon Sep 17 00:00:00 2001 From: Francisco Souza Date: Fri, 26 Jul 2019 18:21:10 -0400 Subject: [PATCH] Rename import path to v2 Related to #239. --- config/config.go | 4 +-- config/config_test.go | 2 +- db/dbtest/fake_db.go | 4 +-- db/dbtest/fake_db_test.go | 2 +- db/redis/job.go | 4 +-- db/redis/job_test.go | 6 ++-- db/redis/localpreset.go | 4 +-- db/redis/localpreset_test.go | 6 ++-- db/redis/presetmap.go | 4 +-- db/redis/presetmap_test.go | 6 ++-- db/redis/redis.go | 8 ++--- db/redis/storage/redis.go | 2 +- db/redis/storage/redis_test.go | 6 ++-- db/repo.go | 2 +- db/types_test.go | 2 +- go.mod | 2 +- main.go | 18 +++++------ provider/bitmovin/bitmovin.go | 18 +++++------ provider/bitmovin/bitmovin_test.go | 7 ++-- provider/elastictranscoder/aws.go | 14 ++++---- .../aws_fake_transcode_test.go | 2 +- provider/elastictranscoder/aws_test.go | 14 ++++---- .../elementalconductor/elementalconductor.go | 12 +++---- .../elementalconductor_fake_transcode_test.go | 4 +-- .../elementalconductor_test.go | 14 ++++---- provider/encodingcom/encodingcom.go | 12 +++---- provider/encodingcom/encodingcom_test.go | 17 +++++----- provider/fake_provider_test.go | 4 +-- provider/hybrik/hybrik.go | 8 ++--- provider/mediaconvert/factory_test.go | 2 +- provider/mediaconvert/fake_client_test.go | 32 +++++++++++-------- provider/mediaconvert/mediaconvert.go | 6 ++-- provider/mediaconvert/mediaconvert_test.go | 6 ++-- provider/mediaconvert/preset_mapping.go | 4 +-- provider/provider.go | 6 ++-- provider/provider_test.go | 4 +-- provider/zencoder/zencoder.go | 16 +++++----- provider/zencoder/zencoder_test.go | 25 ++++++++------- service/fake_provider_test.go | 6 ++-- service/preset.go | 6 ++-- service/preset_params.go | 2 +- service/preset_responses.go | 2 +- service/preset_test.go | 6 ++-- service/presetmap.go | 4 +-- service/presetmap_params.go | 4 +-- service/presetmap_test.go | 6 ++-- service/provider.go | 4 +-- service/provider_responses.go | 4 +-- service/provider_test.go | 4 +-- service/service.go | 10 +++--- service/swagger_test.go | 2 +- service/transcode.go | 6 ++-- service/transcode_params.go | 4 +-- service/transcode_responses.go | 4 +-- service/transcode_test.go | 10 +++--- swagger/handler.go | 2 +- 56 files changed, 200 insertions(+), 195 deletions(-) diff --git a/config/config.go b/config/config.go index 32d9e81f..84bfcf29 100644 --- a/config/config.go +++ b/config/config.go @@ -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 diff --git a/config/config_test.go b/config/config_test.go index c7a7e0b0..675cbd96 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -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) { diff --git a/db/dbtest/fake_db.go b/db/dbtest/fake_db.go index 9733cc0d..d8df8381 100644 --- a/db/dbtest/fake_db.go +++ b/db/dbtest/fake_db.go @@ -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 { diff --git a/db/dbtest/fake_db_test.go b/db/dbtest/fake_db_test.go index 274a9f1b..e10e5e6f 100644 --- a/db/dbtest/fake_db_test.go +++ b/db/dbtest/fake_db_test.go @@ -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" diff --git a/db/redis/job.go b/db/redis/job.go index 6f4b509c..7c23f728 100644 --- a/db/redis/job.go +++ b/db/redis/job.go @@ -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" diff --git a/db/redis/job_test.go b/db/redis/job_test.go index a8c225c7..aac5688a 100644 --- a/db/redis/job_test.go +++ b/db/redis/job_test.go @@ -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) { diff --git a/db/redis/localpreset.go b/db/redis/localpreset.go index a6b190eb..f9cc7cc5 100644 --- a/db/redis/localpreset.go +++ b/db/redis/localpreset.go @@ -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" diff --git a/db/redis/localpreset_test.go b/db/redis/localpreset_test.go index ab1bbd95..5eb3215b 100644 --- a/db/redis/localpreset_test.go +++ b/db/redis/localpreset_test.go @@ -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) { diff --git a/db/redis/presetmap.go b/db/redis/presetmap.go index 4a31b45e..b42c6eb0 100644 --- a/db/redis/presetmap.go +++ b/db/redis/presetmap.go @@ -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" diff --git a/db/redis/presetmap_test.go b/db/redis/presetmap_test.go index f18f45ed..1d3cb2f4 100644 --- a/db/redis/presetmap_test.go +++ b/db/redis/presetmap_test.go @@ -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) { diff --git a/db/redis/redis.go b/db/redis/redis.go index 8126802f..5e12b8c4 100644 --- a/db/redis/redis.go +++ b/db/redis/redis.go @@ -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. diff --git a/db/redis/storage/redis.go b/db/redis/storage/redis.go index 2343c4dc..94e3be20 100644 --- a/db/redis/storage/redis.go +++ b/db/redis/storage/redis.go @@ -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" diff --git a/db/redis/storage/redis_test.go b/db/redis/storage/redis_test.go index bfca4b63..4dc3b57a 100644 --- a/db/redis/storage/redis_test.go +++ b/db/redis/storage/redis_test.go @@ -192,7 +192,7 @@ func TestSaveMap(t *testing.T) { } func TestSaveErrors(t *testing.T) { - var tests = []struct { + tests := []struct { input interface{} errMsg string }{ @@ -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{} @@ -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 diff --git a/db/repo.go b/db/repo.go index 36343460..e063e0c4 100644 --- a/db/repo.go +++ b/db/repo.go @@ -1,4 +1,4 @@ -package db // import "github.com/NYTimes/video-transcoding-api/db" +package db import ( "errors" diff --git a/db/types_test.go b/db/types_test.go index cc6af0e0..3d625c30 100644 --- a/db/types_test.go +++ b/db/types_test.go @@ -6,7 +6,7 @@ import ( ) func TestOutputOptionsValidation(t *testing.T) { - var tests = []struct { + tests := []struct { testCase string opts OutputOptions errMsg string diff --git a/go.mod b/go.mod index 5e158cbe..393ae335 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/main.go b/main.go index f5801db4..b4d18545 100644 --- a/main.go +++ b/main.go @@ -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() { diff --git a/provider/bitmovin/bitmovin.go b/provider/bitmovin/bitmovin.go index a5bb1aed..d4dd4ac2 100644 --- a/provider/bitmovin/bitmovin.go +++ b/provider/bitmovin/bitmovin.go @@ -1,4 +1,4 @@ -package bitmovin // import "github.com/NYTimes/video-transcoding-api/provider/bitmovin" +package bitmovin import ( "errors" @@ -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 @@ -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") @@ -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) @@ -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) @@ -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] @@ -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) { diff --git a/provider/bitmovin/bitmovin_test.go b/provider/bitmovin/bitmovin_test.go index 98dd4c12..232daa08 100644 --- a/provider/bitmovin/bitmovin_test.go +++ b/provider/bitmovin/bitmovin_test.go @@ -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) { @@ -1840,7 +1840,6 @@ func TestCancelJob(t *testing.T) { if err != nil { t.Fatal(err) } - } func TestCancelJobFailsOnAPIError(t *testing.T) { diff --git a/provider/elastictranscoder/aws.go b/provider/elastictranscoder/aws.go index 4afb7b48..aa37ba34 100644 --- a/provider/elastictranscoder/aws.go +++ b/provider/elastictranscoder/aws.go @@ -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" @@ -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 ( diff --git a/provider/elastictranscoder/aws_fake_transcode_test.go b/provider/elastictranscoder/aws_fake_transcode_test.go index b39b14fc..54f57f47 100644 --- a/provider/elastictranscoder/aws_fake_transcode_test.go +++ b/provider/elastictranscoder/aws_fake_transcode_test.go @@ -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, diff --git a/provider/elastictranscoder/aws_test.go b/provider/elastictranscoder/aws_test.go index c2d158c4..a54eac9a 100644 --- a/provider/elastictranscoder/aws_test.go +++ b/provider/elastictranscoder/aws_test.go @@ -8,13 +8,13 @@ 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/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/service/elastictranscoder" "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/provider" ) func TestFactoryIsRegistered(t *testing.T) { @@ -94,7 +94,7 @@ func TestElasticTranscoderProviderDefaultRegion(t *testing.T) { } func TestElasticTranscoderProviderValidation(t *testing.T) { - var tests = []struct { + tests := []struct { accessKeyID string secretAccessKey string pipelineID string @@ -837,7 +837,7 @@ func TestCreateVideoPreset(t *testing.T) { PipelineID: "mypipeline", }, } - var tests = []struct { + tests := []struct { givenTestCase string givenPreset db.Preset expectedVideoParams *elastictranscoder.VideoParameters @@ -966,7 +966,7 @@ func TestCreateAudioPreset(t *testing.T) { PipelineID: "mypipeline", }, } - var tests = []struct { + tests := []struct { givenTestCase string givenPreset db.Preset expectedAudioParams *elastictranscoder.AudioParameters @@ -1056,7 +1056,7 @@ func TestAWSJobStatusInternalError(t *testing.T) { } func TestAWSStatusMap(t *testing.T) { - var tests = []struct { + tests := []struct { input string output provider.Status }{ diff --git a/provider/elementalconductor/elementalconductor.go b/provider/elementalconductor/elementalconductor.go index a64d7a95..b7d39bce 100644 --- a/provider/elementalconductor/elementalconductor.go +++ b/provider/elementalconductor/elementalconductor.go @@ -5,15 +5,15 @@ // 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/elementalconductor" +// "github.com/video-dev/video-transcoding-api/v2/provider" +// "github.com/video-dev/video-transcoding-api/v2/provider/elementalconductor" // ) // // func UseProvider() { // factory, err := provider.GetProviderFactory(elementalconductor.Name) // // handle err and use factory to get an instance of the provider. // } -package elementalconductor // import "github.com/NYTimes/video-transcoding-api/provider/elementalconductor" +package elementalconductor import ( "encoding/xml" @@ -24,9 +24,9 @@ import ( "time" "github.com/NYTimes/encoding-wrapper/elementalconductor" - "github.com/NYTimes/video-transcoding-api/config" - "github.com/NYTimes/video-transcoding-api/db" - "github.com/NYTimes/video-transcoding-api/provider" + "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 Elemental Conductor provider in the diff --git a/provider/elementalconductor/elementalconductor_fake_transcode_test.go b/provider/elementalconductor/elementalconductor_fake_transcode_test.go index 0d1ba9f2..7cbff5dd 100644 --- a/provider/elementalconductor/elementalconductor_fake_transcode_test.go +++ b/provider/elementalconductor/elementalconductor_fake_transcode_test.go @@ -4,8 +4,8 @@ import ( "strings" "github.com/NYTimes/encoding-wrapper/elementalconductor" - "github.com/NYTimes/video-transcoding-api/config" - "github.com/NYTimes/video-transcoding-api/provider" + "github.com/video-dev/video-transcoding-api/v2/config" + "github.com/video-dev/video-transcoding-api/v2/provider" ) type fakeElementalConductorClient struct { diff --git a/provider/elementalconductor/elementalconductor_test.go b/provider/elementalconductor/elementalconductor_test.go index 6703f001..51ddfe64 100644 --- a/provider/elementalconductor/elementalconductor_test.go +++ b/provider/elementalconductor/elementalconductor_test.go @@ -7,9 +7,9 @@ import ( "time" "github.com/NYTimes/encoding-wrapper/elementalconductor" - "github.com/NYTimes/video-transcoding-api/config" - "github.com/NYTimes/video-transcoding-api/db" - "github.com/NYTimes/video-transcoding-api/provider" + "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) { @@ -51,7 +51,7 @@ func TestElementalConductorFactory(t *testing.T) { } func TestElementalConductorFactoryValidation(t *testing.T) { - var tests = []struct { + tests := []struct { host string userLogin string apiKey string @@ -647,7 +647,7 @@ func TestElementalNewJobPresetNotFound(t *testing.T) { } func TestJobStatusOutputDestination(t *testing.T) { - var tests = []struct { + tests := []struct { job db.Job destinationCfg string expected string @@ -695,7 +695,7 @@ func TestJobStatusOutputDestination(t *testing.T) { } func TestJobStatusMap(t *testing.T) { - var tests = []struct { + tests := []struct { elementalConductorStatus string expected provider.Status }{ @@ -1102,7 +1102,7 @@ func TestHealthcheck(t *testing.T) { prov := elementalConductorProvider{ client: elementalconductor.NewClient(server.URL, "", "", 0, "", "", ""), } - var tests = []struct { + tests := []struct { minNodes int nodes []elementalconductor.Node expectedMsg string diff --git a/provider/encodingcom/encodingcom.go b/provider/encodingcom/encodingcom.go index db9e2475..96e673ed 100644 --- a/provider/encodingcom/encodingcom.go +++ b/provider/encodingcom/encodingcom.go @@ -5,15 +5,15 @@ // 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/encodingcom" +// "github.com/video-dev/video-transcoding-api/v2/provider" +// "github.com/video-dev/video-transcoding-api/v2/provider/encodingcom" // ) // // func UseProvider() { // factory, err := provider.GetProviderFactory(encodingcom.Name) // // handle err and use factory to get an instance of the provider. // } -package encodingcom // import "github.com/NYTimes/video-transcoding-api/provider/encodingcom" +package encodingcom import ( "errors" @@ -25,9 +25,9 @@ import ( "strings" "github.com/NYTimes/encoding-wrapper/encodingcom" - "github.com/NYTimes/video-transcoding-api/config" - "github.com/NYTimes/video-transcoding-api/db" - "github.com/NYTimes/video-transcoding-api/provider" + "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 Encoding.com provider in the diff --git a/provider/encodingcom/encodingcom_test.go b/provider/encodingcom/encodingcom_test.go index 7d9e59f2..249ba9cf 100644 --- a/provider/encodingcom/encodingcom_test.go +++ b/provider/encodingcom/encodingcom_test.go @@ -7,10 +7,10 @@ import ( "time" "github.com/NYTimes/encoding-wrapper/encodingcom" - "github.com/NYTimes/video-transcoding-api/config" - "github.com/NYTimes/video-transcoding-api/db" - "github.com/NYTimes/video-transcoding-api/provider" "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/provider" ) func TestFactoryIsRegistered(t *testing.T) { @@ -49,7 +49,7 @@ func TestEncodingComFactory(t *testing.T) { } func TestEncodingComFactoryValidation(t *testing.T) { - var tests = []struct { + tests := []struct { userID string userKey string }{ @@ -276,7 +276,6 @@ func TestEncodingComTranscode(t *testing.T) { if !reflect.DeepEqual([]string{source}, media.Request.Source) { t.Errorf("Wrong source. Want %v. Got %v.", []string{source}, media.Request.Source) } - } func TestEncodingComS3Input(t *testing.T) { @@ -859,7 +858,7 @@ func TestJobStatusInvalidSourceInfo(t *testing.T) { Finished: now.Add(time.Hour), } server.medias["media3"] = &media3 - var tests = []struct { + tests := []struct { testCase string mediaID string errMsg string @@ -925,7 +924,7 @@ func TestJobStatusMediaNotFound(t *testing.T) { } func TestJobStatusMap(t *testing.T) { - var tests = []struct { + tests := []struct { encodingComStatus string expected provider.Status }{ @@ -1110,7 +1109,7 @@ func TestCreatePresetTwoPass(t *testing.T) { func TestPresetToFormat(t *testing.T) { falseYesNoBoolean := encodingcom.YesNoBoolean(false) - var tests = []struct { + tests := []struct { givenTestCase string givenPreset db.Preset expectedFormat encodingcom.Format @@ -1379,7 +1378,7 @@ func TestHealthcheck(t *testing.T) { EncodingCom: &config.EncodingCom{StatusEndpoint: server.URL}, }, } - var tests = []struct { + tests := []struct { apiStatus encodingcom.APIStatusResponse expectedMsg string }{ diff --git a/provider/fake_provider_test.go b/provider/fake_provider_test.go index fb6cfa34..92930a5f 100644 --- a/provider/fake_provider_test.go +++ b/provider/fake_provider_test.go @@ -1,8 +1,8 @@ package provider import ( - "github.com/NYTimes/video-transcoding-api/config" - "github.com/NYTimes/video-transcoding-api/db" + "github.com/video-dev/video-transcoding-api/v2/config" + "github.com/video-dev/video-transcoding-api/v2/db" ) type fakeProvider struct { diff --git a/provider/hybrik/hybrik.go b/provider/hybrik/hybrik.go index d630a2c3..7d0455bd 100644 --- a/provider/hybrik/hybrik.go +++ b/provider/hybrik/hybrik.go @@ -1,4 +1,4 @@ -package hybrik // import "github.com/NYTimes/video-transcoding-api/provider/hybrik" +package hybrik import ( "encoding/json" @@ -8,10 +8,10 @@ import ( "strconv" "strings" - "github.com/NYTimes/video-transcoding-api/config" - "github.com/NYTimes/video-transcoding-api/db" - "github.com/NYTimes/video-transcoding-api/provider" hwrapper "github.com/hybrik/hybrik-sdk-go" + "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 ( diff --git a/provider/mediaconvert/factory_test.go b/provider/mediaconvert/factory_test.go index fced110b..ed2f4974 100644 --- a/provider/mediaconvert/factory_test.go +++ b/provider/mediaconvert/factory_test.go @@ -5,11 +5,11 @@ import ( "reflect" "testing" - "github.com/NYTimes/video-transcoding-api/config" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/aws/external" "github.com/aws/aws-sdk-go-v2/service/mediaconvert" "github.com/google/go-cmp/cmp" + "github.com/video-dev/video-transcoding-api/v2/config" ) var cfgWithoutCredsAndRegion = config.Config{ diff --git a/provider/mediaconvert/fake_client_test.go b/provider/mediaconvert/fake_client_test.go index 9c44cca1..2ca8b26b 100644 --- a/provider/mediaconvert/fake_client_test.go +++ b/provider/mediaconvert/fake_client_test.go @@ -30,15 +30,17 @@ type testMediaConvertClient struct { func (c *testMediaConvertClient) CreatePresetRequest(input *mediaconvert.CreatePresetInput) mediaconvert.CreatePresetRequest { c.createPresetCalledWith = input return mediaconvert.CreatePresetRequest{ - Request: &aws.Request{HTTPRequest: &http.Request{}, Data: &mediaconvert.CreatePresetOutput{ - Preset: &mediaconvert.Preset{ - Name: input.Name, - Settings: &mediaconvert.PresetSettings{ - ContainerSettings: &mediaconvert.ContainerSettings{ - Container: input.Settings.ContainerSettings.Container, + Request: &aws.Request{ + HTTPRequest: &http.Request{}, Data: &mediaconvert.CreatePresetOutput{ + Preset: &mediaconvert.Preset{ + Name: input.Name, + Settings: &mediaconvert.PresetSettings{ + ContainerSettings: &mediaconvert.ContainerSettings{ + Container: input.Settings.ContainerSettings.Container, + }, }, }, - }}, + }, }, } } @@ -85,15 +87,17 @@ func (c *testMediaConvertClient) GetPresetRequest(input *mediaconvert.GetPresetI atomic.StorePointer((*unsafe.Pointer)(unsafe.Pointer(&c.getPresetCalledWith)), unsafe.Pointer(input.Name)) return mediaconvert.GetPresetRequest{ - Request: &aws.Request{HTTPRequest: &http.Request{}, Data: &mediaconvert.GetPresetOutput{ - Preset: &mediaconvert.Preset{ - Name: input.Name, - Settings: &mediaconvert.PresetSettings{ - ContainerSettings: &mediaconvert.ContainerSettings{ - Container: c.getPresetContainerType, + Request: &aws.Request{ + HTTPRequest: &http.Request{}, Data: &mediaconvert.GetPresetOutput{ + Preset: &mediaconvert.Preset{ + Name: input.Name, + Settings: &mediaconvert.PresetSettings{ + ContainerSettings: &mediaconvert.ContainerSettings{ + Container: c.getPresetContainerType, + }, }, }, - }}, + }, }, } } diff --git a/provider/mediaconvert/mediaconvert.go b/provider/mediaconvert/mediaconvert.go index b142a934..c3663efb 100644 --- a/provider/mediaconvert/mediaconvert.go +++ b/provider/mediaconvert/mediaconvert.go @@ -7,13 +7,13 @@ import ( "strings" "sync" - "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-v2/aws" "github.com/aws/aws-sdk-go-v2/aws/external" "github.com/aws/aws-sdk-go-v2/service/mediaconvert" "github.com/pkg/errors" + "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 ( diff --git a/provider/mediaconvert/mediaconvert_test.go b/provider/mediaconvert/mediaconvert_test.go index 15fd32f9..65523d16 100644 --- a/provider/mediaconvert/mediaconvert_test.go +++ b/provider/mediaconvert/mediaconvert_test.go @@ -4,12 +4,12 @@ import ( "reflect" "testing" - "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-v2/aws" "github.com/aws/aws-sdk-go-v2/service/mediaconvert" "github.com/google/go-cmp/cmp" + "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" ) var ( diff --git a/provider/mediaconvert/preset_mapping.go b/provider/mediaconvert/preset_mapping.go index 3b55df04..dfcd1da3 100644 --- a/provider/mediaconvert/preset_mapping.go +++ b/provider/mediaconvert/preset_mapping.go @@ -5,11 +5,11 @@ import ( "strconv" "strings" - "github.com/NYTimes/video-transcoding-api/db" - "github.com/NYTimes/video-transcoding-api/provider" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/mediaconvert" "github.com/pkg/errors" + "github.com/video-dev/video-transcoding-api/v2/db" + "github.com/video-dev/video-transcoding-api/v2/provider" ) func providerStatusFrom(status mediaconvert.JobStatus) provider.Status { diff --git a/provider/provider.go b/provider/provider.go index 2a1a6566..096455c0 100644 --- a/provider/provider.go +++ b/provider/provider.go @@ -1,4 +1,4 @@ -package provider // import "github.com/NYTimes/video-transcoding-api/provider" +package provider import ( "errors" @@ -6,8 +6,8 @@ import ( "sort" "time" - "github.com/NYTimes/video-transcoding-api/config" - "github.com/NYTimes/video-transcoding-api/db" + "github.com/video-dev/video-transcoding-api/v2/config" + "github.com/video-dev/video-transcoding-api/v2/db" ) var ( diff --git a/provider/provider_test.go b/provider/provider_test.go index c7245557..c89218f2 100644 --- a/provider/provider_test.go +++ b/provider/provider_test.go @@ -5,7 +5,7 @@ import ( "reflect" "testing" - "github.com/NYTimes/video-transcoding-api/config" + "github.com/video-dev/video-transcoding-api/v2/config" ) func noopFactory(*config.Config) (TranscodingProvider, error) { @@ -121,7 +121,7 @@ func TestDescribeProvider(t *testing.T) { "factory-err": getFactory(errors.New("invalid config"), nil, cap), "cap-and-healthy": getFactory(nil, nil, cap), } - var tests = []struct { + tests := []struct { input string expected Description }{ diff --git a/provider/zencoder/zencoder.go b/provider/zencoder/zencoder.go index 5064aef2..0d5cb095 100644 --- a/provider/zencoder/zencoder.go +++ b/provider/zencoder/zencoder.go @@ -5,15 +5,15 @@ // 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/zencoder" +// "github.com/video-dev/video-transcoding-api/v2/provider" +// "github.com/video-dev/video-transcoding-api/v2/provider/zencoder" // ) // // func UseProvider() { // factory, err := provider.GetProviderFactory(Zencoder.Name) // // handle err and use factory to get an instance of the provider. // } -package zencoder // import "github.com/NYTimes/video-transcoding-api/provider/zencoder" +package zencoder import ( "fmt" @@ -25,11 +25,11 @@ import ( "strings" "time" - "github.com/NYTimes/video-transcoding-api/config" - "github.com/NYTimes/video-transcoding-api/db" - "github.com/NYTimes/video-transcoding-api/db/redis" - "github.com/NYTimes/video-transcoding-api/provider" "github.com/flavioribeiro/zencoder" + "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" + "github.com/video-dev/video-transcoding-api/v2/provider" ) // Name is the name used for registering the Zencoder provider in the @@ -319,7 +319,7 @@ func (z *zencoderProvider) statusMap(zencoderState zencoder.JobState) provider.S } func (z *zencoderProvider) S3Url(input string) string { - var httpS3Regexp = regexp.MustCompile(`https?://([^/_.]+)\.s3\.amazonaws\.com/(.+)$`) + httpS3Regexp := regexp.MustCompile(`https?://([^/_.]+)\.s3\.amazonaws\.com/(.+)$`) parts := httpS3Regexp.FindStringSubmatch(input) return fmt.Sprintf("s3://%s/%s", parts[1], parts[2]) } diff --git a/provider/zencoder/zencoder_test.go b/provider/zencoder/zencoder_test.go index f2a0f0d7..71892fe9 100644 --- a/provider/zencoder/zencoder_test.go +++ b/provider/zencoder/zencoder_test.go @@ -6,12 +6,12 @@ import ( "reflect" "testing" - "github.com/NYTimes/video-transcoding-api/config" - "github.com/NYTimes/video-transcoding-api/db" - "github.com/NYTimes/video-transcoding-api/db/dbtest" - "github.com/NYTimes/video-transcoding-api/provider" "github.com/flavioribeiro/zencoder" "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/dbtest" + "github.com/video-dev/video-transcoding-api/v2/provider" ) func TestFactoryIsRegistered(t *testing.T) { @@ -258,7 +258,7 @@ func TestZencoderBuildOutputs(t *testing.T) { db: dbRepo, } - var tests = []struct { + tests := []struct { Description string Job *db.Job Presets []db.Preset @@ -266,7 +266,8 @@ func TestZencoderBuildOutputs(t *testing.T) { }{ { "Test with a single mp4 preset", - &db.Job{ID: "1234567890", + &db.Job{ + ID: "1234567890", SourceMedia: "http://nyt-bucket/source_here.mov", Outputs: []db.TranscodeOutput{ { @@ -429,7 +430,8 @@ func TestZencoderBuildOutputs(t *testing.T) { }, { "Test with a mix of HLS and MP4 outputs", - &db.Job{ID: "1234567890", + &db.Job{ + ID: "1234567890", SourceMedia: "http://nyt-bucket/source_here.mov", Outputs: []db.TranscodeOutput{ { @@ -558,7 +560,7 @@ func TestZencoderBuildOutputs(t *testing.T) { func TestZencoderBuildOutput(t *testing.T) { prov := &zencoderProvider{} - var tests = []struct { + tests := []struct { Description string OutputFileName string Destination string @@ -796,7 +798,7 @@ func TestZencoderJobStatus(t *testing.T) { client: fakeZencoder, db: dbRepo, } - var tests = []struct { + tests := []struct { ProviderJobID string Expected map[string]interface{} }{ @@ -962,7 +964,7 @@ func TestZencoderStatusMap(t *testing.T) { client: fakeZencoder, db: dbRepo, } - var tests = []struct { + tests := []struct { Input zencoder.JobState Expected provider.Status }{ @@ -980,6 +982,7 @@ func TestZencoderStatusMap(t *testing.T) { } } } + func TestZencoderGetResolution(t *testing.T) { cfg := config.Config{ Zencoder: &config.Zencoder{APIKey: "api-key-here"}, @@ -992,7 +995,7 @@ func TestZencoderGetResolution(t *testing.T) { db: dbRepo, } - var tests = []struct { + tests := []struct { preset db.Preset width int32 height int32 diff --git a/service/fake_provider_test.go b/service/fake_provider_test.go index aa4d7b59..abd3e472 100644 --- a/service/fake_provider_test.go +++ b/service/fake_provider_test.go @@ -1,9 +1,9 @@ package service import ( - "github.com/NYTimes/video-transcoding-api/config" - "github.com/NYTimes/video-transcoding-api/db" - "github.com/NYTimes/video-transcoding-api/provider" + "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 init() { diff --git a/service/preset.go b/service/preset.go index e27d3cd9..2d9cb779 100644 --- a/service/preset.go +++ b/service/preset.go @@ -7,9 +7,9 @@ import ( "net/http" "github.com/NYTimes/gizmo/server" - "github.com/NYTimes/video-transcoding-api/db" - "github.com/NYTimes/video-transcoding-api/provider" - "github.com/NYTimes/video-transcoding-api/swagger" + "github.com/video-dev/video-transcoding-api/v2/db" + "github.com/video-dev/video-transcoding-api/v2/provider" + "github.com/video-dev/video-transcoding-api/v2/swagger" ) // swagger:route DELETE /presets/{name} presets deletePreset diff --git a/service/preset_params.go b/service/preset_params.go index 7df8594a..ce12794a 100644 --- a/service/preset_params.go +++ b/service/preset_params.go @@ -1,7 +1,7 @@ package service import ( - "github.com/NYTimes/video-transcoding-api/db" + "github.com/video-dev/video-transcoding-api/v2/db" ) type newPresetInput struct { diff --git a/service/preset_responses.go b/service/preset_responses.go index 8e778156..569579c5 100644 --- a/service/preset_responses.go +++ b/service/preset_responses.go @@ -3,7 +3,7 @@ package service import ( "net/http" - "github.com/NYTimes/video-transcoding-api/swagger" + "github.com/video-dev/video-transcoding-api/v2/swagger" ) type newPresetResponse struct { diff --git a/service/preset_test.go b/service/preset_test.go index ff3858ce..a007db5e 100644 --- a/service/preset_test.go +++ b/service/preset_test.go @@ -9,10 +9,10 @@ import ( "testing" "github.com/NYTimes/gizmo/server" - "github.com/NYTimes/video-transcoding-api/config" - "github.com/NYTimes/video-transcoding-api/db" - "github.com/NYTimes/video-transcoding-api/db/dbtest" "github.com/sirupsen/logrus" + "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/dbtest" ) func TestNewPreset(t *testing.T) { diff --git a/service/presetmap.go b/service/presetmap.go index 88429ced..ff81fa90 100644 --- a/service/presetmap.go +++ b/service/presetmap.go @@ -4,8 +4,8 @@ import ( "net/http" "github.com/NYTimes/gizmo/server" - "github.com/NYTimes/video-transcoding-api/db" - "github.com/NYTimes/video-transcoding-api/swagger" + "github.com/video-dev/video-transcoding-api/v2/db" + "github.com/video-dev/video-transcoding-api/v2/swagger" ) // swagger:route POST /presetmaps presets newPreset diff --git a/service/presetmap_params.go b/service/presetmap_params.go index a40a7b07..0fbba3b2 100644 --- a/service/presetmap_params.go +++ b/service/presetmap_params.go @@ -7,8 +7,8 @@ import ( "io" "net/http" - "github.com/NYTimes/video-transcoding-api/db" - "github.com/NYTimes/video-transcoding-api/swagger" + "github.com/video-dev/video-transcoding-api/v2/db" + "github.com/video-dev/video-transcoding-api/v2/swagger" ) // JSON-encoded preset returned on the newPreset and getPreset operations. diff --git a/service/presetmap_test.go b/service/presetmap_test.go index f9b67171..4bf00e2b 100644 --- a/service/presetmap_test.go +++ b/service/presetmap_test.go @@ -9,10 +9,10 @@ import ( "testing" "github.com/NYTimes/gizmo/server" - "github.com/NYTimes/video-transcoding-api/config" - "github.com/NYTimes/video-transcoding-api/db" - "github.com/NYTimes/video-transcoding-api/db/dbtest" "github.com/sirupsen/logrus" + "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/dbtest" ) func TestNewPresetMap(t *testing.T) { diff --git a/service/provider.go b/service/provider.go index 30f739ca..55ba56e4 100644 --- a/service/provider.go +++ b/service/provider.go @@ -4,8 +4,8 @@ import ( "net/http" "github.com/NYTimes/gizmo/server" - "github.com/NYTimes/video-transcoding-api/provider" - "github.com/NYTimes/video-transcoding-api/swagger" + "github.com/video-dev/video-transcoding-api/v2/provider" + "github.com/video-dev/video-transcoding-api/v2/swagger" ) // swagger:route GET /providers providers listProviders diff --git a/service/provider_responses.go b/service/provider_responses.go index 2c8d7c87..94e8dd9e 100644 --- a/service/provider_responses.go +++ b/service/provider_responses.go @@ -3,8 +3,8 @@ package service import ( "net/http" - "github.com/NYTimes/video-transcoding-api/provider" - "github.com/NYTimes/video-transcoding-api/swagger" + "github.com/video-dev/video-transcoding-api/v2/provider" + "github.com/video-dev/video-transcoding-api/v2/swagger" ) // response for the listProviders operation. Contains the list of providers diff --git a/service/provider_test.go b/service/provider_test.go index c7605cd8..f93ffd90 100644 --- a/service/provider_test.go +++ b/service/provider_test.go @@ -8,8 +8,8 @@ import ( "testing" "github.com/NYTimes/gizmo/server" - "github.com/NYTimes/video-transcoding-api/config" "github.com/sirupsen/logrus" + "github.com/video-dev/video-transcoding-api/v2/config" ) func TestListProviders(t *testing.T) { @@ -37,7 +37,7 @@ func TestListProviders(t *testing.T) { } func TestGetProvider(t *testing.T) { - var tests = []struct { + tests := []struct { testCase string name string diff --git a/service/service.go b/service/service.go index fcc851f4..4e53a3fa 100644 --- a/service/service.go +++ b/service/service.go @@ -1,4 +1,4 @@ -package service // import "github.com/NYTimes/video-transcoding-api/service" +package service import ( "fmt" @@ -6,13 +6,13 @@ import ( "github.com/NYTimes/gizmo/server" "github.com/NYTimes/gziphandler" - "github.com/NYTimes/video-transcoding-api/config" - "github.com/NYTimes/video-transcoding-api/db" - "github.com/NYTimes/video-transcoding-api/db/redis" - "github.com/NYTimes/video-transcoding-api/swagger" "github.com/fsouza/ctxlogger" "github.com/gorilla/handlers" "github.com/sirupsen/logrus" + "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" + "github.com/video-dev/video-transcoding-api/v2/swagger" ) // TranscodingService will implement server.JSONService and handle all requests diff --git a/service/swagger_test.go b/service/swagger_test.go index 4e8b96bb..99271904 100644 --- a/service/swagger_test.go +++ b/service/swagger_test.go @@ -7,8 +7,8 @@ import ( "testing" "github.com/NYTimes/gizmo/server" - "github.com/NYTimes/video-transcoding-api/config" "github.com/sirupsen/logrus" + "github.com/video-dev/video-transcoding-api/v2/config" ) func TestSwaggerManifest(t *testing.T) { diff --git a/service/transcode.go b/service/transcode.go index 7a4acdd8..f9c30b6e 100644 --- a/service/transcode.go +++ b/service/transcode.go @@ -9,9 +9,9 @@ import ( "path/filepath" "github.com/NYTimes/gizmo/server" - "github.com/NYTimes/video-transcoding-api/db" - "github.com/NYTimes/video-transcoding-api/provider" - "github.com/NYTimes/video-transcoding-api/swagger" + "github.com/video-dev/video-transcoding-api/v2/db" + "github.com/video-dev/video-transcoding-api/v2/provider" + "github.com/video-dev/video-transcoding-api/v2/swagger" ) // swagger:route POST /jobs jobs newJob diff --git a/service/transcode_params.go b/service/transcode_params.go index 23ea755a..c3187b7f 100644 --- a/service/transcode_params.go +++ b/service/transcode_params.go @@ -5,8 +5,8 @@ import ( "errors" "io" - "github.com/NYTimes/video-transcoding-api/db" - "github.com/NYTimes/video-transcoding-api/provider" + "github.com/video-dev/video-transcoding-api/v2/db" + "github.com/video-dev/video-transcoding-api/v2/provider" ) // NewTranscodeJobInputPayload makes up the parameters available for diff --git a/service/transcode_responses.go b/service/transcode_responses.go index 6f55a993..29f6b21f 100644 --- a/service/transcode_responses.go +++ b/service/transcode_responses.go @@ -3,8 +3,8 @@ package service import ( "net/http" - "github.com/NYTimes/video-transcoding-api/provider" - "github.com/NYTimes/video-transcoding-api/swagger" + "github.com/video-dev/video-transcoding-api/v2/provider" + "github.com/video-dev/video-transcoding-api/v2/swagger" ) // PartialJob is the simple response given to an API diff --git a/service/transcode_test.go b/service/transcode_test.go index f7d2582e..4dd00e32 100644 --- a/service/transcode_test.go +++ b/service/transcode_test.go @@ -10,11 +10,11 @@ import ( "testing" "github.com/NYTimes/gizmo/server" - "github.com/NYTimes/video-transcoding-api/config" - "github.com/NYTimes/video-transcoding-api/db" - "github.com/NYTimes/video-transcoding-api/db/dbtest" - "github.com/NYTimes/video-transcoding-api/provider" "github.com/sirupsen/logrus" + "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/dbtest" + "github.com/video-dev/video-transcoding-api/v2/provider" ) func TestTranscode(t *testing.T) { @@ -355,7 +355,7 @@ func TestGetTranscodeJob(t *testing.T) { } func TestCancelTranscodeJob(t *testing.T) { - var tests = []struct { + tests := []struct { givenTestCase string givenJobID string givenTriggerDBError bool diff --git a/swagger/handler.go b/swagger/handler.go index e1ebcf12..6eca83d7 100644 --- a/swagger/handler.go +++ b/swagger/handler.go @@ -1,4 +1,4 @@ -package swagger // import "github.com/NYTimes/video-transcoding-api/swagger" +package swagger import ( "net/http"