Add v2 to module name
See https://github.com/tus/tusd/pull/672#issuecomment-1082737523 for context
This commit is contained in:
parent
158b242fbe
commit
a75c24996f
|
@ -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"
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
)
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/tus/tusd/pkg/handler"
|
||||
"github.com/tus/tusd/v2/pkg/handler"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"github.com/tus/tusd/cmd/tusd/cli"
|
||||
"github.com/tus/tusd/v2/cmd/tusd/cli"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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() {
|
||||
|
|
2
go.mod
2
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
|
||||
|
|
|
@ -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 (
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
)
|
||||
|
|
|
@ -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{}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
)
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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"
|
||||
)
|
||||
|
|
|
@ -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"
|
||||
)
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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{}
|
||||
|
|
|
@ -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"
|
||||
)
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue