diff --git a/cmd/tusd/cli/composer.go b/cmd/tusd/cli/composer.go index 2aad4d1..a3c17d8 100644 --- a/cmd/tusd/cli/composer.go +++ b/cmd/tusd/cli/composer.go @@ -5,10 +5,10 @@ import ( "github.com/tus/tusd" "github.com/tus/tusd/filestore" + "github.com/tus/tusd/gcsstore" "github.com/tus/tusd/limitedstore" "github.com/tus/tusd/memorylocker" "github.com/tus/tusd/s3store" - "github.com/tus/tusd/gcsstore" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" @@ -55,7 +55,7 @@ func CreateComposer() { stdout.Printf("Using 'gcs://%s' as GCS bucket for storage.\n", Flags.GCSBucket) - store := gcsstore.New(Flags.GCSBucket, service) + store := gcsstore.New(Flags.GCSBucket, Flags.GCSObjectPrefix, service) store.UseIn(Composer) locker := memorylocker.New() diff --git a/gcsstore/gcsstore.go b/gcsstore/gcsstore.go index 075cd86..2117179 100644 --- a/gcsstore/gcsstore.go +++ b/gcsstore/gcsstore.go @@ -45,10 +45,11 @@ type GCSStore struct { // New constructs a new GCS storage backend using the supplied GCS bucket name // and service object. -func New(bucket string, service GCSAPI) GCSStore { +func New(bucket string, objPrefix string, service GCSAPI) GCSStore { return GCSStore{ - Bucket: bucket, - Service: service, + Bucket: bucket, + ObjectPrefix: objPrefix, + Service: service, } }