Go 1.11 ha raggiunto la fine del supporto
e verrà ritirato
il 31 gennaio 2026. Dopo il ritiro, non potrai eseguire il deployment delle applicazioni Go 1.11, anche se la tua organizzazione ha utilizzato in precedenza un criterio dell'organizzazione per riattivare i deployment dei runtime legacy. Le tue applicazioni Go
1.11 continueranno a essere eseguite e a ricevere traffico dopo la
data di ritiro. Ti
consigliamo di eseguire la migrazione all'ultima versione supportata di Go.
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Puoi utilizzare un bucket Cloud Storage
per archiviare e gestire file, come film, immagini o altri contenuti statici. Questo documento descrive come configurare l'ambiente per utilizzare la libreria client App Engine per Cloud Storage.
Configurazione del progetto in corso…
Crea un progetto Google Cloud e scopri come sono strutturate le app Go 1.11 in App Engine. Annota e salva l'ID progetto da utilizzare
con la tua applicazione.
Attivazione di un bucket Cloud Storage
Per utilizzare Cloud Storage, devi attivare almeno un bucket.
Ti consigliamo di utilizzare il bucket predefinito che offre gratuitamente i primi 5 GB di spazio di archiviazione. Puoi attivare e utilizzare un altro bucket Cloud Storage. Il bucket predefinito include
i primi 5 GB di spazio di archiviazione gratuiti. Il bucket predefinito
include anche una quota gratuita per le operazioni di I/O di Cloud Storage. Per ulteriori dettagli, consulta
Prezzi, quote e limiti.
Per attivare il bucket Cloud Storage predefinito per la tua app:
Fai clic su Crea in Bucket Cloud Storage predefinito nella pagina
Impostazioni di App Engine per il tuo progetto.
Prendi nota del nome di questo bucket: ha il formato <project-id>.appspot.com.
Se hai bisogno di più spazio di archiviazione rispetto al limite di 5 GB, puoi
aumentare questo limite abilitando la fatturazione per il tuo progetto,
in modo da creare un bucket a pagamento. Ti verrà addebitato un costo per lo spazio di archiviazione superiore al limite di 5 GB.
Se vuoi attivare uno o più bucket a pagamento, segui le istruzioni riportate in
Creazione di un bucket per attivarli.
Impostazione delle autorizzazioni per bucket e oggetti
Utilizzo della libreria client con il server dell'app di sviluppo
Puoi utilizzare la libreria client con il server di sviluppo. Tuttavia, poiché
non esiste un'emulazione locale di Cloud Storage, tutte le richieste di lettura e scrittura
dei file devono essere inviate su internet a un bucket Cloud Storage effettivo.
Per utilizzare la libreria client con il server app di sviluppo:
Esegui dev_appserver.py con il flag --default_gcs_bucket_name [BUCKET_NAME],
sostituendo [BUCKET_NAME] con il nome del bucket Cloud Storage che stai
utilizzando.
Questo flag controlla il bucket che verrà restituito quando l'applicazione
chiama file.DefaultBucketName(ctx).
Prezzi, quote e limiti
Non sono previsti costi per la larghezza di banda associati alle chiamate a Cloud Storage dalla libreria client di App Engine. Tuttavia, sono previsti
costi operativi.
Inoltre, le chiamate vengono conteggiate ai fini della
quota di recupero URL
in quanto la libreria utilizza il servizio di recupero URL per interagire con Cloud Storage.
Tieni presente che Cloud Storage è un servizio a pagamento;
ti verrà addebitato un costo in base al listino prezzi di Cloud Storage.
Modi alternativi per accedere a Cloud Storage
Anziché utilizzare la libreria client, puoi utilizzare quanto segue:
Browser di Cloud Storage nella
consoleGoogle Cloud , utile per caricare rapidamente gli oggetti.
gsutil, uno strumento a riga di comando per lavorare con i file in Cloud Storage.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-04 UTC."],[[["\u003cp\u003eCloud Storage buckets can be used to store and serve static content like movies or images, and this document details setting up the environment to use the App Engine client library for Cloud Storage.\u003c/p\u003e\n"],["\u003cp\u003eTo use Cloud Storage, you must activate at least one bucket, with the default bucket offering 5GB of free storage and a free quota for I/O operations.\u003c/p\u003e\n"],["\u003cp\u003eThe App Engine client library for Cloud Storage can be downloaded using the \u003ccode\u003ego\u003c/code\u003e tool, allowing you to interact with Cloud Storage from your application.\u003c/p\u003e\n"],["\u003cp\u003eWhen using the client library with the development app server, all read and write requests are sent over the Internet to a real Cloud Storage bucket, and the \u003ccode\u003edev_appserver.py\u003c/code\u003e must include a flag specifying the bucket name.\u003c/p\u003e\n"],["\u003cp\u003eWhile there are no bandwidth charges for calls from App Engine's client library to Cloud Storage, there are operations charges, and these calls count against the URL fetch quota.\u003c/p\u003e\n"]]],[],null,["# Setting Up Google Cloud Storage\n\nYou can use a Cloud Storage bucket\nto store and serve files, such as movies or images or other static content. This\ndocument describes how to set up your environment to use the App Engine client\nlibrary for Cloud Storage.\n| This API is supported for first-generation runtimes and can be used when [upgrading to corresponding second-generation runtimes](/appengine/docs/standard/\n| go\n| /services/access). If you are updating to the App Engine Go 1.12+ runtime, refer to the [migration guide](/appengine/migration-center/standard/migrate-to-second-gen/go-differences) to learn about your migration options for legacy bundled services.\n\nSetting up your project\n-----------------------\n\nCreate a Google Cloud project, and understand how Go 1.11 apps are\nstructured in App Engine. Write down and save your project ID for use\nwith your application.\n\nActivating a Cloud Storage bucket\n---------------------------------\n\nTo use Cloud Storage, you'll need to activate at least one bucket.\nYou might want to use the default bucket which provides the first 5GB of\nstorage for free. You can activate and use another Cloud Storage\nbucket. The default bucket includes\nthe first 5GB of storage for free. The default bucket\nalso includes a free quota for Cloud Storage I/O operations. See\n[Pricing, quotas, and limits](#pricing_quotas_and_limits)\nfor more details.\n\nTo activate the default Cloud Storage bucket for your app:\n\n1. Click **Create** under *Default Cloud Storage Bucket* in the\n [App Engine settings](https://console.cloud.google.com/appengine/settings) page for your project.\n Notice the name of this bucket: it is in the form `\u003cproject-id\u003e.appspot.com`.\n\n2. If you need more storage than the 5GB limit, you can\n increase this by [enabling billing](https://console.cloud.google.com/billing) for your project,\n making this a paid bucket. You will be charged for storage over the 5GB limit.\n\nIf you want to activate one or more paid buckets, follow the instructions under\n[Creating a bucket](/storage/docs/cloud-console#_creatingbuckets) to activate\nthem.\n| **Note:** When you create a default bucket, you also get a staging bucket with the same name except that `staging.` is prepended to it. You can use this staging bucket for temporary files used for staging and test purposes; it also has a 5 GB limit, but it is automatically emptied on a weekly basis.\n\n### Setting bucket and object permissions\n\nYou can find information on allowing your app's service account or other users\naccess the storage bucket and its contents in\n[Setting bucket permissions](/storage/docs/cloud-console#_bucketpermission) and\n[Setting object permissions](/storage/docs/cloud-console#_permissions).\n\nDownloading the client library\n------------------------------\n\nThe App Engine client library for Cloud Storage is available via the `go` tool.\nTo download the library:\n\n1. Set your `GOPATH` if needed. If you are using Linux and macOS, you can\n set your `GOPATH` as follows:\n\n mkdir -p $HOME/go\n export GOPATH=$HOME/go\n\n | **Note:** For Windows instructions, see the [Windows](https://golang.org/doc/install#windows) section of [Getting Started with the Go Programming Language](https://golang.org/doc/install).\n2. Download the `oauth2`, `storage`, and `appengine` packages:\n\n go get -u golang.org/x/oauth2\n go get -u cloud.google.com/go/storage\n go get -u google.golang.org/appengine/...\n\n | **Note:** These packages will be downloaded to your `GOPATH`'s `src` directory.\n\nFor details about installing the client library, see the [Cloud Storage Client Libraries](/storage/docs/reference/libraries) page.\n\nUsing the client library with the development app server\n--------------------------------------------------------\n\nYou can use the client library with the development server. However because\nthere is no local emulation of Cloud Storage, all requests to read and write\nfiles must be sent over the Internet to an actual Cloud Storage bucket.\n\nTo use the client library with the development app server:\n\n1. [Activate a Cloud Storage bucket](#activating_a_cloud_storage_bucket).\n\n2. Run `dev_appserver.py` with the flag `--default_gcs_bucket_name [BUCKET_NAME]`,\n replacing `[BUCKET_NAME]` with the name of the Cloud Storage bucket you are\n using.\n\n This flag controls the bucket that will be returned when your application\n calls `file.DefaultBucketName(ctx)`.\n\nPricing, quotas, and limits\n---------------------------\n\nThere are no bandwidth charges associated with making calls to Cloud Storage from\nApp Engine's client library. However, there are\n[operations charges](/storage/pricing#operations-pricing).\nIn addition, the calls count against your\n[URL fetch quota](/appengine/docs/quotas#UrlFetch)\nas the library uses the URL Fetch service to interact with Cloud Storage.\n\nNotice that Cloud Storage is a pay-to-use service;\nyou will be charged according to the Cloud Storage [price sheet](/storage/pricing).\n\nAlternative ways to access Cloud Storage\n----------------------------------------\n\nInstead of using the client library, you could use the following:\n\n- [Cloud Storage Browser](https://console.cloud.google.com/storage/browser) in the Google Cloud console, which is useful for uploading objects quickly.\n- [gsutil](/storage/docs/gsutil), which is a command-line tool for working with files in Cloud Storage.\n\nWhat's next\n-----------\n\n- Visit the [API Reference documentation](https://godoc.org/cloud.google.com/go/storage).\n- Learn how to [read and write to Cloud Storage](/appengine/docs/legacy/standard/go111/googlecloudstorageclient/read-write-to-cloud-storage) with the App Engine client library for Cloud Storage.\n- Review the [App Engine and Google Cloud Storage sample](/appengine/docs/legacy/standard/go111/googlecloudstorageclient/app-engine-cloud-storage-sample).\n- View the complete set of [Cloud Storage documentation](/storage/docs), including additional samples and tutorials."]]