google_cloud 0.3.0
google_cloud: ^0.3.0 copied to clipboard
Utilities for running Dart code correctly on the Google Cloud Platform.
0.3.0 #
BREAKING CHANGES #
- Split the library into two main entry points:
package:google_cloud/general.dartfor general GCP features like project discovery, identity discovery, and core structured logging.package:google_cloud/http_serving.dartfor HTTP serving features like port discovery, shelf middleware, and signal handling.package:google_cloud/google_cloud.dartremains as an umbrella library exporting both.
- Renamed
projectIdFromEnvironment()toprojectIdFromEnvironmentVariables(). - Renamed
portEnvironmentKeytoportEnvironmentVariable. - Renamed
listenPort()tolistenPortFromEnvironment(). computeProjectId(),projectIdFromMetadataServer(), andserviceAccountEmailFromMetadataServer()now leverage a unified process-wide metadata cache.- Breaking Change: Local discovery strategies (environment variables,
credentials files, and
gcloudconfig) are no longer cached. - Breaking Change:
projectIdFromMetadataServer()andserviceAccountEmailFromMetadataServer()now throwMetadataServerException(which wrapsSocketException,TimeoutException, orClientException) when discovery fails. - Constants are now exported via
package:google_cloud/constants.dartand are no longer exported bypackage:google_cloud/google_cloud.dart. - Require Dart 3.9.
- Require
package:http^1.1.0.
New Features #
- Added
getMetadataValue()(caching) andfetchMetadataValue()(non-caching) topackage:google_cloud/general.dart. - Added
projectIdFromCredentialsFile()to automatically discover project ID from the credentials JSON file. - Added
projectIdFromGcloudConfig()to automatically discover project ID from gcloud CLI configuration. - Added
serviceAccountEmailFromMetadataServer()to discover the default service account email. - Added
gceMetadataHostandgceMetadataUrlto interact with the metadata server. projectIdFromMetadataServer()now respects theGCE_METADATA_HOSTenvironment variable.- Added
refreshparameter tocomputeProjectId(),projectIdFromMetadataServer(), andserviceAccountEmailFromMetadataServer()to force re-discovery. - Added
clientparameter tocomputeProjectId(),projectIdFromMetadataServer(), andserviceAccountEmailFromMetadataServer()to allow providing a customhttp.Client. - Added
structuredLogEntry()for low-level structured log creation.
0.2.0 #
- First release replacing
package:gcp.