diff --git a/cmd/tusd/cli/composer.go b/cmd/tusd/cli/composer.go index 36a5fe7..bad691b 100644 --- a/cmd/tusd/cli/composer.go +++ b/cmd/tusd/cli/composer.go @@ -6,12 +6,12 @@ import ( "path/filepath" "strings" - "github.com/tus/tusd/pkg/azurestore" - "github.com/tus/tusd/pkg/filestore" - "github.com/tus/tusd/pkg/gcsstore" - "github.com/tus/tusd/pkg/handler" - "github.com/tus/tusd/pkg/memorylocker" - "github.com/tus/tusd/pkg/s3store" + "github.com/tus/tusd/v2/pkg/azurestore" + "github.com/tus/tusd/v2/pkg/filestore" + "github.com/tus/tusd/v2/pkg/gcsstore" + "github.com/tus/tusd/v2/pkg/handler" + "github.com/tus/tusd/v2/pkg/memorylocker" + "github.com/tus/tusd/v2/pkg/s3store" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" diff --git a/cmd/tusd/cli/flags.go b/cmd/tusd/cli/flags.go index 0d16c0a..e9fd0ba 100644 --- a/cmd/tusd/cli/flags.go +++ b/cmd/tusd/cli/flags.go @@ -5,7 +5,7 @@ import ( "path/filepath" "strings" - "github.com/tus/tusd/cmd/tusd/cli/hooks" + "github.com/tus/tusd/v2/cmd/tusd/cli/hooks" ) var Flags struct { diff --git a/cmd/tusd/cli/hooks.go b/cmd/tusd/cli/hooks.go index 135ceaa..433234c 100644 --- a/cmd/tusd/cli/hooks.go +++ b/cmd/tusd/cli/hooks.go @@ -4,8 +4,8 @@ import ( "strconv" "strings" - "github.com/tus/tusd/cmd/tusd/cli/hooks" - "github.com/tus/tusd/pkg/handler" + "github.com/tus/tusd/v2/cmd/tusd/cli/hooks" + "github.com/tus/tusd/v2/pkg/handler" ) var hookHandler hooks.HookHandler = nil diff --git a/cmd/tusd/cli/hooks/grpc.go b/cmd/tusd/cli/hooks/grpc.go index b69fe78..3c56b84 100644 --- a/cmd/tusd/cli/hooks/grpc.go +++ b/cmd/tusd/cli/hooks/grpc.go @@ -6,7 +6,7 @@ import ( "time" grpc_retry "github.com/grpc-ecosystem/go-grpc-middleware/retry" - pb "github.com/tus/tusd/pkg/proto/v2" + pb "github.com/tus/tusd/v2/pkg/proto/v2" "google.golang.org/grpc" ) diff --git a/cmd/tusd/cli/hooks/hooks.go b/cmd/tusd/cli/hooks/hooks.go index 90c669a..bbd3583 100644 --- a/cmd/tusd/cli/hooks/hooks.go +++ b/cmd/tusd/cli/hooks/hooks.go @@ -3,7 +3,7 @@ package hooks // TODO: Move hooks into a package in /pkg import ( - "github.com/tus/tusd/pkg/handler" + "github.com/tus/tusd/v2/pkg/handler" ) // HookHandler is the main inferface to be implemented by all hook backends. diff --git a/cmd/tusd/cli/log.go b/cmd/tusd/cli/log.go index 254a3b4..0f451e1 100644 --- a/cmd/tusd/cli/log.go +++ b/cmd/tusd/cli/log.go @@ -4,7 +4,7 @@ import ( "log" "os" - "github.com/tus/tusd/pkg/handler" + "github.com/tus/tusd/v2/pkg/handler" ) var stdout = log.New(os.Stdout, "[tusd] ", log.LstdFlags|log.Lmicroseconds) diff --git a/cmd/tusd/cli/metrics.go b/cmd/tusd/cli/metrics.go index 2052c18..9fcb565 100644 --- a/cmd/tusd/cli/metrics.go +++ b/cmd/tusd/cli/metrics.go @@ -3,8 +3,8 @@ package cli import ( "net/http" - "github.com/tus/tusd/pkg/handler" - "github.com/tus/tusd/pkg/prometheuscollector" + "github.com/tus/tusd/v2/pkg/handler" + "github.com/tus/tusd/v2/pkg/prometheuscollector" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" diff --git a/cmd/tusd/cli/serve.go b/cmd/tusd/cli/serve.go index e04469e..ab6a74b 100644 --- a/cmd/tusd/cli/serve.go +++ b/cmd/tusd/cli/serve.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/tus/tusd/pkg/handler" + "github.com/tus/tusd/v2/pkg/handler" ) const ( diff --git a/cmd/tusd/main.go b/cmd/tusd/main.go index 3e33c2a..ff418cd 100644 --- a/cmd/tusd/main.go +++ b/cmd/tusd/main.go @@ -1,7 +1,7 @@ package main import ( - "github.com/tus/tusd/cmd/tusd/cli" + "github.com/tus/tusd/v2/cmd/tusd/cli" ) func main() { diff --git a/docs/usage-package.md b/docs/usage-package.md index 4f6e753..135035d 100644 --- a/docs/usage-package.md +++ b/docs/usage-package.md @@ -9,8 +9,8 @@ import ( "fmt" "net/http" - "github.com/tus/tusd/pkg/filestore" - tusd "github.com/tus/tusd/pkg/handler" + "github.com/tus/tusd/v2/pkg/filestore" + tusd "github.com/tus/tusd/v2/pkg/handler" ) func main() { diff --git a/examples/hooks/plugin/hook_handler.go b/examples/hooks/plugin/hook_handler.go index 38a3a6b..2c11060 100644 --- a/examples/hooks/plugin/hook_handler.go +++ b/examples/hooks/plugin/hook_handler.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/go-hclog" "github.com/hashicorp/go-plugin" - "github.com/tus/tusd/cmd/tusd/cli/hooks" + "github.com/tus/tusd/v2/cmd/tusd/cli/hooks" ) // Here is the implementation of our hook handler diff --git a/examples/server/main.go b/examples/server/main.go index f10e446..203ada2 100644 --- a/examples/server/main.go +++ b/examples/server/main.go @@ -4,8 +4,8 @@ import ( "fmt" "net/http" - "github.com/tus/tusd/pkg/filestore" - tusd "github.com/tus/tusd/pkg/handler" + "github.com/tus/tusd/v2/pkg/filestore" + tusd "github.com/tus/tusd/v2/pkg/handler" ) func main() { diff --git a/go.mod b/go.mod index 0204e7f..5672055 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/tus/tusd +module github.com/tus/tusd/v2 // Specify the Go version needed for the Heroku deployment // See https://github.com/heroku/heroku-buildpack-go#go-module-specifics diff --git a/pkg/azurestore/azureservice.go b/pkg/azurestore/azureservice.go index d8210dc..e2b6bd3 100644 --- a/pkg/azurestore/azureservice.go +++ b/pkg/azurestore/azureservice.go @@ -25,7 +25,7 @@ import ( "strings" "github.com/Azure/azure-storage-blob-go/azblob" - "github.com/tus/tusd/pkg/handler" + "github.com/tus/tusd/v2/pkg/handler" ) const ( diff --git a/pkg/azurestore/azurestore.go b/pkg/azurestore/azurestore.go index 9fb6d40..1a7051b 100644 --- a/pkg/azurestore/azurestore.go +++ b/pkg/azurestore/azurestore.go @@ -10,8 +10,8 @@ import ( "io" "strings" - "github.com/tus/tusd/internal/uid" - "github.com/tus/tusd/pkg/handler" + "github.com/tus/tusd/v2/internal/uid" + "github.com/tus/tusd/v2/pkg/handler" ) type AzureStore struct { diff --git a/pkg/azurestore/azurestore_mock_test.go b/pkg/azurestore/azurestore_mock_test.go index 8d11838..6d46b19 100644 --- a/pkg/azurestore/azurestore_mock_test.go +++ b/pkg/azurestore/azurestore_mock_test.go @@ -10,7 +10,7 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" - azurestore "github.com/tus/tusd/pkg/azurestore" + azurestore "github.com/tus/tusd/v2/pkg/azurestore" ) // MockAzService is a mock of AzService interface. diff --git a/pkg/azurestore/azurestore_test.go b/pkg/azurestore/azurestore_test.go index 5bbe15a..e91dd33 100644 --- a/pkg/azurestore/azurestore_test.go +++ b/pkg/azurestore/azurestore_test.go @@ -11,8 +11,8 @@ import ( "github.com/Azure/azure-storage-blob-go/azblob" "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" - "github.com/tus/tusd/pkg/azurestore" - "github.com/tus/tusd/pkg/handler" + "github.com/tus/tusd/v2/pkg/azurestore" + "github.com/tus/tusd/v2/pkg/handler" ) //go:generate mockgen -destination=./azurestore_mock_test.go -package=azurestore_test github.com/tus/tusd/pkg/azurestore AzService,AzBlob diff --git a/pkg/filelocker/filelocker.go b/pkg/filelocker/filelocker.go index d6b8171..c9f221a 100644 --- a/pkg/filelocker/filelocker.go +++ b/pkg/filelocker/filelocker.go @@ -13,7 +13,7 @@ import ( "os" "path/filepath" - "github.com/tus/tusd/pkg/handler" + "github.com/tus/tusd/v2/pkg/handler" "gopkg.in/Acconut/lockfile.v1" ) diff --git a/pkg/filelocker/filelocker_test.go b/pkg/filelocker/filelocker_test.go index ac79c37..c293553 100644 --- a/pkg/filelocker/filelocker_test.go +++ b/pkg/filelocker/filelocker_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/tus/tusd/pkg/handler" + "github.com/tus/tusd/v2/pkg/handler" ) var _ handler.Locker = &FileLocker{} diff --git a/pkg/filestore/filestore.go b/pkg/filestore/filestore.go index ad3d034..601e83c 100644 --- a/pkg/filestore/filestore.go +++ b/pkg/filestore/filestore.go @@ -17,8 +17,8 @@ import ( "os" "path/filepath" - "github.com/tus/tusd/internal/uid" - "github.com/tus/tusd/pkg/handler" + "github.com/tus/tusd/v2/internal/uid" + "github.com/tus/tusd/v2/pkg/handler" ) var defaultFilePerm = os.FileMode(0664) @@ -49,7 +49,7 @@ func (store FileStore) UseIn(composer *handler.StoreComposer) { } func (store FileStore) NewUpload(ctx context.Context, info handler.FileInfo) (handler.Upload, error) { - if info.ID == "" { + if info.ID == "" { info.ID = uid.Uid() } binPath := store.binPath(info.ID) diff --git a/pkg/filestore/filestore_test.go b/pkg/filestore/filestore_test.go index 3b871dd..42a2b3c 100644 --- a/pkg/filestore/filestore_test.go +++ b/pkg/filestore/filestore_test.go @@ -9,7 +9,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/tus/tusd/pkg/handler" + "github.com/tus/tusd/v2/pkg/handler" ) // Test interface implementation of Filestore diff --git a/pkg/gcsstore/gcsservice_test.go b/pkg/gcsstore/gcsservice_test.go index 2fe2171..1ae0982 100644 --- a/pkg/gcsstore/gcsservice_test.go +++ b/pkg/gcsstore/gcsservice_test.go @@ -9,7 +9,7 @@ import ( "gopkg.in/h2non/gock.v1" "cloud.google.com/go/storage" - . "github.com/tus/tusd/pkg/gcsstore" + . "github.com/tus/tusd/v2/pkg/gcsstore" "google.golang.org/api/option" ) diff --git a/pkg/gcsstore/gcsstore.go b/pkg/gcsstore/gcsstore.go index 421bd4e..835fd63 100644 --- a/pkg/gcsstore/gcsstore.go +++ b/pkg/gcsstore/gcsstore.go @@ -22,8 +22,8 @@ import ( "sync/atomic" "cloud.google.com/go/storage" - "github.com/tus/tusd/internal/uid" - "github.com/tus/tusd/pkg/handler" + "github.com/tus/tusd/v2/internal/uid" + "github.com/tus/tusd/v2/pkg/handler" ) // See the handler.DataStore interface for documentation about the different diff --git a/pkg/gcsstore/gcsstore_mock_test.go b/pkg/gcsstore/gcsstore_mock_test.go index 8ccecdd..f9900e2 100644 --- a/pkg/gcsstore/gcsstore_mock_test.go +++ b/pkg/gcsstore/gcsstore_mock_test.go @@ -10,7 +10,7 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" - gcsstore "github.com/tus/tusd/pkg/gcsstore" + gcsstore "github.com/tus/tusd/v2/pkg/gcsstore" ) // MockGCSReader is a mock of GCSReader interface. diff --git a/pkg/gcsstore/gcsstore_test.go b/pkg/gcsstore/gcsstore_test.go index 29e325e..e7cc781 100644 --- a/pkg/gcsstore/gcsstore_test.go +++ b/pkg/gcsstore/gcsstore_test.go @@ -11,8 +11,8 @@ import ( "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" - "github.com/tus/tusd/pkg/gcsstore" - "github.com/tus/tusd/pkg/handler" + "github.com/tus/tusd/v2/pkg/gcsstore" + "github.com/tus/tusd/v2/pkg/handler" ) //go:generate mockgen -destination=./gcsstore_mock_test.go -package=gcsstore_test github.com/tus/tusd/pkg/gcsstore GCSReader,GCSAPI diff --git a/pkg/handler/composer_test.go b/pkg/handler/composer_test.go index dd31059..cb2e2de 100644 --- a/pkg/handler/composer_test.go +++ b/pkg/handler/composer_test.go @@ -1,9 +1,9 @@ package handler_test import ( - "github.com/tus/tusd/pkg/filestore" - "github.com/tus/tusd/pkg/handler" - "github.com/tus/tusd/pkg/memorylocker" + "github.com/tus/tusd/v2/pkg/filestore" + "github.com/tus/tusd/v2/pkg/handler" + "github.com/tus/tusd/v2/pkg/memorylocker" ) func ExampleNewStoreComposer() { diff --git a/pkg/handler/concat_test.go b/pkg/handler/concat_test.go index bf846b0..fbc06ad 100644 --- a/pkg/handler/concat_test.go +++ b/pkg/handler/concat_test.go @@ -8,7 +8,7 @@ import ( "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" - . "github.com/tus/tusd/pkg/handler" + . "github.com/tus/tusd/v2/pkg/handler" ) func TestConcat(t *testing.T) { diff --git a/pkg/handler/cors_test.go b/pkg/handler/cors_test.go index e464916..3618e79 100644 --- a/pkg/handler/cors_test.go +++ b/pkg/handler/cors_test.go @@ -5,7 +5,7 @@ import ( "net/http/httptest" "testing" - . "github.com/tus/tusd/pkg/handler" + . "github.com/tus/tusd/v2/pkg/handler" ) func TestCORS(t *testing.T) { diff --git a/pkg/handler/get_test.go b/pkg/handler/get_test.go index eda2d5b..9d88059 100644 --- a/pkg/handler/get_test.go +++ b/pkg/handler/get_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/golang/mock/gomock" - . "github.com/tus/tusd/pkg/handler" + . "github.com/tus/tusd/v2/pkg/handler" ) type closingStringReader struct { diff --git a/pkg/handler/handler_mock_test.go b/pkg/handler/handler_mock_test.go index 58d1a69..5dc492c 100644 --- a/pkg/handler/handler_mock_test.go +++ b/pkg/handler/handler_mock_test.go @@ -10,7 +10,7 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" - handler "github.com/tus/tusd/pkg/handler" + handler "github.com/tus/tusd/v2/pkg/handler" ) // MockFullDataStore is a mock of FullDataStore interface. diff --git a/pkg/handler/head_test.go b/pkg/handler/head_test.go index cab231b..773b38e 100644 --- a/pkg/handler/head_test.go +++ b/pkg/handler/head_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/golang/mock/gomock" - . "github.com/tus/tusd/pkg/handler" + . "github.com/tus/tusd/v2/pkg/handler" ) func TestHead(t *testing.T) { diff --git a/pkg/handler/options_test.go b/pkg/handler/options_test.go index b641b5f..c303478 100644 --- a/pkg/handler/options_test.go +++ b/pkg/handler/options_test.go @@ -4,7 +4,7 @@ import ( "net/http" "testing" - . "github.com/tus/tusd/pkg/handler" + . "github.com/tus/tusd/v2/pkg/handler" ) func TestOptions(t *testing.T) { diff --git a/pkg/handler/patch_test.go b/pkg/handler/patch_test.go index 3758f8a..cf30442 100644 --- a/pkg/handler/patch_test.go +++ b/pkg/handler/patch_test.go @@ -12,7 +12,7 @@ import ( "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" - . "github.com/tus/tusd/pkg/handler" + . "github.com/tus/tusd/v2/pkg/handler" ) func TestPatch(t *testing.T) { diff --git a/pkg/handler/post_test.go b/pkg/handler/post_test.go index 571cf3b..23ddc0c 100644 --- a/pkg/handler/post_test.go +++ b/pkg/handler/post_test.go @@ -9,7 +9,7 @@ import ( "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" - . "github.com/tus/tusd/pkg/handler" + . "github.com/tus/tusd/v2/pkg/handler" ) func TestPost(t *testing.T) { diff --git a/pkg/handler/subtest_test.go b/pkg/handler/subtest_test.go index 6d064ce..dcf431a 100644 --- a/pkg/handler/subtest_test.go +++ b/pkg/handler/subtest_test.go @@ -3,7 +3,7 @@ package handler_test import ( "testing" - "github.com/tus/tusd/pkg/handler" + "github.com/tus/tusd/v2/pkg/handler" "github.com/golang/mock/gomock" ) diff --git a/pkg/handler/terminate_test.go b/pkg/handler/terminate_test.go index b5121f5..f66c1cd 100644 --- a/pkg/handler/terminate_test.go +++ b/pkg/handler/terminate_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/golang/mock/gomock" - . "github.com/tus/tusd/pkg/handler" + . "github.com/tus/tusd/v2/pkg/handler" "github.com/stretchr/testify/assert" ) diff --git a/pkg/handler/unrouted_handler_test.go b/pkg/handler/unrouted_handler_test.go index 23df8e0..6800d5f 100644 --- a/pkg/handler/unrouted_handler_test.go +++ b/pkg/handler/unrouted_handler_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - . "github.com/tus/tusd/pkg/handler" + . "github.com/tus/tusd/v2/pkg/handler" ) func TestParseMetadataHeader(t *testing.T) { diff --git a/pkg/handler/utils_test.go b/pkg/handler/utils_test.go index 8c4ed35..97118d5 100644 --- a/pkg/handler/utils_test.go +++ b/pkg/handler/utils_test.go @@ -10,7 +10,7 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/tus/tusd/pkg/handler" + "github.com/tus/tusd/v2/pkg/handler" ) //go:generate mockgen -package handler_test -source utils_test.go -destination=handler_mock_test.go diff --git a/pkg/memorylocker/memorylocker.go b/pkg/memorylocker/memorylocker.go index 7fb4463..3e50841 100644 --- a/pkg/memorylocker/memorylocker.go +++ b/pkg/memorylocker/memorylocker.go @@ -15,7 +15,7 @@ import ( "context" "sync" - "github.com/tus/tusd/pkg/handler" + "github.com/tus/tusd/v2/pkg/handler" ) // MemoryLocker persists locks using memory and therefore allowing a simple and diff --git a/pkg/memorylocker/memorylocker_test.go b/pkg/memorylocker/memorylocker_test.go index 2aa63e6..9a165bb 100644 --- a/pkg/memorylocker/memorylocker_test.go +++ b/pkg/memorylocker/memorylocker_test.go @@ -6,7 +6,7 @@ import ( "time" "github.com/stretchr/testify/assert" - "github.com/tus/tusd/pkg/handler" + "github.com/tus/tusd/v2/pkg/handler" ) var _ handler.Locker = &MemoryLocker{} diff --git a/pkg/prometheuscollector/prometheuscollector.go b/pkg/prometheuscollector/prometheuscollector.go index 9c52c71..2eee61f 100644 --- a/pkg/prometheuscollector/prometheuscollector.go +++ b/pkg/prometheuscollector/prometheuscollector.go @@ -12,7 +12,7 @@ import ( "strconv" "sync/atomic" - "github.com/tus/tusd/pkg/handler" + "github.com/tus/tusd/v2/pkg/handler" "github.com/prometheus/client_golang/prometheus" ) diff --git a/pkg/s3store/s3store.go b/pkg/s3store/s3store.go index 7ea6038..748b778 100644 --- a/pkg/s3store/s3store.go +++ b/pkg/s3store/s3store.go @@ -1,22 +1,23 @@ // Package s3store provides a storage backend using AWS S3 or compatible servers. // -// Configuration +// # Configuration // // In order to allow this backend to function properly, the user accessing the // bucket must have at least following AWS IAM policy permissions for the // bucket and all of its subresources: -// s3:AbortMultipartUpload -// s3:DeleteObject -// s3:GetObject -// s3:ListMultipartUploadParts -// s3:PutObject +// +// s3:AbortMultipartUpload +// s3:DeleteObject +// s3:GetObject +// s3:ListMultipartUploadParts +// s3:PutObject // // While this package uses the official AWS SDK for Go, S3Store is able // to work with any S3-compatible service such as Riak CS. In order to change // the HTTP endpoint used for sending requests to, consult the AWS Go SDK // (http://docs.aws.amazon.com/sdk-for-go/api/aws/Config.html#WithEndpoint-instance_method). // -// Implementation +// # Implementation // // Once a new tus upload is initiated, multiple objects in S3 are created: // @@ -49,7 +50,7 @@ // info object is also deleted. If the upload has been finished already, the // finished object containing the entire upload is also removed. // -// Considerations +// # Considerations // // In order to support tus' principle of resumable upload, S3's Multipart-Uploads // are internally used. @@ -85,9 +86,9 @@ import ( "github.com/minio/minio-go/v7" "github.com/prometheus/client_golang/prometheus" - "github.com/tus/tusd/internal/semaphore" - "github.com/tus/tusd/internal/uid" - "github.com/tus/tusd/pkg/handler" + "github.com/tus/tusd/v2/internal/semaphore" + "github.com/tus/tusd/v2/internal/uid" + "github.com/tus/tusd/v2/pkg/handler" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" diff --git a/pkg/s3store/s3store_test.go b/pkg/s3store/s3store_test.go index 47e3e64..f7e6cec 100644 --- a/pkg/s3store/s3store_test.go +++ b/pkg/s3store/s3store_test.go @@ -16,7 +16,7 @@ import ( "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/service/s3" - "github.com/tus/tusd/pkg/handler" + "github.com/tus/tusd/v2/pkg/handler" ) //go:generate mockgen -destination=./s3store_mock_test.go -package=s3store github.com/tus/tusd/pkg/s3store S3API