diff --git a/generated.go b/generated.go index db48d3a..e2075c0 100644 --- a/generated.go +++ b/generated.go @@ -7,6 +7,7 @@ import ( "net/http" "time" + . "github.com/beyondstorage/go-storage/v4/pairs" "github.com/beyondstorage/go-storage/v4/pkg/httpclient" "github.com/beyondstorage/go-storage/v4/services" . "github.com/beyondstorage/go-storage/v4/types" @@ -17,6 +18,7 @@ var _ services.ServiceError var _ httpclient.Options var _ time.Duration var _ http.Request +var _ Error // Type is the type for gcs const Type = "gcs" @@ -219,6 +221,8 @@ type pairServiceNew struct { HTTPClientOptions *httpclient.Options HasServiceFeatures bool ServiceFeatures ServiceFeatures + // Enable features + // Default pairs } // parsePairServiceNew will parse Pair slice into *pairServiceNew @@ -261,8 +265,15 @@ func parsePairServiceNew(opts []Pair) (pairServiceNew, error) { } result.HasServiceFeatures = true result.ServiceFeatures = v.Value.(ServiceFeatures) + // Enable features + // Default pairs } } + + // Enable features + + // Default pairs + if !result.HasCredential { return pairServiceNew{}, services.PairRequiredError{Keys: []string{"credential"}} } @@ -503,6 +514,10 @@ type pairStorageNew struct { StorageFeatures StorageFeatures HasWorkDir bool WorkDir string + // Enable features + hasEnableVirtualDir bool + EnableVirtualDir bool + // Default pairs } // parsePairStorageNew will parse Pair slice into *pairStorageNew @@ -539,8 +554,25 @@ func parsePairStorageNew(opts []Pair) (pairStorageNew, error) { } result.HasWorkDir = true result.WorkDir = v.Value.(string) + // Enable features + case "enable_virtual_dir": + if result.hasEnableVirtualDir { + continue + } + result.hasEnableVirtualDir = true + result.EnableVirtualDir = true + // Default pairs } } + + // Enable features + if result.hasEnableVirtualDir { + result.HasStorageFeatures = true + result.StorageFeatures.VirtualDir = true + } + + // Default pairs + if !result.HasName { return pairStorageNew{}, services.PairRequiredError{Keys: []string{"name"}} } diff --git a/go.mod b/go.mod index afeb1ad..06dbf07 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.15 require ( cloud.google.com/go/storage v1.16.0 github.com/beyondstorage/go-integration-test/v4 v4.3.0 - github.com/beyondstorage/go-storage/v4 v4.5.0 + github.com/beyondstorage/go-storage/v4 v4.6.0 github.com/google/uuid v1.3.0 golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 google.golang.org/api v0.50.0 diff --git a/go.sum b/go.sum index 8873f56..a65b89f 100644 --- a/go.sum +++ b/go.sum @@ -48,8 +48,8 @@ github.com/Xuanwo/templateutils v0.1.0/go.mod h1:OdE0DJ+CJxDBq6psX5DPV+gOZi8bhuH github.com/beyondstorage/go-integration-test/v4 v4.3.0 h1:WZ95f78RKlHpvft8zHcMaoa2aaTF/jzlzINhMD0EMHY= github.com/beyondstorage/go-integration-test/v4 v4.3.0/go.mod h1:HKgzemQZpxoHBL49JYEUnLTb5eteUhzcvmmPL7EDT/Y= github.com/beyondstorage/go-storage/v4 v4.4.0/go.mod h1:mc9VzBImjXDg1/1sLfta2MJH79elfM6m47ZZvZ+q/Uw= -github.com/beyondstorage/go-storage/v4 v4.5.0 h1:cWkX1A+yVLldEpj/Ad9capev9K1fbVIVcRvwqWsMgpw= -github.com/beyondstorage/go-storage/v4 v4.5.0/go.mod h1:mc9VzBImjXDg1/1sLfta2MJH79elfM6m47ZZvZ+q/Uw= +github.com/beyondstorage/go-storage/v4 v4.6.0 h1:a05dtbYjMZB7LrUSvVzzHwlx33B4yEmd5oQB7Itk7VY= +github.com/beyondstorage/go-storage/v4 v4.6.0/go.mod h1:mc9VzBImjXDg1/1sLfta2MJH79elfM6m47ZZvZ+q/Uw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=