|
|
@ -17,32 +17,24 @@ |
|
|
|
package cmd |
|
|
|
package cmd |
|
|
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
import ( |
|
|
|
|
|
|
|
"bytes" |
|
|
|
"context" |
|
|
|
"context" |
|
|
|
"crypto/sha256" |
|
|
|
"crypto/sha256" |
|
|
|
|
|
|
|
"encoding/base64" |
|
|
|
|
|
|
|
"encoding/hex" |
|
|
|
"errors" |
|
|
|
"errors" |
|
|
|
"fmt" |
|
|
|
"fmt" |
|
|
|
"hash" |
|
|
|
"hash" |
|
|
|
"io" |
|
|
|
"io" |
|
|
|
|
|
|
|
"path" |
|
|
|
"strconv" |
|
|
|
"strconv" |
|
|
|
"strings" |
|
|
|
"strings" |
|
|
|
|
|
|
|
|
|
|
|
"encoding/hex" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"cloud.google.com/go/storage" |
|
|
|
"cloud.google.com/go/storage" |
|
|
|
|
|
|
|
|
|
|
|
"google.golang.org/api/googleapi" |
|
|
|
"google.golang.org/api/googleapi" |
|
|
|
"google.golang.org/api/iterator" |
|
|
|
"google.golang.org/api/iterator" |
|
|
|
|
|
|
|
|
|
|
|
"encoding/base64" |
|
|
|
"github.com/minio/cli" |
|
|
|
|
|
|
|
|
|
|
|
"bytes" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// this package contains the url code of go 1.8
|
|
|
|
|
|
|
|
// due to compatibility with older versions
|
|
|
|
|
|
|
|
// copied it to our rep
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"path" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
minio "github.com/minio/minio-go" |
|
|
|
minio "github.com/minio/minio-go" |
|
|
|
"github.com/minio/minio-go/pkg/policy" |
|
|
|
"github.com/minio/minio-go/pkg/policy" |
|
|
|
) |
|
|
|
) |
|
|
@ -171,7 +163,7 @@ type gcsGateway struct { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// newGCSGateway returns gcs gatewaylayer
|
|
|
|
// newGCSGateway returns gcs gatewaylayer
|
|
|
|
func newGCSGateway(args []string) (GatewayLayer, error) { |
|
|
|
func newGCSGateway(args cli.Args) (GatewayLayer, error) { |
|
|
|
if len(args) != 1 { |
|
|
|
if len(args) != 1 { |
|
|
|
return nil, fmt.Errorf("ProjectID expected") |
|
|
|
return nil, fmt.Errorf("ProjectID expected") |
|
|
|
} |
|
|
|
} |
|
|
@ -183,7 +175,7 @@ func newGCSGateway(args []string) (GatewayLayer, error) { |
|
|
|
endpoint := "storage.googleapis.com" |
|
|
|
endpoint := "storage.googleapis.com" |
|
|
|
secure := true |
|
|
|
secure := true |
|
|
|
|
|
|
|
|
|
|
|
projectID := args[0] |
|
|
|
projectID := args.First() |
|
|
|
|
|
|
|
|
|
|
|
ctx := context.Background() |
|
|
|
ctx := context.Background() |
|
|
|
|
|
|
|
|
|
|
|