mirror of
https://github.com/rclone/rclone.git
synced 2024-11-22 00:13:49 +01:00
googlecloudstorage: add example values for endpoint with help on avoiding transfer fees
This commit is contained in:
parent
298c13e719
commit
5efe4d9674
@ -337,8 +337,9 @@ can't check the size and hash but the file contents will be decompressed.
|
||||
Default: false,
|
||||
}, {
|
||||
Name: "endpoint",
|
||||
Help: "Endpoint for the service.\n\nLeave blank normally.",
|
||||
Help: "Endpoint for the service. Use a regional endpoint (storage.REGION.rep.googleapis.com) to reduce transfer fees",
|
||||
Advanced: true,
|
||||
Examples: getHelpForEndpoints(),
|
||||
}, {
|
||||
Name: config.ConfigEncoding,
|
||||
Help: config.ConfigEncodingHelp,
|
||||
|
35
backend/googlecloudstorage/googlecloudstorageendpoints.go
Normal file
35
backend/googlecloudstorage/googlecloudstorageendpoints.go
Normal file
@ -0,0 +1,35 @@
|
||||
package googlecloudstorage
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/rclone/rclone/fs"
|
||||
)
|
||||
|
||||
type endpointRecord struct {
|
||||
endpointURL, Location, Description string
|
||||
}
|
||||
|
||||
var endpoints = []endpointRecord{
|
||||
{"https://storage.europe-west3.rep.googleapis.com/storage/v1/", "europe-west3", "Frankfurt"},
|
||||
{"https://storage.europe-west8.rep.googleapis.com/storage/v1/", "europe-west8", "Milan"},
|
||||
{"https://storage.europe-west9.rep.googleapis.com/storage/v1/", "europe-west9", "Paris"},
|
||||
{"https://storage.me-central2.rep.googleapis.com/storage/v1/", "me-central2", "Doha"},
|
||||
{"https://storage.us-central1.rep.googleapis.com/storage/v1/", "us-central1", "Iowa"},
|
||||
{"https://storage.us-east1.rep.googleapis.com/storage/v1/", "us-east1", "South Carolina"},
|
||||
{"https://storage.us-east4.rep.googleapis.com/storage/v1/", "us-east4", "Northern Virgina"},
|
||||
{"https://storage.us-east5.rep.googleapis.com/storage/v1/", "us-east5", "Columbus"},
|
||||
{"https://storage.us-south1.rep.googleapis.com/storage/v1/", "us-south1", "Dallas"},
|
||||
{"https://storage.us-west1.rep.googleapis.com/storage/v1/", "us-west1", "Oregon"},
|
||||
{"https://storage.us-west2.rep.googleapis.com/storage/v1/", "us-west2", "Los Angeles"},
|
||||
{"https://storage.us-west3.rep.googleapis.com/storage/v1/", "us-west3", "Salt Lake City"},
|
||||
{"https://storage.us-west4.rep.googleapis.com/storage/v1/", "us-west4", "Las Vegas"},
|
||||
}
|
||||
|
||||
func getHelpForEndpoints() (r []fs.OptionExample) {
|
||||
r = make([]fs.OptionExample, 0, len(endpoints))
|
||||
for _, ep := range endpoints {
|
||||
r = append(r, fs.OptionExample{Value: ep.endpointURL, Help: fmt.Sprintf("%s : %s", ep.Location, ep.Description)})
|
||||
}
|
||||
return r
|
||||
}
|
Loading…
Reference in New Issue
Block a user