cloud drive: add google cloud storage

This commit is contained in:
Chris Lu
2021-08-23 00:29:27 -07:00
parent 3b2c39f1be
commit 258063de26
6 changed files with 349 additions and 146 deletions

View File

@@ -52,13 +52,15 @@ func (c *commandRemoteConfigure) Do(args []string, commandEnv *CommandEnv, write
isDelete := remoteConfigureCommand.Bool("delete", false, "delete one remote storage by its name")
remoteConfigureCommand.StringVar(&conf.Name, "name", "", "a short name to identify the remote storage")
remoteConfigureCommand.StringVar(&conf.Type, "type", "s3", "storage type, currently only support s3")
remoteConfigureCommand.StringVar(&conf.Type, "type", "s3", "[s3|gcs] storage type")
remoteConfigureCommand.StringVar(&conf.S3AccessKey, "s3.access_key", "", "s3 access key")
remoteConfigureCommand.StringVar(&conf.S3SecretKey, "s3.secret_key", "", "s3 secret key")
remoteConfigureCommand.StringVar(&conf.S3Region, "s3.region", "us-east-2", "s3 region")
remoteConfigureCommand.StringVar(&conf.S3Endpoint, "s3.endpoint", "", "endpoint for s3-compatible local object store")
remoteConfigureCommand.StringVar(&conf.GcsGoogleApplicationCredentials, "gcs.appCredentialsFile", "", "google cloud storage credentials file, or leave it empty to use env GOOGLE_APPLICATION_CREDENTIALS")
if err = remoteConfigureCommand.Parse(args); err != nil {
return nil
}