integrate flags with composer gcs object prefix
This commit is contained in:
parent
bb2ee4cf41
commit
e824008fe2
|
@ -5,10 +5,10 @@ import (
|
||||||
|
|
||||||
"github.com/tus/tusd"
|
"github.com/tus/tusd"
|
||||||
"github.com/tus/tusd/filestore"
|
"github.com/tus/tusd/filestore"
|
||||||
|
"github.com/tus/tusd/gcsstore"
|
||||||
"github.com/tus/tusd/limitedstore"
|
"github.com/tus/tusd/limitedstore"
|
||||||
"github.com/tus/tusd/memorylocker"
|
"github.com/tus/tusd/memorylocker"
|
||||||
"github.com/tus/tusd/s3store"
|
"github.com/tus/tusd/s3store"
|
||||||
"github.com/tus/tusd/gcsstore"
|
|
||||||
|
|
||||||
"github.com/aws/aws-sdk-go/aws"
|
"github.com/aws/aws-sdk-go/aws"
|
||||||
"github.com/aws/aws-sdk-go/aws/session"
|
"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)
|
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)
|
store.UseIn(Composer)
|
||||||
|
|
||||||
locker := memorylocker.New()
|
locker := memorylocker.New()
|
||||||
|
|
|
@ -45,10 +45,11 @@ type GCSStore struct {
|
||||||
|
|
||||||
// New constructs a new GCS storage backend using the supplied GCS bucket name
|
// New constructs a new GCS storage backend using the supplied GCS bucket name
|
||||||
// and service object.
|
// and service object.
|
||||||
func New(bucket string, service GCSAPI) GCSStore {
|
func New(bucket string, objPrefix string, service GCSAPI) GCSStore {
|
||||||
return GCSStore{
|
return GCSStore{
|
||||||
Bucket: bucket,
|
Bucket: bucket,
|
||||||
Service: service,
|
ObjectPrefix: objPrefix,
|
||||||
|
Service: service,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue