From 600f4fc939f3197d9485896331915556153986f3 Mon Sep 17 00:00:00 2001 From: ridhozhr Date: Wed, 22 May 2019 20:54:14 +0700 Subject: [PATCH] add object prefix in gcs store --- gcsstore/gcsstore.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gcsstore/gcsstore.go b/gcsstore/gcsstore.go index 589ef19..075cd86 100644 --- a/gcsstore/gcsstore.go +++ b/gcsstore/gcsstore.go @@ -14,13 +14,14 @@ import ( "bytes" "encoding/json" "fmt" - "golang.org/x/net/context" "io" "strconv" "strings" "sync" "sync/atomic" + "golang.org/x/net/context" + "cloud.google.com/go/storage" "github.com/tus/tusd" "github.com/tus/tusd/uid" @@ -32,6 +33,11 @@ type GCSStore struct { // Specifies the GCS bucket that uploads will be stored in Bucket string + // ObjectPrefix is prepended to the name of each GCS object that is created. + // It can be used to create a pseudo-directory structure in the bucket, + // e.g. "path/to/my/uploads". + ObjectPrefix string + // Service specifies an interface used to communicate with the Google // cloud storage backend. Implementation can be seen in gcsservice file. Service GCSAPI