A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/orgrim/pg_back/commit/6ba551d6d52d1ac3c98b067e653c22768c920cd1 below:

upload files to GCS · orgrim/pg_back@6ba551d · GitHub

@@ -76,7 +76,7 @@ type options struct {

76 76

CipherPassphrase string

77 77

Decrypt bool

78 78 79 -

Upload string // values are none, s3, sftp

79 +

Upload string // values are none, s3, sftp, gcs

80 80

PurgeRemote bool

81 81

S3Region string

82 82

S3Bucket string

@@ -94,6 +94,10 @@ type options struct {

94 94

SFTPDirectory string

95 95

SFTPIdentityFile string // path to private key

96 96

SFTPIgnoreKnownHosts bool

97 + 98 +

GCSBucket string

99 +

GCSEndPoint string

100 +

GCSCredentialsFile string

97 101

}

98 102 99 103

func defaultOptions() options {

@@ -266,6 +270,10 @@ func parseCli(args []string) (options, []string, error) {

266 270

pflag.StringVar(&opts.SFTPIdentityFile, "sftp-identity", "", "Path to a private key")

267 271

SFTPIgnoreHostKey := pflag.String("sftp-ignore-hostkey", "no", "Check the target host key against local known hosts")

268 272 273 +

pflag.StringVar(&opts.GCSBucket, "gcs-bucket", "", "GCS bucket name")

274 +

pflag.StringVar(&opts.GCSEndPoint, "gcs-endpoint", "", "GCS endpoint URL")

275 +

pflag.StringVar(&opts.GCSCredentialsFile, "gcs-keyfile", "", "path to the GCS credentials file")

276 + 269 277

pflag.StringVarP(&opts.Host, "host", "h", "", "database server host or socket directory")

270 278

pflag.IntVarP(&opts.Port, "port", "p", 0, "database server port number")

271 279

pflag.StringVarP(&opts.Username, "username", "U", "", "connect as specified database user")

@@ -393,7 +401,7 @@ func parseCli(args []string) (options, []string, error) {

393 401

}

394 402 395 403

// Validate upload option

396 -

stores := []string{"none", "s3", "sftp"}

404 +

stores := []string{"none", "s3", "sftp", "gcs"}

397 405

if err := validateEnum(opts.Upload, stores); err != nil {

398 406

return opts, changed, fmt.Errorf("invalid value for --upload: %s", err)

399 407

}

@@ -486,6 +494,10 @@ func loadConfigurationFile(path string) (options, error) {

486 494

opts.SFTPIdentityFile = s.Key("sftp_identity").MustString("")

487 495

opts.SFTPIgnoreKnownHosts = s.Key("sftp_ignore_hostkey").MustBool(false)

488 496 497 +

opts.GCSBucket = s.Key("gcs_bucket").MustString("")

498 +

opts.GCSEndPoint = s.Key("gcs_endpoint").MustString("")

499 +

opts.GCSCredentialsFile = s.Key("gcs_keyfile").MustString("")

500 + 489 501

// Validate purge keep and time limit

490 502

keep, err := validatePurgeKeepValue(purgeKeep)

491 503

if err != nil {

@@ -517,7 +529,7 @@ func loadConfigurationFile(path string) (options, error) {

517 529

}

518 530 519 531

// Validate upload option

520 -

stores := []string{"none", "s3", "sftp"}

532 +

stores := []string{"none", "s3", "sftp", "gcs"}

521 533

if err := validateEnum(opts.Upload, stores); err != nil {

522 534

return opts, fmt.Errorf("invalid value for upload: %s", err)

523 535

}

@@ -728,6 +740,13 @@ func mergeCliAndConfigOptions(cliOpts options, configOpts options, onCli []strin

728 740

case "sftp-ignore-hostkey":

729 741

opts.SFTPIgnoreKnownHosts = cliOpts.SFTPIgnoreKnownHosts

730 742 743 +

case "gcs-bucket":

744 +

opts.GCSBucket = cliOpts.GCSBucket

745 +

case "gcs-endpoint":

746 +

opts.GCSEndPoint = cliOpts.GCSEndPoint

747 +

case "gcs-keyfile":

748 +

opts.GCSCredentialsFile = cliOpts.GCSCredentialsFile

749 + 731 750

case "host":

732 751

opts.Host = cliOpts.Host

733 752

case "port":


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4