├── .codecov.yml ├── .gitattributes ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── pull_request_template.md └── workflows │ └── tests.yml ├── .gitignore ├── .vscode ├── settings.json └── tasks.json ├── AUTHORS ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── CONTRIBUTORS ├── LICENSE ├── README.md ├── allmodules ├── aws ├── aws.go ├── aws_test.go ├── awscloud │ ├── awscloud.go │ └── example_test.go └── rds │ └── rds.go ├── azure ├── azurecloud │ └── azurecloud.go └── azuredb │ └── azuredb.go ├── blob ├── azureblob │ ├── azureblob.go │ ├── azureblob_test.go │ ├── example_test.go │ └── testdata │ │ └── TestConformance │ │ ├── TestAs │ │ ├── verify_As_returns_false_when_passed_nil.replay │ │ └── verify_ContentLanguage_can_be_written_and_read_through_As.replay │ │ ├── TestAttributes.replay │ │ ├── TestCanceledWrite │ │ ├── BlobExists.replay │ │ ├── EmptyContentType.replay │ │ └── NonEmptyContentType.replay │ │ ├── TestConcurrentWriteAndRead.replay │ │ ├── TestCopy │ │ ├── NonExistentSourceFails.replay │ │ └── Works.replay │ │ ├── TestDelete │ │ ├── NonExistentFails.replay │ │ └── Works.replay │ │ ├── TestDirsWithCharactersBeforeDelimiter.replay │ │ ├── TestKeys │ │ ├── ascii-1.replay │ │ ├── ascii-2.replay │ │ ├── ascii-3.replay │ │ ├── ascii-4.replay │ │ ├── ascii-5.replay │ │ ├── ascii-6.replay │ │ ├── ascii-7.replay │ │ ├── ascii-8.replay │ │ ├── backslashes.replay │ │ ├── dotdotbackslash.replay │ │ ├── dotdotslash.replay │ │ ├── fwdslashes.replay │ │ ├── non-UTF8_fails.replay │ │ ├── quote.replay │ │ ├── repeatedbackslashes.replay │ │ ├── repeatedfwdslashes.replay │ │ ├── spaces.replay │ │ ├── startwithdigit.replay │ │ └── unicode.replay │ │ ├── TestList │ │ ├── PaginationConsistencyAfterDelete.replay │ │ ├── PaginationConsistencyAfterInsert.replay │ │ ├── by_1.replay │ │ ├── by_2.replay │ │ ├── by_3.replay │ │ ├── exactly_1_object_due_to_prefix.replay │ │ ├── no_objects.replay │ │ └── no_pagination.replay │ │ ├── TestListDelimiters │ │ ├── abc.replay │ │ ├── backslash.replay │ │ └── fwdslash.replay │ │ ├── TestListWeirdKeys.replay │ │ ├── TestMD5.replay │ │ ├── TestMetadata │ │ ├── duplicate_case-insensitive_key_fails.replay │ │ ├── empty.replay │ │ ├── empty_key_fails.replay │ │ ├── non-utf8_metadata_key.replay │ │ ├── non-utf8_metadata_value.replay │ │ ├── valid_metadata.replay │ │ ├── valid_metadata_with_content_type.replay │ │ ├── valid_metadata_with_empty_body.replay │ │ └── weird_metadata_keys.replay │ │ ├── TestNonexistentBucket.replay │ │ ├── TestRead │ │ ├── length_0_read.replay │ │ ├── negative_offset_fails.replay │ │ ├── read_a_part_in_middle.replay │ │ ├── read_from_positive_offset_to_end.replay │ │ ├── read_in_full.replay │ │ ├── read_in_full_with_negative_length_not_-1.replay │ │ └── read_of_nonexistent_key_fails.replay │ │ ├── TestSignedURL.replay │ │ ├── TestUploadDownload.replay │ │ └── TestWrite │ │ ├── ContentType_is_discovered_if_not_provided.replay │ │ ├── ContentType_is_left_empty_if_not_provided_and_DisableContentTypeDetection_is_true.replay │ │ ├── Content_md5_did_not_match,_blob_existed.replay │ │ ├── Content_md5_did_not_match.replay │ │ ├── Content_md5_match.replay │ │ ├── a_large_jpg_file_gets_a_ContentType.replay │ │ ├── a_large_jpg_file_written_in_two_chunks_gets_a_ContentType.replay │ │ ├── a_small_text_file_gets_a_ContentType.replay │ │ ├── invalid_ContentType_fails.replay │ │ ├── no_write_then_close_results_in_empty_blob,_blob_existed.replay │ │ ├── no_write_then_close_results_in_empty_blob.replay │ │ ├── write_to_empty_key_fails.replay │ │ └── write_with_explicit_ContentType_overrides_discovery.replay ├── blob.go ├── blob_fs.go ├── blob_fs_test.go ├── blob_reader_test.go ├── blob_test.go ├── blob_writer_test.go ├── driver │ └── driver.go ├── drivertest │ ├── bindata.go │ └── drivertest.go ├── example_openbucket_test.go ├── example_test.go ├── fileblob │ ├── attrs.go │ ├── example_test.go │ ├── fileblob.go │ └── fileblob_test.go ├── gcsblob │ ├── example_test.go │ ├── gcsblob.go │ ├── gcsblob_test.go │ ├── iam.go │ ├── iam_test.go │ └── testdata │ │ ├── TestBeforeReadNonExistentKey.replay │ │ ├── TestConformance │ │ ├── TestAs │ │ │ ├── verify_As_returns_false_when_passed_nil.replay │ │ │ └── verify_ContentLanguage_can_be_written_and_read_through_As.replay │ │ ├── TestAttributes.replay │ │ ├── TestCanceledWrite │ │ │ ├── BlobExists.replay │ │ │ ├── EmptyContentType.replay │ │ │ └── NonEmptyContentType.replay │ │ ├── TestConcurrentWriteAndRead.replay │ │ ├── TestCopy │ │ │ ├── NonExistentSourceFails.replay │ │ │ └── Works.replay │ │ ├── TestDelete │ │ │ ├── NonExistentFails.replay │ │ │ └── Works.replay │ │ ├── TestDirsWithCharactersBeforeDelimiter.replay │ │ ├── TestIfNotExist.replay │ │ ├── TestKeys │ │ │ ├── ascii-1.replay │ │ │ ├── ascii-2.replay │ │ │ ├── ascii-3.replay │ │ │ ├── ascii-4.replay │ │ │ ├── ascii-5.replay │ │ │ ├── ascii-6.replay │ │ │ ├── ascii-7.replay │ │ │ ├── ascii-8.replay │ │ │ ├── backslashes.replay │ │ │ ├── dotdotbackslash.replay │ │ │ ├── dotdotslash.replay │ │ │ ├── fwdslashes.replay │ │ │ ├── non-UTF8_fails.replay │ │ │ ├── quote.replay │ │ │ ├── repeatedbackslashes.replay │ │ │ ├── repeatedfwdslashes.replay │ │ │ ├── spaces.replay │ │ │ ├── startwithdigit.replay │ │ │ └── unicode.replay │ │ ├── TestList │ │ │ ├── PaginationConsistencyAfterDelete.replay │ │ │ ├── PaginationConsistencyAfterInsert.replay │ │ │ ├── by_1.replay │ │ │ ├── by_2.replay │ │ │ ├── by_3.replay │ │ │ ├── exactly_1_object_due_to_prefix.replay │ │ │ ├── no_objects.replay │ │ │ └── no_pagination.replay │ │ ├── TestListDelimiters │ │ │ ├── abc.replay │ │ │ ├── backslash.replay │ │ │ └── fwdslash.replay │ │ ├── TestListWeirdKeys.replay │ │ ├── TestMD5.replay │ │ ├── TestMetadata │ │ │ ├── duplicate_case-insensitive_key_fails.replay │ │ │ ├── empty.replay │ │ │ ├── empty_key_fails.replay │ │ │ ├── non-utf8_metadata_key.replay │ │ │ ├── non-utf8_metadata_value.replay │ │ │ ├── valid_metadata.replay │ │ │ ├── valid_metadata_with_content_type.replay │ │ │ ├── valid_metadata_with_empty_body.replay │ │ │ └── weird_metadata_keys.replay │ │ ├── TestNonexistentBucket.replay │ │ ├── TestRead │ │ │ ├── length_0_read.replay │ │ │ ├── negative_offset_fails.replay │ │ │ ├── read_a_part_in_middle.replay │ │ │ ├── read_from_positive_offset_to_end.replay │ │ │ ├── read_in_full.replay │ │ │ ├── read_in_full_with_negative_length_not_-1.replay │ │ │ └── read_of_nonexistent_key_fails.replay │ │ ├── TestSignedURL.replay │ │ ├── TestUploadDownload.replay │ │ └── TestWrite │ │ │ ├── ContentType_is_discovered_if_not_provided.replay │ │ │ ├── ContentType_is_left_empty_if_not_provided_and_DisableContentTypeDetection_is_true.replay │ │ │ ├── Content_md5_did_not_match,_blob_existed.replay │ │ │ ├── Content_md5_did_not_match.replay │ │ │ ├── Content_md5_match.replay │ │ │ ├── a_large_jpg_file_gets_a_ContentType.replay │ │ │ ├── a_large_jpg_file_written_in_two_chunks_gets_a_ContentType.replay │ │ │ ├── a_small_text_file_gets_a_ContentType.replay │ │ │ ├── invalid_ContentType_fails.replay │ │ │ ├── no_write_then_close_results_in_empty_blob,_blob_existed.replay │ │ │ ├── no_write_then_close_results_in_empty_blob.replay │ │ │ ├── write_to_empty_key_fails.replay │ │ │ └── write_with_explicit_ContentType_overrides_discovery.replay │ │ ├── TestOpenBucket │ │ ├── empty_bucket_name_results_in_error.replay │ │ └── success.replay │ │ └── TestPreconditions.replay ├── memblob │ ├── example_test.go │ ├── memblob.go │ └── memblob_test.go ├── oc_test.go ├── s3blob │ ├── example_test.go │ ├── s3blob.go │ ├── s3blob_test.go │ └── testdata │ │ ├── TestConformance │ │ ├── TestAs │ │ │ ├── verify_As_returns_false_when_passed_nil.replay │ │ │ └── verify_ContentLanguage_can_be_written_and_read_through_As.replay │ │ ├── TestAttributes.replay │ │ ├── TestCanceledWrite │ │ │ ├── BlobExists.replay │ │ │ ├── EmptyContentType.replay │ │ │ └── NonEmptyContentType.replay │ │ ├── TestConcurrentWriteAndRead.replay │ │ ├── TestCopy │ │ │ ├── NonExistentSourceFails.replay │ │ │ └── Works.replay │ │ ├── TestDelete │ │ │ ├── NonExistentFails.replay │ │ │ └── Works.replay │ │ ├── TestDirsWithCharactersBeforeDelimiter.replay │ │ ├── TestIfNotExist.replay │ │ ├── TestKeys │ │ │ ├── ascii-1.replay │ │ │ ├── ascii-2.replay │ │ │ ├── ascii-3.replay │ │ │ ├── ascii-4.replay │ │ │ ├── ascii-5.replay │ │ │ ├── ascii-6.replay │ │ │ ├── ascii-7.replay │ │ │ ├── ascii-8.replay │ │ │ ├── backslashes.replay │ │ │ ├── dotdotbackslash.replay │ │ │ ├── dotdotslash.replay │ │ │ ├── fwdslashes.replay │ │ │ ├── non-UTF8_fails.replay │ │ │ ├── quote.replay │ │ │ ├── repeatedbackslashes.replay │ │ │ ├── repeatedfwdslashes.replay │ │ │ ├── spaces.replay │ │ │ ├── startwithdigit.replay │ │ │ └── unicode.replay │ │ ├── TestList │ │ │ ├── PaginationConsistencyAfterDelete.replay │ │ │ ├── PaginationConsistencyAfterInsert.replay │ │ │ ├── by_1.replay │ │ │ ├── by_2.replay │ │ │ ├── by_3.replay │ │ │ ├── exactly_1_object_due_to_prefix.replay │ │ │ ├── no_objects.replay │ │ │ └── no_pagination.replay │ │ ├── TestListDelimiters │ │ │ ├── abc.replay │ │ │ ├── backslash.replay │ │ │ └── fwdslash.replay │ │ ├── TestListWeirdKeys.replay │ │ ├── TestMD5.replay │ │ ├── TestMetadata │ │ │ ├── duplicate_case-insensitive_key_fails.replay │ │ │ ├── empty.replay │ │ │ ├── empty_key_fails.replay │ │ │ ├── non-utf8_metadata_key.replay │ │ │ ├── non-utf8_metadata_value.replay │ │ │ ├── valid_metadata.replay │ │ │ ├── valid_metadata_with_content_type.replay │ │ │ ├── valid_metadata_with_empty_body.replay │ │ │ └── weird_metadata_keys.replay │ │ ├── TestNonexistentBucket.replay │ │ ├── TestRead │ │ │ ├── length_0_read.replay │ │ │ ├── negative_offset_fails.replay │ │ │ ├── read_a_part_in_middle.replay │ │ │ ├── read_from_positive_offset_to_end.replay │ │ │ ├── read_in_full.replay │ │ │ ├── read_in_full_with_negative_length_not_-1.replay │ │ │ └── read_of_nonexistent_key_fails.replay │ │ ├── TestSignedURL.replay │ │ ├── TestUploadDownload.replay │ │ └── TestWrite │ │ │ ├── ContentType_is_discovered_if_not_provided.replay │ │ │ ├── ContentType_is_left_empty_if_not_provided_and_DisableContentTypeDetection_is_true.replay │ │ │ ├── Content_md5_did_not_match,_blob_existed.replay │ │ │ ├── Content_md5_did_not_match.replay │ │ │ ├── Content_md5_match.replay │ │ │ ├── a_large_jpg_file_gets_a_ContentType.replay │ │ │ ├── a_large_jpg_file_written_in_two_chunks_gets_a_ContentType.replay │ │ │ ├── a_small_text_file_gets_a_ContentType.replay │ │ │ ├── invalid_ContentType_fails.replay │ │ │ ├── no_write_then_close_results_in_empty_blob,_blob_existed.replay │ │ │ ├── no_write_then_close_results_in_empty_blob.replay │ │ │ ├── write_to_empty_key_fails.replay │ │ │ └── write_with_explicit_ContentType_overrides_discovery.replay │ │ ├── TestConformanceUsingLegacyList │ │ ├── TestAs │ │ │ ├── verify_As_returns_false_when_passed_nil.replay │ │ │ └── verify_ContentLanguage_can_be_written_and_read_through_As.replay │ │ ├── TestAttributes.replay │ │ ├── TestCanceledWrite │ │ │ ├── BlobExists.replay │ │ │ ├── EmptyContentType.replay │ │ │ └── NonEmptyContentType.replay │ │ ├── TestConcurrentWriteAndRead.replay │ │ ├── TestCopy │ │ │ ├── NonExistentSourceFails.replay │ │ │ └── Works.replay │ │ ├── TestDelete │ │ │ ├── NonExistentFails.replay │ │ │ └── Works.replay │ │ ├── TestDirsWithCharactersBeforeDelimiter.replay │ │ ├── TestIfNotExist.replay │ │ ├── TestKeys │ │ │ ├── ascii-1.replay │ │ │ ├── ascii-2.replay │ │ │ ├── ascii-3.replay │ │ │ ├── ascii-4.replay │ │ │ ├── ascii-5.replay │ │ │ ├── ascii-6.replay │ │ │ ├── ascii-7.replay │ │ │ ├── ascii-8.replay │ │ │ ├── backslashes.replay │ │ │ ├── dotdotbackslash.replay │ │ │ ├── dotdotslash.replay │ │ │ ├── fwdslashes.replay │ │ │ ├── non-UTF8_fails.replay │ │ │ ├── quote.replay │ │ │ ├── repeatedbackslashes.replay │ │ │ ├── repeatedfwdslashes.replay │ │ │ ├── spaces.replay │ │ │ ├── startwithdigit.replay │ │ │ └── unicode.replay │ │ ├── TestList │ │ │ ├── PaginationConsistencyAfterDelete.replay │ │ │ ├── PaginationConsistencyAfterInsert.replay │ │ │ ├── by_1.replay │ │ │ ├── by_2.replay │ │ │ ├── by_3.replay │ │ │ ├── exactly_1_object_due_to_prefix.replay │ │ │ ├── no_objects.replay │ │ │ └── no_pagination.replay │ │ ├── TestListDelimiters │ │ │ ├── abc.replay │ │ │ ├── backslash.replay │ │ │ └── fwdslash.replay │ │ ├── TestListWeirdKeys.replay │ │ ├── TestMD5.replay │ │ ├── TestMetadata │ │ │ ├── duplicate_case-insensitive_key_fails.replay │ │ │ ├── empty.replay │ │ │ ├── empty_key_fails.replay │ │ │ ├── non-utf8_metadata_key.replay │ │ │ ├── non-utf8_metadata_value.replay │ │ │ ├── valid_metadata.replay │ │ │ ├── valid_metadata_with_content_type.replay │ │ │ ├── valid_metadata_with_empty_body.replay │ │ │ └── weird_metadata_keys.replay │ │ ├── TestNonexistentBucket.replay │ │ ├── TestRead │ │ │ ├── length_0_read.replay │ │ │ ├── negative_offset_fails.replay │ │ │ ├── read_a_part_in_middle.replay │ │ │ ├── read_from_positive_offset_to_end.replay │ │ │ ├── read_in_full.replay │ │ │ ├── read_in_full_with_negative_length_not_-1.replay │ │ │ └── read_of_nonexistent_key_fails.replay │ │ ├── TestSignedURL.replay │ │ ├── TestUploadDownload.replay │ │ └── TestWrite │ │ │ ├── ContentType_is_discovered_if_not_provided.replay │ │ │ ├── ContentType_is_left_empty_if_not_provided_and_DisableContentTypeDetection_is_true.replay │ │ │ ├── Content_md5_did_not_match,_blob_existed.replay │ │ │ ├── Content_md5_did_not_match.replay │ │ │ ├── Content_md5_match.replay │ │ │ ├── a_large_jpg_file_gets_a_ContentType.replay │ │ │ ├── a_large_jpg_file_written_in_two_chunks_gets_a_ContentType.replay │ │ │ ├── a_small_text_file_gets_a_ContentType.replay │ │ │ ├── invalid_ContentType_fails.replay │ │ │ ├── no_write_then_close_results_in_empty_blob,_blob_existed.replay │ │ │ ├── no_write_then_close_results_in_empty_blob.replay │ │ │ ├── write_to_empty_key_fails.replay │ │ │ └── write_with_explicit_ContentType_overrides_discovery.replay │ │ └── TestOpenBucket │ │ ├── empty_bucket_name_results_in_error.replay │ │ ├── empty_bucket_name_results_in_error_V2.replay │ │ ├── success.replay │ │ └── success_V2.replay └── wrapped_bucket_test.go ├── doc.go ├── docstore ├── awsdynamodb │ ├── benchmark_test.go │ ├── codec.go │ ├── codec_test.go │ ├── create_tables.sh │ ├── dynamo.go │ ├── dynamo_test.go │ ├── example_test.go │ ├── query.go │ ├── query_test.go │ ├── testdata │ │ ├── TestConformance │ │ │ ├── ActionsOnStructNoRev.replay │ │ │ ├── ActionsWithCompositeID.replay │ │ │ ├── As │ │ │ │ ├── verify_As.replay │ │ │ │ ├── verify_As.yaml │ │ │ │ ├── verify_As_returns_false_when_passed_nil.replay │ │ │ │ └── verify_As_returns_false_when_passed_nil.yaml │ │ │ ├── AtomicWrites.replay │ │ │ ├── AtomicWritesFail.replay │ │ │ ├── BeforeDo.replay │ │ │ ├── BeforeQuery.replay │ │ │ ├── Create.replay │ │ │ ├── Data.replay │ │ │ ├── Delete.replay │ │ │ ├── ExampleInDoc.replay │ │ │ ├── Get.replay │ │ │ ├── GetQuery.replay │ │ │ ├── GetQueryKeyField.replay │ │ │ ├── MultipleActions.replay │ │ │ ├── Proto.replay │ │ │ ├── Put.replay │ │ │ ├── Replace.replay │ │ │ ├── SerializeRevision.replay │ │ │ └── Update.replay │ │ └── TestQueryErrors.replay │ ├── urls.go │ └── urls_test.go ├── doc.go ├── docstore.go ├── docstore_test.go ├── driver │ ├── actionkind_string.go │ ├── codec.go │ ├── codec_test.go │ ├── compare.go │ ├── compare_test.go │ ├── document.go │ ├── document_test.go │ ├── driver.go │ ├── util.go │ └── util_test.go ├── drivertest │ ├── driverbenchmark.go │ ├── drivertest.go │ └── util.go ├── example_test.go ├── gcpfirestore │ ├── codec.go │ ├── codec_test.go │ ├── create_indexes.sh │ ├── example_test.go │ ├── fs.go │ ├── fs_test.go │ ├── native_codec_test.go │ ├── query.go │ ├── query_test.go │ ├── testdata │ │ └── TestConformance │ │ │ ├── ActionsOnStructNoRev.replay │ │ │ ├── ActionsWithCompositeID.replay │ │ │ ├── As │ │ │ ├── verify_As.replay │ │ │ └── verify_As_returns_false_when_passed_nil.replay │ │ │ ├── AtomicWrites.replay │ │ │ ├── AtomicWritesFail.replay │ │ │ ├── BeforeDo.replay │ │ │ ├── BeforeQuery.replay │ │ │ ├── Create.replay │ │ │ ├── Data.replay │ │ │ ├── Delete.replay │ │ │ ├── ExampleInDoc.replay │ │ │ ├── Get.replay │ │ │ ├── GetQuery.replay │ │ │ ├── GetQueryKeyField.replay │ │ │ ├── MultipleActions.replay │ │ │ ├── Proto.replay │ │ │ ├── Put.replay │ │ │ ├── Query.replay │ │ │ ├── Replace.replay │ │ │ ├── SerializeRevision.replay │ │ │ └── Update.replay │ ├── urls.go │ └── urls_test.go ├── internal │ └── fields │ │ ├── README.md │ │ ├── fields.go │ │ ├── fields_test.go │ │ ├── fold.go │ │ └── fold_test.go ├── memdocstore │ ├── codec.go │ ├── codec_test.go │ ├── example_test.go │ ├── mem.go │ ├── mem_test.go │ ├── query.go │ ├── urls.go │ └── urls_test.go ├── mongodocstore │ ├── awsdocdb │ │ ├── main.tf │ │ ├── outputs.tf │ │ └── variables.tf │ ├── codec.go │ ├── cosmos_test.go │ ├── docdb_test.go │ ├── docker-compose.yml │ ├── example_test.go │ ├── go.mod │ ├── go.sum │ ├── localmongo.sh │ ├── mongo.go │ ├── mongo_test.go │ ├── query.go │ ├── testdata │ │ └── README │ ├── urls.go │ └── urls_test.go ├── oc_test.go ├── query.go ├── query_test.go ├── urls.go └── urls_test.go ├── gcerrors ├── errors.go └── errors_test.go ├── gcp ├── cloudsql │ └── cloudsql.go ├── gcp.go ├── gcp_test.go └── gcpcloud │ ├── example_test.go │ └── gcpcloud.go ├── go.mod ├── go.sum ├── gocloud.code-workspace ├── internal ├── docs │ ├── README.md │ ├── design.md │ ├── img │ │ ├── user-facing-type-no-driver.png │ │ └── user-facing-type.png │ ├── pubsub │ │ └── design.md │ └── release.md ├── escape │ ├── escape.go │ └── escape_test.go ├── gcerr │ ├── errorcode_string.go │ ├── gcerr.go │ └── gcerr_test.go ├── oc │ ├── metrics.go │ ├── trace.go │ └── trace_test.go ├── openurl │ ├── openurl.go │ └── openurl_test.go ├── otel │ ├── init.go │ ├── metrics.go │ ├── trace.go │ └── trace_test.go ├── releasehelper │ ├── releasehelper.go │ └── releasehelper_test.go ├── retry │ ├── retry.go │ └── retry_test.go ├── testing │ ├── alldeps │ ├── check_mod_tidy.sh │ ├── deploywebsite.sh │ ├── git_tag_modules.sh │ ├── gomodcleanup.sh │ ├── listdeps.sh │ ├── octest │ │ ├── diff.go │ │ └── exporter.go │ ├── oteltest │ │ ├── diff.go │ │ └── exporter.go │ ├── runchecks.sh │ ├── setup │ │ └── setup.go │ ├── start_local_deps.sh │ ├── terraform │ │ └── terraform.go │ ├── test-summary │ │ ├── test-summary.go │ │ └── test-summary_test.go │ └── update_deps.sh ├── useragent │ └── useragent.go └── website │ ├── .vscode │ └── tasks.json │ ├── README.md │ ├── archetypes │ ├── default.md │ └── howto.md │ ├── config.toml │ ├── content │ ├── _index.md │ ├── aws │ │ ├── _index.md │ │ ├── awscloud │ │ │ └── _index.md │ │ └── rds │ │ │ └── _index.md │ ├── azure │ │ ├── azurecloud │ │ │ └── _index.md │ │ └── azuredb │ │ │ └── _index.md │ ├── blob │ │ ├── _index.md │ │ ├── azureblob │ │ │ └── _index.md │ │ ├── driver │ │ │ └── _index.md │ │ ├── drivertest │ │ │ └── _index.md │ │ ├── fileblob │ │ │ └── _index.md │ │ ├── gcsblob │ │ │ └── _index.md │ │ ├── memblob │ │ │ └── _index.md │ │ └── s3blob │ │ │ └── _index.md │ ├── concepts │ │ ├── _index.md │ │ ├── as.md │ │ ├── structure │ │ │ ├── index.md │ │ │ ├── portable-type-no-driver.png │ │ │ └── portable-type.png │ │ └── urls.md │ ├── docstore │ │ ├── _index.md │ │ ├── awsdynamodb │ │ │ └── _index.md │ │ ├── driver │ │ │ └── _index.md │ │ ├── drivertest │ │ │ └── _index.md │ │ ├── dynamodocstore │ │ │ └── _index.md │ │ ├── firedocstore │ │ │ └── _index.md │ │ ├── gcpfirestore │ │ │ └── _index.md │ │ ├── internal │ │ │ └── fields │ │ │ │ └── _index.md │ │ ├── memdocstore │ │ │ └── _index.md │ │ └── mongodocstore │ │ │ └── _index.md │ ├── gcerrors │ │ └── _index.md │ ├── gcp │ │ ├── _index.md │ │ ├── cloudsql │ │ │ └── _index.md │ │ └── gcpcloud │ │ │ └── _index.md │ ├── health │ │ ├── _index.md │ │ └── sqlhealth │ │ │ └── _index.md │ ├── howto │ │ ├── _index.md │ │ ├── blob │ │ │ └── _index.md │ │ ├── docstore │ │ │ └── _index.md │ │ ├── pubsub │ │ │ ├── _index.md │ │ │ ├── publish.md │ │ │ └── subscribe.md │ │ ├── runtimevar │ │ │ └── _index.md │ │ ├── secrets │ │ │ └── _index.md │ │ ├── server │ │ │ └── _index.md │ │ └── sql │ │ │ └── _index.md │ ├── internal │ │ ├── batcher │ │ │ └── _index.md │ │ ├── escape │ │ │ └── _index.md │ │ ├── gcerr │ │ │ └── _index.md │ │ ├── oc │ │ │ └── _index.md │ │ ├── openurl │ │ │ └── _index.md │ │ ├── otel │ │ │ └── _index.md │ │ ├── releasehelper │ │ │ └── _index.md │ │ ├── retry │ │ │ └── _index.md │ │ ├── testing │ │ │ ├── _index.md │ │ │ ├── cmdtest │ │ │ │ └── _index.md │ │ │ ├── octest │ │ │ │ └── _index.md │ │ │ ├── oteltest │ │ │ │ └── _index.md │ │ │ ├── setup │ │ │ │ └── _index.md │ │ │ ├── terraform │ │ │ │ └── _index.md │ │ │ └── test-summary │ │ │ │ └── _index.md │ │ ├── trace │ │ │ └── _index.md │ │ ├── useragent │ │ │ └── _index.md │ │ └── website │ │ │ └── gatherexamples │ │ │ └── _index.md │ ├── mysql │ │ ├── _index.md │ │ ├── awsmysql │ │ │ └── _index.md │ │ ├── azuremysql │ │ │ └── _index.md │ │ ├── cloudmysql │ │ │ └── _index.md │ │ ├── gcpmysql │ │ │ └── _index.md │ │ └── rdsmysql │ │ │ └── _index.md │ ├── postgres │ │ ├── _index.md │ │ ├── awspostgres │ │ │ └── _index.md │ │ ├── cloudpostgres │ │ │ └── _index.md │ │ ├── gcppostgres │ │ │ └── _index.md │ │ └── rdspostgres │ │ │ └── _index.md │ ├── pubsub │ │ ├── _index.md │ │ ├── awssnssqs │ │ │ └── _index.md │ │ ├── azurepubsub │ │ │ └── _index.md │ │ ├── azuresb │ │ │ └── _index.md │ │ ├── batcher │ │ │ └── _index.md │ │ ├── driver │ │ │ └── _index.md │ │ ├── drivertest │ │ │ └── _index.md │ │ ├── gcppubsub │ │ │ └── _index.md │ │ ├── kafkapubsub │ │ │ └── _index.md │ │ ├── mempubsub │ │ │ └── _index.md │ │ ├── natspubsub │ │ │ └── _index.md │ │ └── rabbitpubsub │ │ │ └── _index.md │ ├── requestlog │ │ └── _index.md │ ├── runtimevar │ │ ├── _index.md │ │ ├── awsparamstore │ │ │ └── _index.md │ │ ├── awssecretsmanager │ │ │ └── _index.md │ │ ├── blobvar │ │ │ └── _index.md │ │ ├── constantvar │ │ │ └── _index.md │ │ ├── driver │ │ │ └── _index.md │ │ ├── drivertest │ │ │ └── _index.md │ │ ├── etcdvar │ │ │ └── _index.md │ │ ├── filevar │ │ │ ├── _demo │ │ │ │ └── _index.md │ │ │ └── _index.md │ │ ├── gcpruntimeconfig │ │ │ └── _index.md │ │ ├── gcpsecretmanager │ │ │ └── _index.md │ │ └── httpvar │ │ │ └── _index.md │ ├── samples │ │ ├── appengine │ │ │ └── _index.md │ │ ├── gocdk-blob │ │ │ └── _index.md │ │ ├── gocdk-docstore │ │ │ └── _index.md │ │ ├── gocdk-pubsub │ │ │ └── _index.md │ │ ├── gocdk-runtimevar │ │ │ └── _index.md │ │ ├── gocdk-secrets │ │ │ └── _index.md │ │ ├── guestbook │ │ │ ├── _index.md │ │ │ ├── aws │ │ │ │ └── provision_db │ │ │ │ │ └── _index.md │ │ │ ├── gcp │ │ │ │ ├── deploy │ │ │ │ │ └── _index.md │ │ │ │ └── provision_db │ │ │ │ │ └── _index.md │ │ │ └── localdb │ │ │ │ └── _index.md │ │ ├── order │ │ │ └── _index.md │ │ ├── server │ │ │ └── _index.md │ │ └── tutorial │ │ │ └── _index.md │ ├── secrets │ │ ├── _index.md │ │ ├── awskms │ │ │ └── _index.md │ │ ├── azurekeyvault │ │ │ └── _index.md │ │ ├── driver │ │ │ └── _index.md │ │ ├── drivertest │ │ │ └── _index.md │ │ ├── gcpkms │ │ │ └── _index.md │ │ ├── hashivault │ │ │ └── _index.md │ │ ├── localsecrets │ │ │ └── _index.md │ │ └── vault │ │ │ └── _index.md │ ├── server │ │ ├── _index.md │ │ ├── driver │ │ │ └── _index.md │ │ ├── health │ │ │ ├── _index.md │ │ │ └── sqlhealth │ │ │ │ └── _index.md │ │ ├── requestlog │ │ │ └── _index.md │ │ ├── sdserver │ │ │ └── _index.md │ │ └── xrayserver │ │ │ └── _index.md │ ├── tests │ │ ├── aws │ │ │ └── app │ │ │ │ └── _index.md │ │ ├── gcp │ │ │ └── app │ │ │ │ └── _index.md │ │ └── internal │ │ │ └── testutil │ │ │ └── _index.md │ └── tutorials │ │ ├── _index.md │ │ ├── cli-uploader.md │ │ ├── guestbook.md │ │ └── order.md │ ├── data │ └── examples.json │ ├── gatherexamples │ ├── gatherexamples.go │ ├── gatherexamples_test.go │ └── run.sh │ ├── go.mod │ ├── go.sum │ ├── layouts │ ├── 404.html │ ├── _default │ │ ├── baseof.html │ │ ├── li.html │ │ ├── list.html │ │ ├── single.html │ │ └── sitemap.xml │ ├── howto │ │ ├── li.html │ │ └── list.html │ ├── index.html │ ├── partials │ │ ├── header-link.html │ │ ├── hook_head_end.html │ │ └── page-toc.html │ ├── pkg │ │ ├── list.html │ │ └── single.html │ └── shortcodes │ │ ├── goexample.html │ │ └── snippet.html │ ├── listnewpkgs.sh │ ├── makeimports.sh │ └── static │ ├── css │ ├── style.css │ └── syntax.css │ ├── favicon-32x32.png │ ├── gh.png │ ├── go-cdk-logo-gopherblue-small.png │ ├── go-cdk-logo-gopherblue.png │ ├── go-cdk-logo-white.png │ └── placeholder-logo.png ├── mysql ├── awsmysql │ ├── awsmysql.go │ ├── awsmysql_test.go │ ├── example_test.go │ └── main.tf ├── azuremysql │ ├── azuremysql.go │ ├── azuremysql_test.go │ ├── example_test.go │ └── main.tf ├── example_test.go ├── gcpmysql │ ├── example_test.go │ ├── gcpmysql.go │ ├── gcpmysql_test.go │ └── main.tf ├── main.tf ├── mysql.go └── mysql_test.go ├── postgres ├── awspostgres │ ├── awspostgres.go │ ├── awspostgres_test.go │ ├── example_test.go │ └── main.tf ├── example_test.go ├── gcppostgres │ ├── example_test.go │ ├── gcppostgres.go │ ├── gcppostgres_test.go │ └── main.tf ├── postgres.go └── postgres_test.go ├── pubsub ├── acks_test.go ├── awssnssqs │ ├── awssnssqs.go │ ├── awssnssqs_test.go │ ├── example_test.go │ └── testdata │ │ ├── TestConformanceSNSTopic │ │ ├── TestAs │ │ │ ├── aws_test.replay │ │ │ └── verify_As_returns_false_when_passed_nil.replay │ │ ├── TestBatching.replay │ │ ├── TestCancelSendReceive.replay │ │ ├── TestDoubleAck.replay │ │ ├── TestErrorOnReceiveFromClosedSubscription.replay │ │ ├── TestErrorOnSendToClosedTopic.replay │ │ ├── TestMetadata.replay │ │ ├── TestNack.replay │ │ ├── TestNonExistentSubscriptionSucceedsOnOpenButFailsOnReceive.replay │ │ ├── TestNonExistentTopicSucceedsOnOpenButFailsOnSend.replay │ │ ├── TestNonUTF8MessageBody.replay │ │ ├── TestSendReceive.replay │ │ ├── TestSendReceiveJSON.replay │ │ └── TestSendReceiveTwo.replay │ │ ├── TestConformanceSNSTopicRaw │ │ ├── TestAs │ │ │ ├── aws_test.replay │ │ │ └── verify_As_returns_false_when_passed_nil.replay │ │ ├── TestBatching.replay │ │ ├── TestCancelSendReceive.replay │ │ ├── TestDoubleAck.replay │ │ ├── TestErrorOnReceiveFromClosedSubscription.replay │ │ ├── TestErrorOnSendToClosedTopic.replay │ │ ├── TestMetadata.replay │ │ ├── TestNack.replay │ │ ├── TestNonExistentSubscriptionSucceedsOnOpenButFailsOnReceive.replay │ │ ├── TestNonExistentTopicSucceedsOnOpenButFailsOnSend.replay │ │ ├── TestNonUTF8MessageBody.replay │ │ ├── TestSendReceive.replay │ │ ├── TestSendReceiveJSON.replay │ │ └── TestSendReceiveTwo.replay │ │ ├── TestConformanceSQSTopic │ │ ├── TestAs │ │ │ ├── aws_test.replay │ │ │ └── verify_As_returns_false_when_passed_nil.replay │ │ ├── TestBatching.replay │ │ ├── TestCancelSendReceive.replay │ │ ├── TestDoubleAck.replay │ │ ├── TestErrorOnReceiveFromClosedSubscription.replay │ │ ├── TestErrorOnSendToClosedTopic.replay │ │ ├── TestMetadata.replay │ │ ├── TestNack.replay │ │ ├── TestNonExistentSubscriptionSucceedsOnOpenButFailsOnReceive.replay │ │ ├── TestNonExistentTopicSucceedsOnOpenButFailsOnSend.replay │ │ ├── TestNonUTF8MessageBody.replay │ │ ├── TestSendReceive.replay │ │ ├── TestSendReceiveJSON.replay │ │ └── TestSendReceiveTwo.replay │ │ └── TestFIFO │ │ ├── TestSNSTopic │ │ ├── TestSendReceiveInvalidNoDeduplicationID.replay │ │ ├── TestSendReceiveInvalidNoMessageGroupID.replay │ │ └── TestSendReceiveValid.replay │ │ └── TestSQSTopic │ │ ├── TestSendReceiveInvalidNoDeduplicationID.replay │ │ ├── TestSendReceiveInvalidNoMessageGroupID.replay │ │ └── TestSendReceiveValid.replay ├── azuresb │ ├── azuresb.go │ ├── azuresb_test.go │ ├── example_test.go │ └── testdata │ │ └── README ├── batcher │ ├── batcher.go │ └── batcher_test.go ├── benchmark_test.go ├── driver │ └── driver.go ├── drivertest │ └── drivertest.go ├── example_test.go ├── gcppubsub │ ├── example_test.go │ ├── gcppubsub.go │ ├── gcppubsub_test.go │ └── testdata │ │ └── TestConformance │ │ ├── TestAs │ │ ├── gcp_test.replay │ │ └── verify_As_returns_false_when_passed_nil.replay │ │ ├── TestBatching.replay │ │ ├── TestCancelSendReceive.replay │ │ ├── TestDoubleAck.replay │ │ ├── TestErrorOnReceiveFromClosedSubscription.replay │ │ ├── TestErrorOnSendToClosedTopic.replay │ │ ├── TestMetadata.replay │ │ ├── TestNack.replay │ │ ├── TestNonExistentSubscriptionSucceedsOnOpenButFailsOnReceive.replay │ │ ├── TestNonExistentTopicSucceedsOnOpenButFailsOnSend.replay │ │ ├── TestNonUTF8MessageBody.replay │ │ ├── TestSendReceive.replay │ │ ├── TestSendReceiveJSON.replay │ │ └── TestSendReceiveTwo.replay ├── kafkapubsub │ ├── example_test.go │ ├── go.mod │ ├── go.sum │ ├── kafka.go │ ├── kafka_test.go │ └── localkafka.sh ├── mempubsub │ ├── conformance_test.go │ ├── example_test.go │ ├── mem.go │ └── mem_test.go ├── natspubsub │ ├── example_test.go │ ├── go.mod │ ├── go.sum │ ├── nats.go │ └── nats_test.go ├── pub_test.go ├── pubsub.go ├── pubsub_test.go ├── rabbitpubsub │ ├── amqp.go │ ├── doc.go │ ├── example_test.go │ ├── fake_test.go │ ├── go.mod │ ├── go.sum │ ├── localrabbit.sh │ ├── rabbit.go │ └── rabbit_test.go └── sub_test.go ├── runtimevar ├── awsparamstore │ ├── awsparamstore.go │ ├── awsparamstore_test.go │ ├── example_test.go │ └── testdata │ │ └── TestConformance │ │ ├── TestAs │ │ ├── verify_As.replay │ │ └── verify_As_returns_false_when_passed_nil.replay │ │ ├── TestDelete.replay │ │ ├── TestInvalidJSON.replay │ │ ├── TestJSON.replay │ │ ├── TestNonExistentVariable.replay │ │ ├── TestString.replay │ │ ├── TestUpdate.replay │ │ └── TestUpdateWithErrors.replay ├── awssecretsmanager │ ├── awssecretsmanager.go │ ├── awssecretsmanager_test.go │ ├── example_test.go │ └── testdata │ │ └── TestConformance │ │ ├── TestAs │ │ ├── verify_As.replay │ │ └── verify_As_returns_false_when_passed_nil.replay │ │ ├── TestConformanceV2 │ │ ├── TestAs │ │ │ ├── verify_As.replay │ │ │ └── verify_As_returns_false_when_passed_nil.replay │ │ ├── TestDelete.replay │ │ ├── TestInvalidJSON.replay │ │ ├── TestJSON.replay │ │ ├── TestNonExistentVariable.replay │ │ ├── TestString.replay │ │ ├── TestUpdate.replay │ │ └── TestUpdateWithErrors.replay │ │ ├── TestDelete.replay │ │ ├── TestInvalidJSON.replay │ │ ├── TestJSON.replay │ │ ├── TestNonExistentVariable.replay │ │ ├── TestString.replay │ │ ├── TestUpdate.replay │ │ └── TestUpdateWithErrors.replay ├── blobvar │ ├── blobvar.go │ ├── blobvar_test.go │ └── example_test.go ├── constantvar │ ├── constantvar.go │ ├── constantvar_test.go │ └── example_test.go ├── driver │ └── driver.go ├── drivertest │ └── drivertest.go ├── etcdvar │ ├── etcdvar.go │ ├── etcdvar_test.go │ ├── example_test.go │ ├── go.mod │ ├── go.sum │ └── localetcd.sh ├── example_openvariable_test.go ├── example_test.go ├── filevar │ ├── example_test.go │ ├── filevar.go │ └── filevar_test.go ├── gcpruntimeconfig │ ├── example_test.go │ ├── gcpruntimeconfig.go │ ├── gcpruntimeconfig_test.go │ └── testdata │ │ └── TestConformance │ │ ├── TestAs │ │ ├── verify_As.replay │ │ └── verify_As_returns_false_when_passed_nil.replay │ │ ├── TestDelete.replay │ │ ├── TestInvalidJSON.replay │ │ ├── TestJSON.replay │ │ ├── TestNonExistentVariable.replay │ │ ├── TestString.replay │ │ ├── TestUpdate.replay │ │ └── TestUpdateWithErrors.replay ├── gcpsecretmanager │ ├── example_test.go │ ├── gcpsecretmanager.go │ ├── gcpsecretmanager_test.go │ └── testdata │ │ └── TestConformance │ │ ├── TestAs │ │ ├── verify_As.replay │ │ └── verify_As_returns_false_when_passed_nil.replay │ │ ├── TestDelete.replay │ │ ├── TestInvalidJSON.replay │ │ ├── TestJSON.replay │ │ ├── TestNonExistentVariable.replay │ │ ├── TestString.replay │ │ ├── TestUpdate.replay │ │ └── TestUpdateWithErrors.replay ├── httpvar │ ├── example_test.go │ ├── httpvar.go │ └── httpvar_test.go ├── oc_test.go ├── runtimevar.go └── runtimevar_test.go ├── samples ├── appengine │ ├── .gcloudignore │ ├── .vscode │ │ └── tasks.json │ ├── README.md │ ├── app.yaml │ └── helloworld.go ├── go.mod ├── go.sum ├── gocdk-blob │ ├── blob.ct │ ├── main.go │ └── main_test.go ├── gocdk-docstore │ ├── docstore.ct │ ├── main.go │ └── main_test.go ├── gocdk-pubsub │ ├── main.go │ ├── main_test.go │ └── pubsub.ct ├── gocdk-runtimevar │ ├── main.go │ ├── main_test.go │ └── runtimevar.ct ├── gocdk-secrets │ ├── main.go │ ├── main_test.go │ └── secrets.ct ├── guestbook │ ├── README.md │ ├── aws │ │ ├── main.tf │ │ ├── outputs.tf │ │ ├── provision_db │ │ │ └── main.go │ │ └── variables.tf │ ├── azure │ │ ├── main.tf │ │ ├── outputs.tf │ │ └── variables.tf │ ├── blobs │ │ ├── aws.png │ │ ├── azure.png │ │ ├── gcp.png │ │ ├── gophers.jpg │ │ └── motd.txt │ ├── gcp │ │ ├── .gcloudignore │ │ ├── Dockerfile │ │ ├── deploy │ │ │ └── main.go │ │ ├── guestbook.yaml.in │ │ ├── main.tf │ │ ├── outputs.tf │ │ ├── provision_db │ │ │ └── main.go │ │ └── variables.tf │ ├── inject_aws.go │ ├── inject_azure.go │ ├── inject_gcp.go │ ├── inject_local.go │ ├── localdb │ │ └── main.go │ ├── main.go │ ├── roles.sql │ ├── schema.sql │ └── wire_gen.go ├── order │ ├── common.go │ ├── frontend.go │ ├── frontend_test.go │ ├── index.html │ ├── list.htmlt │ ├── order-form.htmlt │ ├── order.go │ ├── processor.go │ ├── processor_test.go │ ├── style.css │ └── testdata │ │ ├── bad-image │ │ └── cat1 ├── server │ └── main.go ├── tutorial │ ├── README.md │ ├── gopher.png │ └── main.go └── wire │ └── README.md ├── secrets ├── awskms │ ├── example_test.go │ ├── kms.go │ ├── kms_test.go │ └── testdata │ │ └── TestConformance │ │ ├── TestAs │ │ ├── verify_As_function.replay │ │ └── verify_As_returns_false_when_passed_nil.replay │ │ ├── TestDecryptMalformedError.replay │ │ ├── TestEncryptDecrypt.replay │ │ ├── TestMultipleEncryptionsNotEqual.replay │ │ └── TestMultipleKeys.replay ├── azurekeyvault │ ├── akv.go │ ├── akv_test.go │ ├── example_test.go │ └── testdata │ │ └── TestConformance │ │ ├── TestAs │ │ ├── verify_As_function.replay │ │ └── verify_As_returns_false_when_passed_nil.replay │ │ ├── TestDecryptMalformedError.replay │ │ ├── TestEncryptDecrypt.replay │ │ ├── TestMultipleEncryptionsNotEqual.replay │ │ └── TestMultipleKeys.replay ├── driver │ └── driver.go ├── drivertest │ └── drivertest.go ├── example_openkeeper_test.go ├── example_test.go ├── gcpkms │ ├── example_test.go │ ├── kms.go │ ├── kms_test.go │ └── testdata │ │ └── TestConformance │ │ ├── TestAs │ │ ├── verify_As_function.replay │ │ └── verify_As_returns_false_when_passed_nil.replay │ │ ├── TestDecryptMalformedError.replay │ │ ├── TestEncryptDecrypt.replay │ │ ├── TestMultipleEncryptionsNotEqual.replay │ │ └── TestMultipleKeys.replay ├── hashivault │ ├── example_test.go │ ├── go.mod │ ├── go.sum │ ├── localvault.sh │ ├── vault.go │ └── vault_test.go ├── localsecrets │ ├── example_test.go │ ├── localsecrets.go │ └── localsecrets_test.go ├── secrets.go └── secrets_test.go ├── server ├── driver │ └── driver.go ├── example_test.go ├── health │ ├── health.go │ ├── health_test.go │ └── sqlhealth │ │ ├── sqlhealth.go │ │ └── sqlhealth_test.go ├── requestlog │ ├── ncsa.go │ ├── ncsa_test.go │ ├── requestlog.go │ ├── requestlog_test.go │ ├── stackdriver.go │ └── stackdriver_test.go ├── sdserver │ └── server.go ├── server.go ├── server_test.go └── xrayserver │ └── server.go └── wire └── README.md /.codecov.yml: -------------------------------------------------------------------------------- 1 | codecov: 2 | token: 47dfd1fc-dc72-4d25-b608-eca6508efd05 3 | 4 | coverage: 5 | status: 6 | project: 7 | default: 8 | target: 0 9 | threshold: null 10 | base: auto 11 | patch: 12 | default: 13 | target: 0 14 | threshold: null 15 | base: auto 16 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text eol=lf 2 | *.png -text 3 | samples/order/testdata/* -text 4 | /internal/website/data/examples.json linguist-generated=true 5 | **/testdata/**/*.yaml linguist-generated=true 6 | **/testdata/**/*.replay linguist-generated=true 7 | *.replay binary 8 | 9 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | 5 | --- 6 | 7 | Please use a title starting with the name of the affected package, or \"all\", 8 | followed by a colon, followed by a short summary of the issue. Example: 9 | `blob/gcsblob: not blobby enough`. 10 | 11 | You can use `go bug` to have a cool, automatically filled out bug template, or 12 | fill out the template below. 13 | 14 | ### Describe the bug 15 | 16 | A clear and concise description of what the bug is. 17 | 18 | ### To Reproduce 19 | 20 | Steps to reproduce the behavior. 21 | 22 | ## Expected behavior 23 | 24 | A clear and concise description of what you expected to happen. 25 | 26 | ### Version 27 | 28 | Which version(s) of the Go Cloud modules are you seeing the bug with? 29 | 30 | ### Additional context 31 | 32 | Add any other context about the problem here. 33 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | 5 | --- 6 | 7 | Please use a title starting with the name of the affected package, or \"all\", 8 | followed by a colon, followed by a short summary of the feature request. 9 | Example: `blob/gcsblob: add support for more blobbing`. 10 | 11 | ### Is your feature request related to a problem? Please describe. 12 | 13 | A clear and concise description of what the problem is. Ex. I'm always 14 | frustrated when [...] 15 | 16 | ### Describe the solution you'd like 17 | 18 | A clear and concise description of what you want to happen. 19 | 20 | ### Describe alternatives you've considered 21 | 22 | A clear and concise description of any alternative solutions or features you've 23 | considered. 24 | 25 | ### Additional context 26 | 27 | Add any other context or screenshots about the feature request here. 28 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | Please use a title starting with the name of the affected package, or \"all\", 2 | followed by a colon, followed by a short summary of the issue. Example: 3 | `blob/gcsblob: fix typo in documentation`. 4 | 5 | Please reference any Issue related to this Pull Request. Example: `Fixes #1`. 6 | 7 | See 8 | [here](https://blog.github.com/2015-01-21-how-to-write-the-perfect-pull-request/) 9 | for tips on good Pull Request description. 10 | -------------------------------------------------------------------------------- /.github/workflows/tests.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2021 The Go Cloud Development Kit Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | name: tests 16 | on: [push, pull_request] 17 | jobs: 18 | build: 19 | strategy: 20 | fail-fast: false 21 | matrix: 22 | # Note: we used to include windows-latest, but it's super 23 | # flaky on Github runners, lots of OOMs. 24 | os: [ubuntu-latest, macos-latest] 25 | # When updating this, make sure to also update the 26 | # latest_go_version variable in internal/testing/runchecks.sh. 27 | go-version: [1.24.x] 28 | include: 29 | - go-version: 1.23.x 30 | os: ubuntu-latest 31 | 32 | runs-on: ${{ matrix.os }} 33 | steps: 34 | - name: Install Go 35 | uses: actions/setup-go@v2 36 | with: 37 | go-version: ${{ matrix.go-version }} 38 | - name: Checkout code 39 | uses: actions/checkout@v2 40 | with: 41 | fetch-depth: 2 # required for codecov 42 | - name: Run Tests 43 | shell: bash 44 | run: 'internal/testing/runchecks.sh' 45 | - if: matrix.os == 'ubuntu-latest' 46 | name: Build for dragonfly 47 | run: | 48 | go install ./... 49 | env: 50 | GOARCH: amd64 51 | GOOS: dragonfly 52 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.dll 4 | *.so 5 | *.dylib 6 | /internal/contributebot/contributebot 7 | /internal/cmd/gocdk/gocdk 8 | /internal/website/gatherexamples/gatherexamples 9 | /internal/website/public/ 10 | /internal/testing/test-summary/test-summary 11 | /samples/gocdk-blob/gocdk-blob 12 | /samples/gocdk-docstore/gocdk-docstore 13 | /samples/gocdk-pubsub/gocdk-pubsub 14 | /samples/gocdk-runtimevar/gocdk-runtimevar 15 | /samples/gocdk-secrets/gocdk-secrets 16 | /samples/guestbook/guestbook 17 | /samples/guestbook/gcp/guestbook 18 | /samples/tutorial/tutorial 19 | /samples/tutorial/upload 20 | 21 | # Test binary, build with `go test -c` 22 | *.test 23 | 24 | # Output of the go coverage tool, specifically when used with LiteIDE 25 | *.out 26 | 27 | # Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736 28 | .glide/ 29 | 30 | # Go vendor directory 31 | vendor/ 32 | 33 | # Populated config files 34 | /internal/contributebot/dev/ 35 | /internal/contributebot/webhook/app.yaml 36 | /tests/gcp/app/gcp-test.yaml 37 | 38 | # Cryptographic keys 39 | *.pem 40 | 41 | # Terraform Temporary Files 42 | *.tfstate 43 | *.tfstate.* 44 | .terraform/ 45 | terraform.tfvars 46 | 47 | # OSX leaves these everywhere on SMB shares 48 | ._* 49 | 50 | # OSX stuff 51 | .DS_Store 52 | 53 | # Eclipse files 54 | .classpath 55 | .project 56 | .settings/** 57 | 58 | # Files generated by JetBrains IDEs, e.g. Goland 59 | .idea/ 60 | *.iml 61 | 62 | # VSCode files 63 | .vscode 64 | 65 | # Emacs save files 66 | *~ 67 | \#*\# 68 | .\#* 69 | 70 | # Vim-related files 71 | [._]*.s[a-w][a-z] 72 | [._]s[a-w][a-z] 73 | *.un~ 74 | Session.vim 75 | .netrwhist 76 | 77 | # Mercurial files 78 | **/.hg 79 | **/.hg* 80 | 81 | # runtimevar/etcdvar tests create this directory. 82 | runtimevar/etcdvar/default.etcd 83 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "search.exclude": { 3 | "**/*.replay": true, 4 | "**/testdata/**/*.yaml": true 5 | } 6 | } -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=733558 3 | // for the documentation about the tasks.json format 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "label": "Test", 8 | "type": "shell", 9 | "command": "internal/testing/runchecks.sh", 10 | "group": { 11 | "kind": "test", 12 | "isDefault": true 13 | } 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of Go Cloud Development Kit authors for copyright 2 | # purposes. 3 | # This file is distinct from the CONTRIBUTORS files. 4 | # See the latter for an explanation. 5 | 6 | # Names should be added to this file as one of 7 | # Organization's name 8 | # Individual's name 9 | # Individual's name 10 | # See CONTRIBUTORS for the meaning of multiple email addresses. 11 | 12 | # Please keep the list sorted. 13 | 14 | Andrey Chernov 15 | Ben Hinchley 16 | Boris Popovschi 17 | Gerasimos (Makis) Maropoulos 18 | Google LLC 19 | Oleg Kovalov 20 | oliverpool 21 | Sendil Kumar N 22 | Steve Jiang 23 | Vishal Saroopchand 24 | Zachary Romero 25 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Code of Conduct 2 | 3 | This project is covered under the [Go Code of Conduct][]. In summary: 4 | 5 | - Treat everyone with respect and kindness. 6 | - Be thoughtful in how you communicate. 7 | - Don’t be destructive or inflammatory. 8 | - If you encounter an issue, please mail conduct@golang.org. 9 | 10 | [Go Code of Conduct]: https://golang.org/conduct 11 | -------------------------------------------------------------------------------- /allmodules: -------------------------------------------------------------------------------- 1 | # This file lists all the modules in our repository; it's used by scripts that 2 | # have to perform operations for each module. 3 | # 4 | # Any line that doesn't begin with a '#' character and isn't empty is treated 5 | # as a path relative to the top of the repository that has a module in it. 6 | # The 'released' field specifies whether this is a module we release and tag (a 7 | # module importable by users). 8 | # 9 | # Note: another file that lists all the modules in our repo is 10 | # the VSCode workspace gocloud.code-workspace - for now it has to be updated 11 | # manually whenever this file changes. 12 | 13 | # module-directory released 14 | . yes 15 | docstore/mongodocstore yes 16 | internal/website no 17 | pubsub/kafkapubsub yes 18 | pubsub/natspubsub yes 19 | pubsub/rabbitpubsub yes 20 | runtimevar/etcdvar yes 21 | samples no 22 | secrets/hashivault yes 23 | -------------------------------------------------------------------------------- /aws/awscloud/awscloud.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Cloud Development Kit Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package awscloud contains Wire providers for AWS services. 16 | package awscloud // import "gocloud.dev/aws/awscloud" 17 | 18 | import ( 19 | "net/http" 20 | 21 | "github.com/google/wire" 22 | "gocloud.dev/aws" 23 | "gocloud.dev/aws/rds" 24 | "gocloud.dev/blob/s3blob" 25 | "gocloud.dev/docstore/awsdynamodb" 26 | "gocloud.dev/pubsub/awssnssqs" 27 | "gocloud.dev/runtimevar/awsparamstore" 28 | "gocloud.dev/secrets/awskms" 29 | "gocloud.dev/server/xrayserver" 30 | ) 31 | 32 | // AWS is a Wire provider set that includes all Amazon Web Services interface 33 | // implementations in the Go CDK and authenticates using the default session. 34 | var AWS = wire.NewSet( 35 | Services, 36 | aws.DefaultSession, 37 | aws.NewDefaultV2Config, 38 | wire.Value(http.DefaultClient), 39 | ) 40 | 41 | // Services is a Wire provider set that includes the default wiring for all 42 | // Amazon Web Services interface implementations in the Go CDK but unlike the 43 | // AWS set, does not include credentials. Individual services may require 44 | // additional configuration. 45 | var Services = wire.NewSet( 46 | s3blob.Set, 47 | awssnssqs.Set, 48 | awsparamstore.Set, 49 | awskms.Set, 50 | rds.CertFetcherSet, 51 | awsdynamodb.Set, 52 | xrayserver.Set, 53 | ) 54 | -------------------------------------------------------------------------------- /azure/azurecloud/azurecloud.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Cloud Development Kit Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package azurecloud contains Wire providers for Azure services. 16 | package azurecloud // import "gocloud.dev/azure/azurecloud" 17 | 18 | import ( 19 | "github.com/google/wire" 20 | "gocloud.dev/blob/azureblob" 21 | "gocloud.dev/secrets/azurekeyvault" 22 | ) 23 | 24 | // Azure is a Wire provider set that includes the default wiring for all 25 | // Microsoft Azure services in this repository, but does not include 26 | // credentials. Individual services may require additional configuration. 27 | var Azure = wire.NewSet( 28 | azurekeyvault.Set, 29 | azureblob.Set, 30 | ) 31 | -------------------------------------------------------------------------------- /blob/azureblob/testdata/TestConformance/TestKeys/non-UTF8_fails.replay: -------------------------------------------------------------------------------- 1 | { 2 | "Initial": "AQAAAA7dviK7HVicvwAA", 3 | "Version": "0.2", 4 | "Converter": { 5 | "ScrubBody": [ 6 | "\u003cBlock(l|L)ist\u003e\u003cLatest\u003e.*\u003c/Latest\u003e\u003c/Block(l|L)ist\u003e" 7 | ], 8 | "ClearHeaders": [ 9 | "^X-Goog-.*Encryption-Key$", 10 | "^X-Ms-Date$", 11 | "^X-Ms-Version$", 12 | "^User-Agent$" 13 | ], 14 | "RemoveRequestHeaders": [ 15 | "^Authorization$", 16 | "^Proxy-Authorization$", 17 | "^Connection$", 18 | "^Content-Type$", 19 | "^Date$", 20 | "^Host$", 21 | "^Transfer-Encoding$", 22 | "^Via$", 23 | "^X-Forwarded-.*$", 24 | "^X-Cloud-Trace-Context$", 25 | "^X-Goog-Api-Client$", 26 | "^X-Google-.*$", 27 | "^X-Gfe-.*$" 28 | ], 29 | "RemoveResponseHeaders": [ 30 | "^X-Google-.*$", 31 | "^X-Gfe-.*$" 32 | ], 33 | "ClearParams": [ 34 | "^blockid$" 35 | ], 36 | "RemoveParams": [ 37 | "^se$", 38 | "^sig$", 39 | "^st$", 40 | "^X-Ms-Date$" 41 | ] 42 | }, 43 | "Entries": null 44 | } -------------------------------------------------------------------------------- /blob/azureblob/testdata/TestConformance/TestMetadata/duplicate_case-insensitive_key_fails.replay: -------------------------------------------------------------------------------- 1 | { 2 | "Initial": "AQAAAA7dVMCjCuQd1QAA", 3 | "Version": "0.2", 4 | "Converter": { 5 | "ScrubBody": [ 6 | "\u003cBlock(l|L)ist\u003e\u003cLatest\u003e.*\u003c/Latest\u003e\u003c/Block(l|L)ist\u003e" 7 | ], 8 | "ClearHeaders": [ 9 | "^X-Goog-.*Encryption-Key$", 10 | "^X-Ms-Date$", 11 | "^X-Ms-Version$", 12 | "^User-Agent$" 13 | ], 14 | "RemoveRequestHeaders": [ 15 | "^Authorization$", 16 | "^Proxy-Authorization$", 17 | "^Connection$", 18 | "^Content-Type$", 19 | "^Date$", 20 | "^Host$", 21 | "^Transfer-Encoding$", 22 | "^Via$", 23 | "^X-Forwarded-.*$", 24 | "^X-Cloud-Trace-Context$", 25 | "^X-Goog-Api-Client$", 26 | "^X-Google-.*$", 27 | "^X-Gfe-.*$" 28 | ], 29 | "RemoveResponseHeaders": [ 30 | "^X-Google-.*$", 31 | "^X-Gfe-.*$" 32 | ], 33 | "ClearParams": [ 34 | "^blockid$" 35 | ], 36 | "RemoveParams": [ 37 | "^se$", 38 | "^sig$", 39 | "^st$", 40 | "^X-Ms-Date$" 41 | ] 42 | }, 43 | "Entries": null 44 | } -------------------------------------------------------------------------------- /blob/azureblob/testdata/TestConformance/TestMetadata/empty_key_fails.replay: -------------------------------------------------------------------------------- 1 | { 2 | "Initial": "AQAAAA7dVMCjCtuhkQAA", 3 | "Version": "0.2", 4 | "Converter": { 5 | "ScrubBody": [ 6 | "\u003cBlock(l|L)ist\u003e\u003cLatest\u003e.*\u003c/Latest\u003e\u003c/Block(l|L)ist\u003e" 7 | ], 8 | "ClearHeaders": [ 9 | "^X-Goog-.*Encryption-Key$", 10 | "^X-Ms-Date$", 11 | "^X-Ms-Version$", 12 | "^User-Agent$" 13 | ], 14 | "RemoveRequestHeaders": [ 15 | "^Authorization$", 16 | "^Proxy-Authorization$", 17 | "^Connection$", 18 | "^Content-Type$", 19 | "^Date$", 20 | "^Host$", 21 | "^Transfer-Encoding$", 22 | "^Via$", 23 | "^X-Forwarded-.*$", 24 | "^X-Cloud-Trace-Context$", 25 | "^X-Goog-Api-Client$", 26 | "^X-Google-.*$", 27 | "^X-Gfe-.*$" 28 | ], 29 | "RemoveResponseHeaders": [ 30 | "^X-Google-.*$", 31 | "^X-Gfe-.*$" 32 | ], 33 | "ClearParams": [ 34 | "^blockid$" 35 | ], 36 | "RemoveParams": [ 37 | "^se$", 38 | "^sig$", 39 | "^st$", 40 | "^X-Ms-Date$" 41 | ] 42 | }, 43 | "Entries": null 44 | } -------------------------------------------------------------------------------- /blob/azureblob/testdata/TestConformance/TestMetadata/non-utf8_metadata_key.replay: -------------------------------------------------------------------------------- 1 | { 2 | "Initial": "AQAAAA7dVMCjKaZQTQAA", 3 | "Version": "0.2", 4 | "Converter": { 5 | "ScrubBody": [ 6 | "\u003cBlock(l|L)ist\u003e\u003cLatest\u003e.*\u003c/Latest\u003e\u003c/Block(l|L)ist\u003e" 7 | ], 8 | "ClearHeaders": [ 9 | "^X-Goog-.*Encryption-Key$", 10 | "^X-Ms-Date$", 11 | "^X-Ms-Version$", 12 | "^User-Agent$" 13 | ], 14 | "RemoveRequestHeaders": [ 15 | "^Authorization$", 16 | "^Proxy-Authorization$", 17 | "^Connection$", 18 | "^Content-Type$", 19 | "^Date$", 20 | "^Host$", 21 | "^Transfer-Encoding$", 22 | "^Via$", 23 | "^X-Forwarded-.*$", 24 | "^X-Cloud-Trace-Context$", 25 | "^X-Goog-Api-Client$", 26 | "^X-Google-.*$", 27 | "^X-Gfe-.*$" 28 | ], 29 | "RemoveResponseHeaders": [ 30 | "^X-Google-.*$", 31 | "^X-Gfe-.*$" 32 | ], 33 | "ClearParams": [ 34 | "^blockid$" 35 | ], 36 | "RemoveParams": [ 37 | "^se$", 38 | "^sig$", 39 | "^st$", 40 | "^X-Ms-Date$" 41 | ] 42 | }, 43 | "Entries": null 44 | } -------------------------------------------------------------------------------- /blob/azureblob/testdata/TestConformance/TestMetadata/non-utf8_metadata_value.replay: -------------------------------------------------------------------------------- 1 | { 2 | "Initial": "AQAAAA7dVMCjKa5f2wAA", 3 | "Version": "0.2", 4 | "Converter": { 5 | "ScrubBody": [ 6 | "\u003cBlock(l|L)ist\u003e\u003cLatest\u003e.*\u003c/Latest\u003e\u003c/Block(l|L)ist\u003e" 7 | ], 8 | "ClearHeaders": [ 9 | "^X-Goog-.*Encryption-Key$", 10 | "^X-Ms-Date$", 11 | "^X-Ms-Version$", 12 | "^User-Agent$" 13 | ], 14 | "RemoveRequestHeaders": [ 15 | "^Authorization$", 16 | "^Proxy-Authorization$", 17 | "^Connection$", 18 | "^Content-Type$", 19 | "^Date$", 20 | "^Host$", 21 | "^Transfer-Encoding$", 22 | "^Via$", 23 | "^X-Forwarded-.*$", 24 | "^X-Cloud-Trace-Context$", 25 | "^X-Goog-Api-Client$", 26 | "^X-Google-.*$", 27 | "^X-Gfe-.*$" 28 | ], 29 | "RemoveResponseHeaders": [ 30 | "^X-Google-.*$", 31 | "^X-Gfe-.*$" 32 | ], 33 | "ClearParams": [ 34 | "^blockid$" 35 | ], 36 | "RemoveParams": [ 37 | "^se$", 38 | "^sig$", 39 | "^st$", 40 | "^X-Ms-Date$" 41 | ] 42 | }, 43 | "Entries": null 44 | } -------------------------------------------------------------------------------- /blob/azureblob/testdata/TestConformance/TestRead/negative_offset_fails.replay: -------------------------------------------------------------------------------- 1 | { 2 | "Initial": "AQAAAA7dVMB2BGHBpwAA", 3 | "Version": "0.2", 4 | "Converter": { 5 | "ScrubBody": [ 6 | "\u003cBlock(l|L)ist\u003e\u003cLatest\u003e.*\u003c/Latest\u003e\u003c/Block(l|L)ist\u003e" 7 | ], 8 | "ClearHeaders": [ 9 | "^X-Goog-.*Encryption-Key$", 10 | "^X-Ms-Date$", 11 | "^X-Ms-Version$", 12 | "^User-Agent$" 13 | ], 14 | "RemoveRequestHeaders": [ 15 | "^Authorization$", 16 | "^Proxy-Authorization$", 17 | "^Connection$", 18 | "^Content-Type$", 19 | "^Date$", 20 | "^Host$", 21 | "^Transfer-Encoding$", 22 | "^Via$", 23 | "^X-Forwarded-.*$", 24 | "^X-Cloud-Trace-Context$", 25 | "^X-Goog-Api-Client$", 26 | "^X-Google-.*$", 27 | "^X-Gfe-.*$" 28 | ], 29 | "RemoveResponseHeaders": [ 30 | "^X-Google-.*$", 31 | "^X-Gfe-.*$" 32 | ], 33 | "ClearParams": [ 34 | "^blockid$" 35 | ], 36 | "RemoveParams": [ 37 | "^se$", 38 | "^sig$", 39 | "^st$", 40 | "^X-Ms-Date$" 41 | ] 42 | }, 43 | "Entries": null 44 | } -------------------------------------------------------------------------------- /blob/gcsblob/testdata/TestConformance/TestKeys/non-UTF8_fails.replay: -------------------------------------------------------------------------------- 1 | { 2 | "Initial": "AQAAAA7eTdH6Ickc+wAA", 3 | "Version": "0.2", 4 | "Converter": { 5 | "ScrubBody": null, 6 | "ClearHeaders": [ 7 | "^X-Goog-.*Encryption-Key$", 8 | "^Expires$", 9 | "^Signature$", 10 | "^X-Goog-Gcs-Idempotency-Token$", 11 | "^User-Agent$" 12 | ], 13 | "RemoveRequestHeaders": [ 14 | "^Authorization$", 15 | "^Proxy-Authorization$", 16 | "^Connection$", 17 | "^Content-Type$", 18 | "^Date$", 19 | "^Host$", 20 | "^Transfer-Encoding$", 21 | "^Via$", 22 | "^X-Forwarded-.*$", 23 | "^X-Cloud-Trace-Context$", 24 | "^X-Goog-Api-Client$", 25 | "^X-Google-.*$", 26 | "^X-Gfe-.*$" 27 | ], 28 | "RemoveResponseHeaders": [ 29 | "^X-Google-.*$", 30 | "^X-Gfe-.*$" 31 | ], 32 | "ClearParams": [ 33 | "^Expires$", 34 | "^Signature$" 35 | ], 36 | "RemoveParams": null 37 | }, 38 | "Entries": null 39 | } -------------------------------------------------------------------------------- /blob/gcsblob/testdata/TestConformance/TestMetadata/duplicate_case-insensitive_key_fails.replay: -------------------------------------------------------------------------------- 1 | { 2 | "Initial": "AQAAAA7eTdH1Ax7uBAAA", 3 | "Version": "0.2", 4 | "Converter": { 5 | "ScrubBody": null, 6 | "ClearHeaders": [ 7 | "^X-Goog-.*Encryption-Key$", 8 | "^Expires$", 9 | "^Signature$", 10 | "^X-Goog-Gcs-Idempotency-Token$", 11 | "^User-Agent$" 12 | ], 13 | "RemoveRequestHeaders": [ 14 | "^Authorization$", 15 | "^Proxy-Authorization$", 16 | "^Connection$", 17 | "^Content-Type$", 18 | "^Date$", 19 | "^Host$", 20 | "^Transfer-Encoding$", 21 | "^Via$", 22 | "^X-Forwarded-.*$", 23 | "^X-Cloud-Trace-Context$", 24 | "^X-Goog-Api-Client$", 25 | "^X-Google-.*$", 26 | "^X-Gfe-.*$" 27 | ], 28 | "RemoveResponseHeaders": [ 29 | "^X-Google-.*$", 30 | "^X-Gfe-.*$" 31 | ], 32 | "ClearParams": [ 33 | "^Expires$", 34 | "^Signature$" 35 | ], 36 | "RemoveParams": null 37 | }, 38 | "Entries": null 39 | } -------------------------------------------------------------------------------- /blob/gcsblob/testdata/TestConformance/TestMetadata/empty_key_fails.replay: -------------------------------------------------------------------------------- 1 | { 2 | "Initial": "AQAAAA7eTdH1AxJLhAAA", 3 | "Version": "0.2", 4 | "Converter": { 5 | "ScrubBody": null, 6 | "ClearHeaders": [ 7 | "^X-Goog-.*Encryption-Key$", 8 | "^Expires$", 9 | "^Signature$", 10 | "^X-Goog-Gcs-Idempotency-Token$", 11 | "^User-Agent$" 12 | ], 13 | "RemoveRequestHeaders": [ 14 | "^Authorization$", 15 | "^Proxy-Authorization$", 16 | "^Connection$", 17 | "^Content-Type$", 18 | "^Date$", 19 | "^Host$", 20 | "^Transfer-Encoding$", 21 | "^Via$", 22 | "^X-Forwarded-.*$", 23 | "^X-Cloud-Trace-Context$", 24 | "^X-Goog-Api-Client$", 25 | "^X-Google-.*$", 26 | "^X-Gfe-.*$" 27 | ], 28 | "RemoveResponseHeaders": [ 29 | "^X-Google-.*$", 30 | "^X-Gfe-.*$" 31 | ], 32 | "ClearParams": [ 33 | "^Expires$", 34 | "^Signature$" 35 | ], 36 | "RemoveParams": null 37 | }, 38 | "Entries": null 39 | } -------------------------------------------------------------------------------- /blob/gcsblob/testdata/TestConformance/TestMetadata/non-utf8_metadata_key.replay: -------------------------------------------------------------------------------- 1 | { 2 | "Initial": "AQAAAA7eTdH3D9crlQAA", 3 | "Version": "0.2", 4 | "Converter": { 5 | "ScrubBody": null, 6 | "ClearHeaders": [ 7 | "^X-Goog-.*Encryption-Key$", 8 | "^Expires$", 9 | "^Signature$", 10 | "^X-Goog-Gcs-Idempotency-Token$", 11 | "^User-Agent$" 12 | ], 13 | "RemoveRequestHeaders": [ 14 | "^Authorization$", 15 | "^Proxy-Authorization$", 16 | "^Connection$", 17 | "^Content-Type$", 18 | "^Date$", 19 | "^Host$", 20 | "^Transfer-Encoding$", 21 | "^Via$", 22 | "^X-Forwarded-.*$", 23 | "^X-Cloud-Trace-Context$", 24 | "^X-Goog-Api-Client$", 25 | "^X-Google-.*$", 26 | "^X-Gfe-.*$" 27 | ], 28 | "RemoveResponseHeaders": [ 29 | "^X-Google-.*$", 30 | "^X-Gfe-.*$" 31 | ], 32 | "ClearParams": [ 33 | "^Expires$", 34 | "^Signature$" 35 | ], 36 | "RemoveParams": null 37 | }, 38 | "Entries": null 39 | } -------------------------------------------------------------------------------- /blob/gcsblob/testdata/TestConformance/TestMetadata/non-utf8_metadata_value.replay: -------------------------------------------------------------------------------- 1 | { 2 | "Initial": "AQAAAA7eTdH3D+KdHgAA", 3 | "Version": "0.2", 4 | "Converter": { 5 | "ScrubBody": null, 6 | "ClearHeaders": [ 7 | "^X-Goog-.*Encryption-Key$", 8 | "^Expires$", 9 | "^Signature$", 10 | "^X-Goog-Gcs-Idempotency-Token$", 11 | "^User-Agent$" 12 | ], 13 | "RemoveRequestHeaders": [ 14 | "^Authorization$", 15 | "^Proxy-Authorization$", 16 | "^Connection$", 17 | "^Content-Type$", 18 | "^Date$", 19 | "^Host$", 20 | "^Transfer-Encoding$", 21 | "^Via$", 22 | "^X-Forwarded-.*$", 23 | "^X-Cloud-Trace-Context$", 24 | "^X-Goog-Api-Client$", 25 | "^X-Google-.*$", 26 | "^X-Gfe-.*$" 27 | ], 28 | "RemoveResponseHeaders": [ 29 | "^X-Google-.*$", 30 | "^X-Gfe-.*$" 31 | ], 32 | "ClearParams": [ 33 | "^Expires$", 34 | "^Signature$" 35 | ], 36 | "RemoveParams": null 37 | }, 38 | "Entries": null 39 | } -------------------------------------------------------------------------------- /blob/gcsblob/testdata/TestConformance/TestRead/negative_offset_fails.replay: -------------------------------------------------------------------------------- 1 | { 2 | "Initial": "AQAAAA7eTdHjLuUCYQAA", 3 | "Version": "0.2", 4 | "Converter": { 5 | "ScrubBody": null, 6 | "ClearHeaders": [ 7 | "^X-Goog-.*Encryption-Key$", 8 | "^Expires$", 9 | "^Signature$", 10 | "^X-Goog-Gcs-Idempotency-Token$", 11 | "^User-Agent$" 12 | ], 13 | "RemoveRequestHeaders": [ 14 | "^Authorization$", 15 | "^Proxy-Authorization$", 16 | "^Connection$", 17 | "^Content-Type$", 18 | "^Date$", 19 | "^Host$", 20 | "^Transfer-Encoding$", 21 | "^Via$", 22 | "^X-Forwarded-.*$", 23 | "^X-Cloud-Trace-Context$", 24 | "^X-Goog-Api-Client$", 25 | "^X-Google-.*$", 26 | "^X-Gfe-.*$" 27 | ], 28 | "RemoveResponseHeaders": [ 29 | "^X-Google-.*$", 30 | "^X-Gfe-.*$" 31 | ], 32 | "ClearParams": [ 33 | "^Expires$", 34 | "^Signature$" 35 | ], 36 | "RemoveParams": null 37 | }, 38 | "Entries": null 39 | } -------------------------------------------------------------------------------- /blob/gcsblob/testdata/TestOpenBucket/empty_bucket_name_results_in_error.replay: -------------------------------------------------------------------------------- 1 | { 2 | "Initial": "AQAAAA7eTdIRBVwG+gAA", 3 | "Version": "0.2", 4 | "Converter": { 5 | "ScrubBody": null, 6 | "ClearHeaders": [ 7 | "^X-Goog-.*Encryption-Key$", 8 | "^Expires$", 9 | "^Signature$", 10 | "^X-Goog-Gcs-Idempotency-Token$", 11 | "^User-Agent$" 12 | ], 13 | "RemoveRequestHeaders": [ 14 | "^Authorization$", 15 | "^Proxy-Authorization$", 16 | "^Connection$", 17 | "^Content-Type$", 18 | "^Date$", 19 | "^Host$", 20 | "^Transfer-Encoding$", 21 | "^Via$", 22 | "^X-Forwarded-.*$", 23 | "^X-Cloud-Trace-Context$", 24 | "^X-Goog-Api-Client$", 25 | "^X-Google-.*$", 26 | "^X-Gfe-.*$" 27 | ], 28 | "RemoveResponseHeaders": [ 29 | "^X-Google-.*$", 30 | "^X-Gfe-.*$" 31 | ], 32 | "ClearParams": [ 33 | "^Expires$", 34 | "^Signature$" 35 | ], 36 | "RemoveParams": null 37 | }, 38 | "Entries": null 39 | } -------------------------------------------------------------------------------- /blob/gcsblob/testdata/TestOpenBucket/success.replay: -------------------------------------------------------------------------------- 1 | { 2 | "Initial": "AQAAAA7eTdIRBWaWpwAA", 3 | "Version": "0.2", 4 | "Converter": { 5 | "ScrubBody": null, 6 | "ClearHeaders": [ 7 | "^X-Goog-.*Encryption-Key$", 8 | "^Expires$", 9 | "^Signature$", 10 | "^X-Goog-Gcs-Idempotency-Token$", 11 | "^User-Agent$" 12 | ], 13 | "RemoveRequestHeaders": [ 14 | "^Authorization$", 15 | "^Proxy-Authorization$", 16 | "^Connection$", 17 | "^Content-Type$", 18 | "^Date$", 19 | "^Host$", 20 | "^Transfer-Encoding$", 21 | "^Via$", 22 | "^X-Forwarded-.*$", 23 | "^X-Cloud-Trace-Context$", 24 | "^X-Goog-Api-Client$", 25 | "^X-Google-.*$", 26 | "^X-Gfe-.*$" 27 | ], 28 | "RemoveResponseHeaders": [ 29 | "^X-Google-.*$", 30 | "^X-Gfe-.*$" 31 | ], 32 | "ClearParams": [ 33 | "^Expires$", 34 | "^Signature$" 35 | ], 36 | "RemoveParams": null 37 | }, 38 | "Entries": null 39 | } -------------------------------------------------------------------------------- /blob/s3blob/testdata/TestConformance/TestKeys/non-UTF8_fails.replay: -------------------------------------------------------------------------------- 1 | { 2 | "Initial": "AQAAAA7ffPPwKOJ6dwAA", 3 | "Version": "0.2", 4 | "Converter": { 5 | "ScrubBody": [ 6 | "MessageAttributes.*" 7 | ], 8 | "ClearHeaders": [ 9 | "^X-Goog-.*Encryption-Key$", 10 | "^Amz-Sdk-Invocation-Id$", 11 | "^X-Amz-Date$", 12 | "^User-Agent$" 13 | ], 14 | "RemoveRequestHeaders": [ 15 | "^Authorization$", 16 | "^Proxy-Authorization$", 17 | "^Connection$", 18 | "^Content-Type$", 19 | "^Date$", 20 | "^Host$", 21 | "^Transfer-Encoding$", 22 | "^Via$", 23 | "^X-Forwarded-.*$", 24 | "^X-Cloud-Trace-Context$", 25 | "^X-Goog-Api-Client$", 26 | "^X-Google-.*$", 27 | "^X-Gfe-.*$", 28 | "^Authorization$", 29 | "^Duration$", 30 | "^X-Amz-Security-Token$" 31 | ], 32 | "RemoveResponseHeaders": [ 33 | "^X-Google-.*$", 34 | "^X-Gfe-.*$" 35 | ], 36 | "ClearParams": [ 37 | "^X-Amz-Date$" 38 | ], 39 | "RemoveParams": [ 40 | "^X-Amz-Credential$", 41 | "^X-Amz-Signature$", 42 | "^X-Amz-Security-Token$" 43 | ] 44 | }, 45 | "Entries": null 46 | } -------------------------------------------------------------------------------- /blob/s3blob/testdata/TestConformance/TestMetadata/duplicate_case-insensitive_key_fails.replay: -------------------------------------------------------------------------------- 1 | { 2 | "Initial": "AQAAAA7ffPPuNCU77wAA", 3 | "Version": "0.2", 4 | "Converter": { 5 | "ScrubBody": [ 6 | "MessageAttributes.*" 7 | ], 8 | "ClearHeaders": [ 9 | "^X-Goog-.*Encryption-Key$", 10 | "^Amz-Sdk-Invocation-Id$", 11 | "^X-Amz-Date$", 12 | "^User-Agent$" 13 | ], 14 | "RemoveRequestHeaders": [ 15 | "^Authorization$", 16 | "^Proxy-Authorization$", 17 | "^Connection$", 18 | "^Content-Type$", 19 | "^Date$", 20 | "^Host$", 21 | "^Transfer-Encoding$", 22 | "^Via$", 23 | "^X-Forwarded-.*$", 24 | "^X-Cloud-Trace-Context$", 25 | "^X-Goog-Api-Client$", 26 | "^X-Google-.*$", 27 | "^X-Gfe-.*$", 28 | "^Authorization$", 29 | "^Duration$", 30 | "^X-Amz-Security-Token$" 31 | ], 32 | "RemoveResponseHeaders": [ 33 | "^X-Google-.*$", 34 | "^X-Gfe-.*$" 35 | ], 36 | "ClearParams": [ 37 | "^X-Amz-Date$" 38 | ], 39 | "RemoveParams": [ 40 | "^X-Amz-Credential$", 41 | "^X-Amz-Signature$", 42 | "^X-Amz-Security-Token$" 43 | ] 44 | }, 45 | "Entries": null 46 | } -------------------------------------------------------------------------------- /blob/s3blob/testdata/TestConformance/TestMetadata/empty_key_fails.replay: -------------------------------------------------------------------------------- 1 | { 2 | "Initial": "AQAAAA7ffPPuNBmGWwAA", 3 | "Version": "0.2", 4 | "Converter": { 5 | "ScrubBody": [ 6 | "MessageAttributes.*" 7 | ], 8 | "ClearHeaders": [ 9 | "^X-Goog-.*Encryption-Key$", 10 | "^Amz-Sdk-Invocation-Id$", 11 | "^X-Amz-Date$", 12 | "^User-Agent$" 13 | ], 14 | "RemoveRequestHeaders": [ 15 | "^Authorization$", 16 | "^Proxy-Authorization$", 17 | "^Connection$", 18 | "^Content-Type$", 19 | "^Date$", 20 | "^Host$", 21 | "^Transfer-Encoding$", 22 | "^Via$", 23 | "^X-Forwarded-.*$", 24 | "^X-Cloud-Trace-Context$", 25 | "^X-Goog-Api-Client$", 26 | "^X-Google-.*$", 27 | "^X-Gfe-.*$", 28 | "^Authorization$", 29 | "^Duration$", 30 | "^X-Amz-Security-Token$" 31 | ], 32 | "RemoveResponseHeaders": [ 33 | "^X-Google-.*$", 34 | "^X-Gfe-.*$" 35 | ], 36 | "ClearParams": [ 37 | "^X-Amz-Date$" 38 | ], 39 | "RemoveParams": [ 40 | "^X-Amz-Credential$", 41 | "^X-Amz-Signature$", 42 | "^X-Amz-Security-Token$" 43 | ] 44 | }, 45 | "Entries": null 46 | } -------------------------------------------------------------------------------- /blob/s3blob/testdata/TestConformance/TestMetadata/non-utf8_metadata_key.replay: -------------------------------------------------------------------------------- 1 | { 2 | "Initial": "AQAAAA7ffPPvJSV+igAA", 3 | "Version": "0.2", 4 | "Converter": { 5 | "ScrubBody": [ 6 | "MessageAttributes.*" 7 | ], 8 | "ClearHeaders": [ 9 | "^X-Goog-.*Encryption-Key$", 10 | "^Amz-Sdk-Invocation-Id$", 11 | "^X-Amz-Date$", 12 | "^User-Agent$" 13 | ], 14 | "RemoveRequestHeaders": [ 15 | "^Authorization$", 16 | "^Proxy-Authorization$", 17 | "^Connection$", 18 | "^Content-Type$", 19 | "^Date$", 20 | "^Host$", 21 | "^Transfer-Encoding$", 22 | "^Via$", 23 | "^X-Forwarded-.*$", 24 | "^X-Cloud-Trace-Context$", 25 | "^X-Goog-Api-Client$", 26 | "^X-Google-.*$", 27 | "^X-Gfe-.*$", 28 | "^Authorization$", 29 | "^Duration$", 30 | "^X-Amz-Security-Token$" 31 | ], 32 | "RemoveResponseHeaders": [ 33 | "^X-Google-.*$", 34 | "^X-Gfe-.*$" 35 | ], 36 | "ClearParams": [ 37 | "^X-Amz-Date$" 38 | ], 39 | "RemoveParams": [ 40 | "^X-Amz-Credential$", 41 | "^X-Amz-Signature$", 42 | "^X-Amz-Security-Token$" 43 | ] 44 | }, 45 | "Entries": null 46 | } -------------------------------------------------------------------------------- /blob/s3blob/testdata/TestConformance/TestMetadata/non-utf8_metadata_value.replay: -------------------------------------------------------------------------------- 1 | { 2 | "Initial": "AQAAAA7ffPPvJTEpuQAA", 3 | "Version": "0.2", 4 | "Converter": { 5 | "ScrubBody": [ 6 | "MessageAttributes.*" 7 | ], 8 | "ClearHeaders": [ 9 | "^X-Goog-.*Encryption-Key$", 10 | "^Amz-Sdk-Invocation-Id$", 11 | "^X-Amz-Date$", 12 | "^User-Agent$" 13 | ], 14 | "RemoveRequestHeaders": [ 15 | "^Authorization$", 16 | "^Proxy-Authorization$", 17 | "^Connection$", 18 | "^Content-Type$", 19 | "^Date$", 20 | "^Host$", 21 | "^Transfer-Encoding$", 22 | "^Via$", 23 | "^X-Forwarded-.*$", 24 | "^X-Cloud-Trace-Context$", 25 | "^X-Goog-Api-Client$", 26 | "^X-Google-.*$", 27 | "^X-Gfe-.*$", 28 | "^Authorization$", 29 | "^Duration$", 30 | "^X-Amz-Security-Token$" 31 | ], 32 | "RemoveResponseHeaders": [ 33 | "^X-Google-.*$", 34 | "^X-Gfe-.*$" 35 | ], 36 | "ClearParams": [ 37 | "^X-Amz-Date$" 38 | ], 39 | "RemoveParams": [ 40 | "^X-Amz-Credential$", 41 | "^X-Amz-Signature$", 42 | "^X-Amz-Security-Token$" 43 | ] 44 | }, 45 | "Entries": null 46 | } -------------------------------------------------------------------------------- /blob/s3blob/testdata/TestConformance/TestRead/negative_offset_fails.replay: -------------------------------------------------------------------------------- 1 | { 2 | "Initial": "AQAAAA7ffPPnJcPSMgAA", 3 | "Version": "0.2", 4 | "Converter": { 5 | "ScrubBody": [ 6 | "MessageAttributes.*" 7 | ], 8 | "ClearHeaders": [ 9 | "^X-Goog-.*Encryption-Key$", 10 | "^Amz-Sdk-Invocation-Id$", 11 | "^X-Amz-Date$", 12 | "^User-Agent$" 13 | ], 14 | "RemoveRequestHeaders": [ 15 | "^Authorization$", 16 | "^Proxy-Authorization$", 17 | "^Connection$", 18 | "^Content-Type$", 19 | "^Date$", 20 | "^Host$", 21 | "^Transfer-Encoding$", 22 | "^Via$", 23 | "^X-Forwarded-.*$", 24 | "^X-Cloud-Trace-Context$", 25 | "^X-Goog-Api-Client$", 26 | "^X-Google-.*$", 27 | "^X-Gfe-.*$", 28 | "^Authorization$", 29 | "^Duration$", 30 | "^X-Amz-Security-Token$" 31 | ], 32 | "RemoveResponseHeaders": [ 33 | "^X-Google-.*$", 34 | "^X-Gfe-.*$" 35 | ], 36 | "ClearParams": [ 37 | "^X-Amz-Date$" 38 | ], 39 | "RemoveParams": [ 40 | "^X-Amz-Credential$", 41 | "^X-Amz-Signature$", 42 | "^X-Amz-Security-Token$" 43 | ] 44 | }, 45 | "Entries": null 46 | } -------------------------------------------------------------------------------- /blob/s3blob/testdata/TestConformance/TestWrite/write_to_empty_key_fails.replay: -------------------------------------------------------------------------------- 1 | { 2 | "Initial": "AQAAAA7ffPPpJv8EdAAA", 3 | "Version": "0.2", 4 | "Converter": { 5 | "ScrubBody": [ 6 | "MessageAttributes.*" 7 | ], 8 | "ClearHeaders": [ 9 | "^X-Goog-.*Encryption-Key$", 10 | "^Amz-Sdk-Invocation-Id$", 11 | "^X-Amz-Date$", 12 | "^User-Agent$" 13 | ], 14 | "RemoveRequestHeaders": [ 15 | "^Authorization$", 16 | "^Proxy-Authorization$", 17 | "^Connection$", 18 | "^Content-Type$", 19 | "^Date$", 20 | "^Host$", 21 | "^Transfer-Encoding$", 22 | "^Via$", 23 | "^X-Forwarded-.*$", 24 | "^X-Cloud-Trace-Context$", 25 | "^X-Goog-Api-Client$", 26 | "^X-Google-.*$", 27 | "^X-Gfe-.*$", 28 | "^Authorization$", 29 | "^Duration$", 30 | "^X-Amz-Security-Token$" 31 | ], 32 | "RemoveResponseHeaders": [ 33 | "^X-Google-.*$", 34 | "^X-Gfe-.*$" 35 | ], 36 | "ClearParams": [ 37 | "^X-Amz-Date$" 38 | ], 39 | "RemoveParams": [ 40 | "^X-Amz-Credential$", 41 | "^X-Amz-Signature$", 42 | "^X-Amz-Security-Token$" 43 | ] 44 | }, 45 | "Entries": null 46 | } -------------------------------------------------------------------------------- /blob/s3blob/testdata/TestConformanceUsingLegacyList/TestKeys/non-UTF8_fails.replay: -------------------------------------------------------------------------------- 1 | { 2 | "Initial": "AQAAAA7ffPQGGwabvgAA", 3 | "Version": "0.2", 4 | "Converter": { 5 | "ScrubBody": [ 6 | "MessageAttributes.*" 7 | ], 8 | "ClearHeaders": [ 9 | "^X-Goog-.*Encryption-Key$", 10 | "^Amz-Sdk-Invocation-Id$", 11 | "^X-Amz-Date$", 12 | "^User-Agent$" 13 | ], 14 | "RemoveRequestHeaders": [ 15 | "^Authorization$", 16 | "^Proxy-Authorization$", 17 | "^Connection$", 18 | "^Content-Type$", 19 | "^Date$", 20 | "^Host$", 21 | "^Transfer-Encoding$", 22 | "^Via$", 23 | "^X-Forwarded-.*$", 24 | "^X-Cloud-Trace-Context$", 25 | "^X-Goog-Api-Client$", 26 | "^X-Google-.*$", 27 | "^X-Gfe-.*$", 28 | "^Authorization$", 29 | "^Duration$", 30 | "^X-Amz-Security-Token$" 31 | ], 32 | "RemoveResponseHeaders": [ 33 | "^X-Google-.*$", 34 | "^X-Gfe-.*$" 35 | ], 36 | "ClearParams": [ 37 | "^X-Amz-Date$" 38 | ], 39 | "RemoveParams": [ 40 | "^X-Amz-Credential$", 41 | "^X-Amz-Signature$", 42 | "^X-Amz-Security-Token$" 43 | ] 44 | }, 45 | "Entries": null 46 | } -------------------------------------------------------------------------------- /blob/s3blob/testdata/TestConformanceUsingLegacyList/TestMetadata/duplicate_case-insensitive_key_fails.replay: -------------------------------------------------------------------------------- 1 | { 2 | "Initial": "AQAAAA7ffPQEFDDuCwAA", 3 | "Version": "0.2", 4 | "Converter": { 5 | "ScrubBody": [ 6 | "MessageAttributes.*" 7 | ], 8 | "ClearHeaders": [ 9 | "^X-Goog-.*Encryption-Key$", 10 | "^Amz-Sdk-Invocation-Id$", 11 | "^X-Amz-Date$", 12 | "^User-Agent$" 13 | ], 14 | "RemoveRequestHeaders": [ 15 | "^Authorization$", 16 | "^Proxy-Authorization$", 17 | "^Connection$", 18 | "^Content-Type$", 19 | "^Date$", 20 | "^Host$", 21 | "^Transfer-Encoding$", 22 | "^Via$", 23 | "^X-Forwarded-.*$", 24 | "^X-Cloud-Trace-Context$", 25 | "^X-Goog-Api-Client$", 26 | "^X-Google-.*$", 27 | "^X-Gfe-.*$", 28 | "^Authorization$", 29 | "^Duration$", 30 | "^X-Amz-Security-Token$" 31 | ], 32 | "RemoveResponseHeaders": [ 33 | "^X-Google-.*$", 34 | "^X-Gfe-.*$" 35 | ], 36 | "ClearParams": [ 37 | "^X-Amz-Date$" 38 | ], 39 | "RemoveParams": [ 40 | "^X-Amz-Credential$", 41 | "^X-Amz-Signature$", 42 | "^X-Amz-Security-Token$" 43 | ] 44 | }, 45 | "Entries": null 46 | } -------------------------------------------------------------------------------- /blob/s3blob/testdata/TestConformanceUsingLegacyList/TestMetadata/empty_key_fails.replay: -------------------------------------------------------------------------------- 1 | { 2 | "Initial": "AQAAAA7ffPQEFCVVVQAA", 3 | "Version": "0.2", 4 | "Converter": { 5 | "ScrubBody": [ 6 | "MessageAttributes.*" 7 | ], 8 | "ClearHeaders": [ 9 | "^X-Goog-.*Encryption-Key$", 10 | "^Amz-Sdk-Invocation-Id$", 11 | "^X-Amz-Date$", 12 | "^User-Agent$" 13 | ], 14 | "RemoveRequestHeaders": [ 15 | "^Authorization$", 16 | "^Proxy-Authorization$", 17 | "^Connection$", 18 | "^Content-Type$", 19 | "^Date$", 20 | "^Host$", 21 | "^Transfer-Encoding$", 22 | "^Via$", 23 | "^X-Forwarded-.*$", 24 | "^X-Cloud-Trace-Context$", 25 | "^X-Goog-Api-Client$", 26 | "^X-Google-.*$", 27 | "^X-Gfe-.*$", 28 | "^Authorization$", 29 | "^Duration$", 30 | "^X-Amz-Security-Token$" 31 | ], 32 | "RemoveResponseHeaders": [ 33 | "^X-Google-.*$", 34 | "^X-Gfe-.*$" 35 | ], 36 | "ClearParams": [ 37 | "^X-Amz-Date$" 38 | ], 39 | "RemoveParams": [ 40 | "^X-Amz-Credential$", 41 | "^X-Amz-Signature$", 42 | "^X-Amz-Security-Token$" 43 | ] 44 | }, 45 | "Entries": null 46 | } -------------------------------------------------------------------------------- /blob/s3blob/testdata/TestConformanceUsingLegacyList/TestMetadata/non-utf8_metadata_key.replay: -------------------------------------------------------------------------------- 1 | { 2 | "Initial": "AQAAAA7ffPQFBIWBoQAA", 3 | "Version": "0.2", 4 | "Converter": { 5 | "ScrubBody": [ 6 | "MessageAttributes.*" 7 | ], 8 | "ClearHeaders": [ 9 | "^X-Goog-.*Encryption-Key$", 10 | "^Amz-Sdk-Invocation-Id$", 11 | "^X-Amz-Date$", 12 | "^User-Agent$" 13 | ], 14 | "RemoveRequestHeaders": [ 15 | "^Authorization$", 16 | "^Proxy-Authorization$", 17 | "^Connection$", 18 | "^Content-Type$", 19 | "^Date$", 20 | "^Host$", 21 | "^Transfer-Encoding$", 22 | "^Via$", 23 | "^X-Forwarded-.*$", 24 | "^X-Cloud-Trace-Context$", 25 | "^X-Goog-Api-Client$", 26 | "^X-Google-.*$", 27 | "^X-Gfe-.*$", 28 | "^Authorization$", 29 | "^Duration$", 30 | "^X-Amz-Security-Token$" 31 | ], 32 | "RemoveResponseHeaders": [ 33 | "^X-Google-.*$", 34 | "^X-Gfe-.*$" 35 | ], 36 | "ClearParams": [ 37 | "^X-Amz-Date$" 38 | ], 39 | "RemoveParams": [ 40 | "^X-Amz-Credential$", 41 | "^X-Amz-Signature$", 42 | "^X-Amz-Security-Token$" 43 | ] 44 | }, 45 | "Entries": null 46 | } -------------------------------------------------------------------------------- /blob/s3blob/testdata/TestConformanceUsingLegacyList/TestMetadata/non-utf8_metadata_value.replay: -------------------------------------------------------------------------------- 1 | { 2 | "Initial": "AQAAAA7ffPQFBJRL4AAA", 3 | "Version": "0.2", 4 | "Converter": { 5 | "ScrubBody": [ 6 | "MessageAttributes.*" 7 | ], 8 | "ClearHeaders": [ 9 | "^X-Goog-.*Encryption-Key$", 10 | "^Amz-Sdk-Invocation-Id$", 11 | "^X-Amz-Date$", 12 | "^User-Agent$" 13 | ], 14 | "RemoveRequestHeaders": [ 15 | "^Authorization$", 16 | "^Proxy-Authorization$", 17 | "^Connection$", 18 | "^Content-Type$", 19 | "^Date$", 20 | "^Host$", 21 | "^Transfer-Encoding$", 22 | "^Via$", 23 | "^X-Forwarded-.*$", 24 | "^X-Cloud-Trace-Context$", 25 | "^X-Goog-Api-Client$", 26 | "^X-Google-.*$", 27 | "^X-Gfe-.*$", 28 | "^Authorization$", 29 | "^Duration$", 30 | "^X-Amz-Security-Token$" 31 | ], 32 | "RemoveResponseHeaders": [ 33 | "^X-Google-.*$", 34 | "^X-Gfe-.*$" 35 | ], 36 | "ClearParams": [ 37 | "^X-Amz-Date$" 38 | ], 39 | "RemoveParams": [ 40 | "^X-Amz-Credential$", 41 | "^X-Amz-Signature$", 42 | "^X-Amz-Security-Token$" 43 | ] 44 | }, 45 | "Entries": null 46 | } -------------------------------------------------------------------------------- /blob/s3blob/testdata/TestConformanceUsingLegacyList/TestRead/negative_offset_fails.replay: -------------------------------------------------------------------------------- 1 | { 2 | "Initial": "AQAAAA7ffPP9KXrxuAAA", 3 | "Version": "0.2", 4 | "Converter": { 5 | "ScrubBody": [ 6 | "MessageAttributes.*" 7 | ], 8 | "ClearHeaders": [ 9 | "^X-Goog-.*Encryption-Key$", 10 | "^Amz-Sdk-Invocation-Id$", 11 | "^X-Amz-Date$", 12 | "^User-Agent$" 13 | ], 14 | "RemoveRequestHeaders": [ 15 | "^Authorization$", 16 | "^Proxy-Authorization$", 17 | "^Connection$", 18 | "^Content-Type$", 19 | "^Date$", 20 | "^Host$", 21 | "^Transfer-Encoding$", 22 | "^Via$", 23 | "^X-Forwarded-.*$", 24 | "^X-Cloud-Trace-Context$", 25 | "^X-Goog-Api-Client$", 26 | "^X-Google-.*$", 27 | "^X-Gfe-.*$", 28 | "^Authorization$", 29 | "^Duration$", 30 | "^X-Amz-Security-Token$" 31 | ], 32 | "RemoveResponseHeaders": [ 33 | "^X-Google-.*$", 34 | "^X-Gfe-.*$" 35 | ], 36 | "ClearParams": [ 37 | "^X-Amz-Date$" 38 | ], 39 | "RemoveParams": [ 40 | "^X-Amz-Credential$", 41 | "^X-Amz-Signature$", 42 | "^X-Amz-Security-Token$" 43 | ] 44 | }, 45 | "Entries": null 46 | } -------------------------------------------------------------------------------- /blob/s3blob/testdata/TestConformanceUsingLegacyList/TestWrite/write_to_empty_key_fails.replay: -------------------------------------------------------------------------------- 1 | { 2 | "Initial": "AQAAAA7ffPP/Gj5bmwAA", 3 | "Version": "0.2", 4 | "Converter": { 5 | "ScrubBody": [ 6 | "MessageAttributes.*" 7 | ], 8 | "ClearHeaders": [ 9 | "^X-Goog-.*Encryption-Key$", 10 | "^Amz-Sdk-Invocation-Id$", 11 | "^X-Amz-Date$", 12 | "^User-Agent$" 13 | ], 14 | "RemoveRequestHeaders": [ 15 | "^Authorization$", 16 | "^Proxy-Authorization$", 17 | "^Connection$", 18 | "^Content-Type$", 19 | "^Date$", 20 | "^Host$", 21 | "^Transfer-Encoding$", 22 | "^Via$", 23 | "^X-Forwarded-.*$", 24 | "^X-Cloud-Trace-Context$", 25 | "^X-Goog-Api-Client$", 26 | "^X-Google-.*$", 27 | "^X-Gfe-.*$", 28 | "^Authorization$", 29 | "^Duration$", 30 | "^X-Amz-Security-Token$" 31 | ], 32 | "RemoveResponseHeaders": [ 33 | "^X-Google-.*$", 34 | "^X-Gfe-.*$" 35 | ], 36 | "ClearParams": [ 37 | "^X-Amz-Date$" 38 | ], 39 | "RemoveParams": [ 40 | "^X-Amz-Credential$", 41 | "^X-Amz-Signature$", 42 | "^X-Amz-Security-Token$" 43 | ] 44 | }, 45 | "Entries": null 46 | } -------------------------------------------------------------------------------- /blob/s3blob/testdata/TestOpenBucket/empty_bucket_name_results_in_error.replay: -------------------------------------------------------------------------------- 1 | { 2 | "Initial": "AQAAAA7ffPQOHMOqwwAA", 3 | "Version": "0.2", 4 | "Converter": { 5 | "ScrubBody": [ 6 | "MessageAttributes.*" 7 | ], 8 | "ClearHeaders": [ 9 | "^X-Goog-.*Encryption-Key$", 10 | "^Amz-Sdk-Invocation-Id$", 11 | "^X-Amz-Date$", 12 | "^User-Agent$" 13 | ], 14 | "RemoveRequestHeaders": [ 15 | "^Authorization$", 16 | "^Proxy-Authorization$", 17 | "^Connection$", 18 | "^Content-Type$", 19 | "^Date$", 20 | "^Host$", 21 | "^Transfer-Encoding$", 22 | "^Via$", 23 | "^X-Forwarded-.*$", 24 | "^X-Cloud-Trace-Context$", 25 | "^X-Goog-Api-Client$", 26 | "^X-Google-.*$", 27 | "^X-Gfe-.*$", 28 | "^Authorization$", 29 | "^Duration$", 30 | "^X-Amz-Security-Token$" 31 | ], 32 | "RemoveResponseHeaders": [ 33 | "^X-Google-.*$", 34 | "^X-Gfe-.*$" 35 | ], 36 | "ClearParams": [ 37 | "^X-Amz-Date$" 38 | ], 39 | "RemoveParams": [ 40 | "^X-Amz-Credential$", 41 | "^X-Amz-Signature$", 42 | "^X-Amz-Security-Token$" 43 | ] 44 | }, 45 | "Entries": null 46 | } -------------------------------------------------------------------------------- /blob/s3blob/testdata/TestOpenBucket/empty_bucket_name_results_in_error_V2.replay: -------------------------------------------------------------------------------- 1 | { 2 | "Initial": "AQAAAA7fe2/sO5bkMQAA", 3 | "Version": "0.2", 4 | "Converter": { 5 | "ScrubBody": [ 6 | "MessageAttributes.*" 7 | ], 8 | "ClearHeaders": [ 9 | "^X-Goog-.*Encryption-Key$", 10 | "^Amz-Sdk-Invocation-Id$", 11 | "^X-Amz-Date$", 12 | "^User-Agent$" 13 | ], 14 | "RemoveRequestHeaders": [ 15 | "^Authorization$", 16 | "^Proxy-Authorization$", 17 | "^Connection$", 18 | "^Content-Type$", 19 | "^Date$", 20 | "^Host$", 21 | "^Transfer-Encoding$", 22 | "^Via$", 23 | "^X-Forwarded-.*$", 24 | "^X-Cloud-Trace-Context$", 25 | "^X-Goog-Api-Client$", 26 | "^X-Google-.*$", 27 | "^X-Gfe-.*$", 28 | "^Authorization$", 29 | "^Duration$", 30 | "^X-Amz-Security-Token$" 31 | ], 32 | "RemoveResponseHeaders": [ 33 | "^X-Google-.*$", 34 | "^X-Gfe-.*$" 35 | ], 36 | "ClearParams": [ 37 | "^X-Amz-Date$" 38 | ], 39 | "RemoveParams": [ 40 | "^X-Amz-Credential$", 41 | "^X-Amz-Signature$", 42 | "^X-Amz-Security-Token$" 43 | ] 44 | }, 45 | "Entries": null 46 | } -------------------------------------------------------------------------------- /blob/s3blob/testdata/TestOpenBucket/success.replay: -------------------------------------------------------------------------------- 1 | { 2 | "Initial": "AQAAAA7ffPQOHM67QwAA", 3 | "Version": "0.2", 4 | "Converter": { 5 | "ScrubBody": [ 6 | "MessageAttributes.*" 7 | ], 8 | "ClearHeaders": [ 9 | "^X-Goog-.*Encryption-Key$", 10 | "^Amz-Sdk-Invocation-Id$", 11 | "^X-Amz-Date$", 12 | "^User-Agent$" 13 | ], 14 | "RemoveRequestHeaders": [ 15 | "^Authorization$", 16 | "^Proxy-Authorization$", 17 | "^Connection$", 18 | "^Content-Type$", 19 | "^Date$", 20 | "^Host$", 21 | "^Transfer-Encoding$", 22 | "^Via$", 23 | "^X-Forwarded-.*$", 24 | "^X-Cloud-Trace-Context$", 25 | "^X-Goog-Api-Client$", 26 | "^X-Google-.*$", 27 | "^X-Gfe-.*$", 28 | "^Authorization$", 29 | "^Duration$", 30 | "^X-Amz-Security-Token$" 31 | ], 32 | "RemoveResponseHeaders": [ 33 | "^X-Google-.*$", 34 | "^X-Gfe-.*$" 35 | ], 36 | "ClearParams": [ 37 | "^X-Amz-Date$" 38 | ], 39 | "RemoveParams": [ 40 | "^X-Amz-Credential$", 41 | "^X-Amz-Signature$", 42 | "^X-Amz-Security-Token$" 43 | ] 44 | }, 45 | "Entries": null 46 | } -------------------------------------------------------------------------------- /blob/s3blob/testdata/TestOpenBucket/success_V2.replay: -------------------------------------------------------------------------------- 1 | { 2 | "Initial": "AQAAAA7fe2/tABc27wAA", 3 | "Version": "0.2", 4 | "Converter": { 5 | "ScrubBody": [ 6 | "MessageAttributes.*" 7 | ], 8 | "ClearHeaders": [ 9 | "^X-Goog-.*Encryption-Key$", 10 | "^Amz-Sdk-Invocation-Id$", 11 | "^X-Amz-Date$", 12 | "^User-Agent$" 13 | ], 14 | "RemoveRequestHeaders": [ 15 | "^Authorization$", 16 | "^Proxy-Authorization$", 17 | "^Connection$", 18 | "^Content-Type$", 19 | "^Date$", 20 | "^Host$", 21 | "^Transfer-Encoding$", 22 | "^Via$", 23 | "^X-Forwarded-.*$", 24 | "^X-Cloud-Trace-Context$", 25 | "^X-Goog-Api-Client$", 26 | "^X-Google-.*$", 27 | "^X-Gfe-.*$", 28 | "^Authorization$", 29 | "^Duration$", 30 | "^X-Amz-Security-Token$" 31 | ], 32 | "RemoveResponseHeaders": [ 33 | "^X-Google-.*$", 34 | "^X-Gfe-.*$" 35 | ], 36 | "ClearParams": [ 37 | "^X-Amz-Date$" 38 | ], 39 | "RemoveParams": [ 40 | "^X-Amz-Credential$", 41 | "^X-Amz-Signature$", 42 | "^X-Amz-Security-Token$" 43 | ] 44 | }, 45 | "Entries": null 46 | } -------------------------------------------------------------------------------- /blob/wrapped_bucket_test.go: -------------------------------------------------------------------------------- 1 | package blob_test 2 | 3 | import ( 4 | "context" 5 | "os" 6 | "path/filepath" 7 | "strings" 8 | "testing" 9 | 10 | "gocloud.dev/blob" 11 | "gocloud.dev/blob/fileblob" 12 | ) 13 | 14 | func TestPrefixedBucket(t *testing.T) { 15 | dir := t.TempDir() 16 | 17 | bucket, err := fileblob.OpenBucket(dir, nil) 18 | if err != nil { 19 | t.Fatal(err) 20 | } 21 | 22 | const contents = "contents" 23 | ctx := context.Background() 24 | if err := bucket.WriteAll(ctx, "foo/bar/baz.txt", []byte(contents), nil); err != nil { 25 | t.Fatal(err) 26 | } 27 | 28 | wrapped := blob.PrefixedBucket(bucket, "foo/bar/") 29 | defer wrapped.Close() 30 | 31 | got, err := wrapped.ReadAll(ctx, "baz.txt") 32 | if err != nil { 33 | t.Fatal(err) 34 | } 35 | if string(got) != contents { 36 | t.Errorf("got %q want %q", string(got), contents) 37 | } 38 | } 39 | 40 | func TestSingleKeyBucket(t *testing.T) { 41 | dir := t.TempDir() 42 | 43 | bucket, err := fileblob.OpenBucket(dir, nil) 44 | if err != nil { 45 | t.Fatal(err) 46 | } 47 | 48 | const contents = "contents" 49 | ctx := context.Background() 50 | if err := bucket.WriteAll(ctx, "foo/bar.txt", []byte(contents), nil); err != nil { 51 | t.Fatal(err) 52 | } 53 | 54 | dirpath := filepath.ToSlash(dir) 55 | if os.PathSeparator != '/' && !strings.HasPrefix(dirpath, "/") { 56 | dirpath = "/" + dirpath 57 | } 58 | 59 | wrapped, err := blob.OpenBucket(ctx, "file://"+dirpath+"?key=foo/bar.txt") 60 | if err != nil { 61 | t.Fatal(err) 62 | } 63 | defer wrapped.Close() 64 | got, err := wrapped.ReadAll(ctx, "") 65 | if err != nil { 66 | t.Fatal(err) 67 | } 68 | if string(got) != contents { 69 | t.Errorf("got %q want %q", string(got), contents) 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /docstore/awsdynamodb/example_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Cloud Development Kit Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package awsdynamodb_test 16 | 17 | import ( 18 | "context" 19 | "log" 20 | 21 | "github.com/aws/aws-sdk-go/aws/session" 22 | "github.com/aws/aws-sdk-go/service/dynamodb" 23 | "gocloud.dev/docstore" 24 | "gocloud.dev/docstore/awsdynamodb" 25 | ) 26 | 27 | func ExampleOpenCollection() { 28 | // PRAGMA: This example is used on gocloud.dev; PRAGMA comments adjust how it is shown and can be ignored. 29 | sess, err := session.NewSession() 30 | if err != nil { 31 | log.Fatal(err) 32 | } 33 | coll, err := awsdynamodb.OpenCollection( 34 | dynamodb.New(sess), "docstore-test", "partitionKeyField", "", nil) 35 | if err != nil { 36 | log.Fatal(err) 37 | } 38 | defer coll.Close() 39 | } 40 | 41 | func Example_openCollectionFromURL() { 42 | // PRAGMA: This example is used on gocloud.dev; PRAGMA comments adjust how it is shown and can be ignored. 43 | // PRAGMA: On gocloud.dev, add a blank import: _ "gocloud.dev/docstore/awsdynamodb" 44 | // PRAGMA: On gocloud.dev, hide lines until the next blank line. 45 | ctx := context.Background() 46 | 47 | // docstore.OpenCollection creates a *docstore.Collection from a URL. 48 | coll, err := docstore.OpenCollection(ctx, "dynamodb://my-table?partition_key=name") 49 | if err != nil { 50 | log.Fatal(err) 51 | } 52 | defer coll.Close() 53 | } 54 | -------------------------------------------------------------------------------- /docstore/driver/actionkind_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type=ActionKind"; DO NOT EDIT. 2 | 3 | package driver 4 | 5 | import "strconv" 6 | 7 | func _() { 8 | // An "invalid array index" compiler error signifies that the constant values have changed. 9 | // Re-run the stringer command to generate them again. 10 | var x [1]struct{} 11 | _ = x[Create-0] 12 | _ = x[Replace-1] 13 | _ = x[Put-2] 14 | _ = x[Get-3] 15 | _ = x[Delete-4] 16 | _ = x[Update-5] 17 | } 18 | 19 | const _ActionKind_name = "CreateReplacePutGetDeleteUpdate" 20 | 21 | var _ActionKind_index = [...]uint8{0, 6, 13, 16, 19, 25, 31} 22 | 23 | func (i ActionKind) String() string { 24 | if i < 0 || i >= ActionKind(len(_ActionKind_index)-1) { 25 | return "ActionKind(" + strconv.FormatInt(int64(i), 10) + ")" 26 | } 27 | return _ActionKind_name[_ActionKind_index[i]:_ActionKind_index[i+1]] 28 | } 29 | -------------------------------------------------------------------------------- /docstore/drivertest/util.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Cloud Development Kit Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package drivertest 16 | 17 | import ( 18 | "math/rand" 19 | "sync" 20 | 21 | "github.com/google/uuid" 22 | "gocloud.dev/docstore/driver" 23 | ) 24 | 25 | // MakeUniqueStringDeterministicForTesting uses a specified seed value to 26 | // produce the same sequence of values in driver.UniqueString for testing. 27 | // 28 | // Call when running tests that will be replayed. 29 | func MakeUniqueStringDeterministicForTesting(seed int64) { 30 | r := &randReader{r: rand.New(rand.NewSource(seed))} 31 | uuid.SetRand(r) 32 | } 33 | 34 | type randReader struct { 35 | mu sync.Mutex 36 | r *rand.Rand 37 | } 38 | 39 | func (r *randReader) Read(buf []byte) (int, error) { 40 | r.mu.Lock() 41 | defer r.mu.Unlock() 42 | return r.r.Read(buf) 43 | } 44 | 45 | // MustDocument is like driver.NewDocument, but panics on error. 46 | func MustDocument(doc interface{}) driver.Document { 47 | dd, err := driver.NewDocument(doc) 48 | if err != nil { 49 | panic(err) 50 | } 51 | return dd 52 | } 53 | -------------------------------------------------------------------------------- /docstore/gcpfirestore/testdata/TestConformance/ActionsOnStructNoRev.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/docstore/gcpfirestore/testdata/TestConformance/ActionsOnStructNoRev.replay -------------------------------------------------------------------------------- /docstore/gcpfirestore/testdata/TestConformance/ActionsWithCompositeID.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/docstore/gcpfirestore/testdata/TestConformance/ActionsWithCompositeID.replay -------------------------------------------------------------------------------- /docstore/gcpfirestore/testdata/TestConformance/As/verify_As.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/docstore/gcpfirestore/testdata/TestConformance/As/verify_As.replay -------------------------------------------------------------------------------- /docstore/gcpfirestore/testdata/TestConformance/As/verify_As_returns_false_when_passed_nil.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/docstore/gcpfirestore/testdata/TestConformance/As/verify_As_returns_false_when_passed_nil.replay -------------------------------------------------------------------------------- /docstore/gcpfirestore/testdata/TestConformance/AtomicWrites.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/docstore/gcpfirestore/testdata/TestConformance/AtomicWrites.replay -------------------------------------------------------------------------------- /docstore/gcpfirestore/testdata/TestConformance/AtomicWritesFail.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/docstore/gcpfirestore/testdata/TestConformance/AtomicWritesFail.replay -------------------------------------------------------------------------------- /docstore/gcpfirestore/testdata/TestConformance/BeforeDo.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/docstore/gcpfirestore/testdata/TestConformance/BeforeDo.replay -------------------------------------------------------------------------------- /docstore/gcpfirestore/testdata/TestConformance/BeforeQuery.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/docstore/gcpfirestore/testdata/TestConformance/BeforeQuery.replay -------------------------------------------------------------------------------- /docstore/gcpfirestore/testdata/TestConformance/Create.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/docstore/gcpfirestore/testdata/TestConformance/Create.replay -------------------------------------------------------------------------------- /docstore/gcpfirestore/testdata/TestConformance/Data.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/docstore/gcpfirestore/testdata/TestConformance/Data.replay -------------------------------------------------------------------------------- /docstore/gcpfirestore/testdata/TestConformance/Delete.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/docstore/gcpfirestore/testdata/TestConformance/Delete.replay -------------------------------------------------------------------------------- /docstore/gcpfirestore/testdata/TestConformance/ExampleInDoc.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/docstore/gcpfirestore/testdata/TestConformance/ExampleInDoc.replay -------------------------------------------------------------------------------- /docstore/gcpfirestore/testdata/TestConformance/Get.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/docstore/gcpfirestore/testdata/TestConformance/Get.replay -------------------------------------------------------------------------------- /docstore/gcpfirestore/testdata/TestConformance/GetQuery.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/docstore/gcpfirestore/testdata/TestConformance/GetQuery.replay -------------------------------------------------------------------------------- /docstore/gcpfirestore/testdata/TestConformance/GetQueryKeyField.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/docstore/gcpfirestore/testdata/TestConformance/GetQueryKeyField.replay -------------------------------------------------------------------------------- /docstore/gcpfirestore/testdata/TestConformance/MultipleActions.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/docstore/gcpfirestore/testdata/TestConformance/MultipleActions.replay -------------------------------------------------------------------------------- /docstore/gcpfirestore/testdata/TestConformance/Proto.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/docstore/gcpfirestore/testdata/TestConformance/Proto.replay -------------------------------------------------------------------------------- /docstore/gcpfirestore/testdata/TestConformance/Put.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/docstore/gcpfirestore/testdata/TestConformance/Put.replay -------------------------------------------------------------------------------- /docstore/gcpfirestore/testdata/TestConformance/Query.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/docstore/gcpfirestore/testdata/TestConformance/Query.replay -------------------------------------------------------------------------------- /docstore/gcpfirestore/testdata/TestConformance/Replace.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/docstore/gcpfirestore/testdata/TestConformance/Replace.replay -------------------------------------------------------------------------------- /docstore/gcpfirestore/testdata/TestConformance/SerializeRevision.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/docstore/gcpfirestore/testdata/TestConformance/SerializeRevision.replay -------------------------------------------------------------------------------- /docstore/gcpfirestore/testdata/TestConformance/Update.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/docstore/gcpfirestore/testdata/TestConformance/Update.replay -------------------------------------------------------------------------------- /docstore/internal/fields/README.md: -------------------------------------------------------------------------------- 1 | This package is copied from cloud.google.com/go/internal/fields. 2 | -------------------------------------------------------------------------------- /docstore/memdocstore/urls_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Cloud Development Kit Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package memdocstore 16 | 17 | import ( 18 | "context" 19 | "testing" 20 | 21 | "gocloud.dev/docstore" 22 | ) 23 | 24 | func TestOpenCollectionFromURL(t *testing.T) { 25 | tests := []struct { 26 | URL string 27 | wantErr bool 28 | }{ 29 | // OK. 30 | {"mem://coll/_id", false}, 31 | // "coll" already has key "_id". 32 | {"mem://coll/foo.bar", true}, 33 | {"mem://coll2/foo.bar", false}, 34 | // Missing collection. 35 | {"mem://", true}, 36 | // Missing key. 37 | {"mem://coll", true}, 38 | // Key with slash. 39 | {"mem://coll/my/key", true}, 40 | // Passing revision field. 41 | {"mem://coll/_id?revision_field=123", false}, 42 | // Passing filename. 43 | {"mem://coll/_id?filename=foo.out", false}, 44 | // Invalid parameter. 45 | {"mem://coll/key?param=value", true}, 46 | } 47 | ctx := context.Background() 48 | for _, test := range tests { 49 | d, err := docstore.OpenCollection(ctx, test.URL) 50 | if d != nil { 51 | defer d.Close() 52 | } 53 | if (err != nil) != test.wantErr { 54 | t.Errorf("%s: got error %v, want error %v", test.URL, err, test.wantErr) 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /docstore/mongodocstore/awsdocdb/outputs.tf: -------------------------------------------------------------------------------- 1 | output "setup_ssh_tunnel" { 2 | value = "ssh -L 27019:${aws_docdb_cluster.docdbtest.endpoint}:27017 ubuntu@${aws_instance.docdbtest.public_dns} -N" 3 | } 4 | -------------------------------------------------------------------------------- /docstore/mongodocstore/awsdocdb/variables.tf: -------------------------------------------------------------------------------- 1 | variable "aws_region" { 2 | description = "The AWS region to create docdb cluster and ec2 instance in." 3 | default = "us-east-2" 4 | } 5 | 6 | variable "vpc_id" { 7 | description = "The ID of the default VPC used by docdb cluster and ec2 instance." 8 | } 9 | 10 | variable "ssh_public_key" { 11 | description = "A public key line in .ssh/authorized_keys format to use to authenticate to your instance. This must be added to your SSH agent for provisioning to succeed." 12 | } 13 | 14 | variable "db_username" { 15 | description = "The master username to login docdb" 16 | } 17 | 18 | variable "db_password" { 19 | description = "The master password to login docdb" 20 | } 21 | -------------------------------------------------------------------------------- /docstore/mongodocstore/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.8' 2 | services: 3 | mongo: 4 | image: mongo:4.4 5 | container_name: mongo 6 | restart: always 7 | volumes: 8 | - mongo_data:/data/db 9 | ports: 10 | - "27017:27017" 11 | command: ["--replSet", "dbrs", "--bind_ip_all"] 12 | 13 | mongosetup: 14 | image: mongo:4.4 15 | container_name: mongosetup 16 | depends_on: 17 | - mongo 18 | entrypoint: > 19 | bash -c "sleep 5 && 20 | mongo --host mongo:27017 --eval ' 21 | rs.initiate({ 22 | _id: \"dbrs\", 23 | members: [ 24 | { _id: 0, host: \"mongo:27017\"} 25 | ] 26 | }) 27 | '" 28 | 29 | volumes: 30 | mongo_data: -------------------------------------------------------------------------------- /docstore/mongodocstore/localmongo.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2019 The Go Cloud Development Kit Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # Starts two local MongoDB instances (v3 and v4) via Docker listening on two 17 | # different ports. 18 | 19 | # https://coderwall.com/p/fkfaqq/safer-bash-scripts-with-set-euxo-pipefail 20 | set -euo pipefail 21 | 22 | echo "Starting MongoDB v4 listening on 27017..." 23 | docker rm -f mongo4 mongosetup &> /dev/null || : 24 | docker compose -f ./docstore/mongodocstore/docker-compose.yml up --wait &> /dev/null 25 | sleep 3 26 | echo "...done. Run \"docker rm -f mongo4 mongosetup\" to clean up the container." 27 | echo 28 | 29 | echo "Starting MongoDB v3 listening on 27020..." 30 | docker rm -f mongo3 &> /dev/null || : 31 | docker run -d --name mongo3 -p 27020:27017 mongo:3 &> /dev/null 32 | echo "...done. Run \"docker rm -f mongo3\" to clean up the container." 33 | echo 34 | 35 | -------------------------------------------------------------------------------- /docstore/mongodocstore/testdata/README: -------------------------------------------------------------------------------- 1 | This directory is here just so that the prerelease script (internal/testing/prerelease.sh) 2 | will run this package's tests with -record. 3 | -------------------------------------------------------------------------------- /docstore/oc_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Cloud Development Kit Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package docstore_test 16 | 17 | import ( 18 | "context" 19 | "testing" 20 | 21 | "gocloud.dev/docstore" 22 | "gocloud.dev/docstore/memdocstore" 23 | "gocloud.dev/gcerrors" 24 | "gocloud.dev/internal/testing/octest" 25 | ) 26 | 27 | func TestOpenCensus(t *testing.T) { 28 | ctx := context.Background() 29 | te := octest.NewTestExporter(docstore.OpenCensusViews) 30 | defer te.Unregister() 31 | 32 | coll, err := memdocstore.OpenCollection("_id", nil) 33 | if err != nil { 34 | t.Fatal(err) 35 | } 36 | defer coll.Close() 37 | 38 | // ActionList.Do. 39 | if err := coll.Create(ctx, map[string]interface{}{"_id": "a", "count": 0}); err != nil { 40 | t.Fatal(err) 41 | } 42 | 43 | // Query.Get. 44 | iter := coll.Query().Get(ctx) 45 | iter.Stop() 46 | 47 | const driver = "gocloud.dev/docstore/memdocstore" 48 | 49 | diff := octest.Diff(te.Spans(), te.Counts(), "gocloud.dev/docstore", driver, []octest.Call{ 50 | {Method: "ActionList.Do", Code: gcerrors.OK}, 51 | {Method: "Query.Get", Code: gcerrors.OK}, 52 | }) 53 | if diff != "" { 54 | t.Error(diff) 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /gcerrors/errors_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Cloud Development Kit Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package gcerrors 16 | 17 | import ( 18 | "context" 19 | "io" 20 | "testing" 21 | 22 | "gocloud.dev/internal/gcerr" 23 | ) 24 | 25 | type wrappedErr struct { 26 | err error 27 | } 28 | 29 | func (w wrappedErr) Error() string { return "wrapped" } 30 | 31 | func (w wrappedErr) Unwrap() error { return w.err } 32 | 33 | func TestCode(t *testing.T) { 34 | for _, test := range []struct { 35 | in error 36 | want ErrorCode 37 | }{ 38 | {nil, OK}, 39 | {gcerr.New(AlreadyExists, nil, 1, ""), AlreadyExists}, 40 | {wrappedErr{gcerr.New(PermissionDenied, nil, 1, "")}, PermissionDenied}, 41 | {context.Canceled, Canceled}, 42 | {context.DeadlineExceeded, DeadlineExceeded}, 43 | {wrappedErr{context.Canceled}, Canceled}, 44 | {wrappedErr{context.DeadlineExceeded}, DeadlineExceeded}, 45 | {io.EOF, Unknown}, 46 | } { 47 | got := Code(test.in) 48 | if got != test.want { 49 | t.Errorf("%v: got %s, want %s", test.in, got, test.want) 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /gcp/gcpcloud/gcpcloud.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Cloud Development Kit Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package gcpcloud contains Wire providers for GCP services. 16 | package gcpcloud // import "gocloud.dev/gcp/gcpcloud" 17 | 18 | import ( 19 | "github.com/google/wire" 20 | "gocloud.dev/blob/gcsblob" 21 | "gocloud.dev/docstore/gcpfirestore" 22 | "gocloud.dev/gcp" 23 | "gocloud.dev/gcp/cloudsql" 24 | "gocloud.dev/pubsub/gcppubsub" 25 | "gocloud.dev/runtimevar/gcpruntimeconfig" 26 | "gocloud.dev/secrets/gcpkms" 27 | "gocloud.dev/server/sdserver" 28 | ) 29 | 30 | // GCP is a Wire provider set that includes all Google Cloud Platform services 31 | // in this repository and authenticates using Application Default Credentials. 32 | var GCP = wire.NewSet(Services, gcp.DefaultIdentity) 33 | 34 | // Services is a Wire provider set that includes the default wiring for all 35 | // Google Cloud Platform services in this repository, but does not include 36 | // credentials. Individual services may require additional configuration. 37 | var Services = wire.NewSet( 38 | gcp.DefaultTransport, 39 | gcp.NewHTTPClient, 40 | 41 | gcpruntimeconfig.Set, 42 | gcpkms.Set, 43 | gcppubsub.Set, 44 | gcsblob.Set, 45 | cloudsql.CertSourceSet, 46 | gcpfirestore.Set, 47 | sdserver.Set, 48 | ) 49 | -------------------------------------------------------------------------------- /internal/docs/README.md: -------------------------------------------------------------------------------- 1 | # Docs 2 | 3 | This is the documentation for developers of the Go CDK, describing various 4 | coding practices and project processes. 5 | 6 | - [Design Decisions](design.md) 7 | - [Releases](release.md) 8 | -------------------------------------------------------------------------------- /internal/docs/img/user-facing-type-no-driver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/internal/docs/img/user-facing-type-no-driver.png -------------------------------------------------------------------------------- /internal/docs/img/user-facing-type.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/internal/docs/img/user-facing-type.png -------------------------------------------------------------------------------- /internal/gcerr/errorcode_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type=ErrorCode"; DO NOT EDIT. 2 | 3 | package gcerr 4 | 5 | import "strconv" 6 | 7 | const _ErrorCode_name = "OKUnknownNotFoundAlreadyExistsInvalidArgumentInternalUnimplementedFailedPreconditionPermissionDeniedResourceExhaustedCanceledDeadlineExceeded" 8 | 9 | var _ErrorCode_index = [...]uint8{0, 2, 9, 17, 30, 45, 53, 66, 84, 100, 117, 125, 141} 10 | 11 | func (i ErrorCode) String() string { 12 | if i < 0 || i >= ErrorCode(len(_ErrorCode_index)-1) { 13 | return "ErrorCode(" + strconv.FormatInt(int64(i), 10) + ")" 14 | } 15 | return _ErrorCode_name[_ErrorCode_index[i]:_ErrorCode_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /internal/oc/trace_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Cloud Development Kit Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package oc 16 | 17 | import ( 18 | "regexp" 19 | "testing" 20 | ) 21 | 22 | type testDriver struct{} 23 | 24 | func TestProviderName(t *testing.T) { 25 | for _, test := range []struct { 26 | in any 27 | want string 28 | }{ 29 | {nil, ""}, 30 | {testDriver{}, "gocloud.dev/internal/oc"}, 31 | {&testDriver{}, "gocloud.dev/internal/oc"}, 32 | {regexp.Regexp{}, "regexp"}, 33 | } { 34 | got := ProviderName(test.in) 35 | if got != test.want { 36 | t.Errorf("%v: got %q, want %q", test.in, got, test.want) 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /internal/testing/check_mod_tidy.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2019 The Go Cloud Development Kit Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # This script checks to see if `go mod tidy` has been run on the module 17 | # in the current directory. 18 | # 19 | # It exits with status 1 if "go mod tidy && go list -deps ./..." would 20 | # make changes. 21 | # 22 | # TODO(rvangent): Replace this with `go mod tidy --check` when it exists: 23 | # https://github.com/golang/go/issues/27005. 24 | # 25 | # TODO(rvangent): Drop the "go list" part here and in gomodcleanup.sh once 26 | # https://github.com/golang/go/issues/31248 is fixed. 27 | 28 | set -euo pipefail 29 | 30 | TMP_GOMOD=$(mktemp) 31 | TMP_GOSUM=$(mktemp) 32 | 33 | function cleanup() { 34 | # Restore the original files in case "go mod tidy" made changes. 35 | if [[ -f "$TMP_GOMOD" ]]; then 36 | mv "$TMP_GOMOD" ./go.mod 37 | fi 38 | if [[ -f "$TMP_GOSUM" ]]; then 39 | mv "$TMP_GOSUM" ./go.sum 40 | fi 41 | } 42 | trap cleanup EXIT 43 | 44 | # Make copies of the current files. 45 | cp ./go.mod "$TMP_GOMOD" 46 | cp ./go.sum "$TMP_GOSUM" 47 | 48 | # Modifies the files in-place. 49 | go mod tidy 50 | go list -deps ./... &> /dev/null 51 | 52 | # Check for diffs. 53 | diff -u "$TMP_GOMOD" ./go.mod 54 | diff -u "$TMP_GOSUM" ./go.sum 55 | -------------------------------------------------------------------------------- /internal/testing/deploywebsite.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # To update the website: 4 | # 5 | # Install Hugo locally, by downloading a version (at least 0.92) and unpacking: 6 | # 7 | # In $HUGODIR: 8 | # 9 | # wget https://github.com/gohugoio/hugo/releases/download/v0.91.2/hugo_0.91.2_Linux-64bit.tar.gz 10 | # tar xvf hugo_0.91.2_Linux-64bit.tar.gz 11 | # 12 | # This creates a binary $HUGODIR/hugo 13 | # 14 | # In a go-cloud clone, run: 15 | # 16 | # $HUGODIR/hugo -s internal/website 17 | # 18 | # This updates the internal/website/public directory with the new contents of 19 | # the website. Now we'll need a separate clone of go-cloud, with the gh-pages 20 | # branch checked out: 21 | # 22 | # git clone git@github.com:google/go-cloud.git GH-PAGES-CLONE 23 | # cd GH-PAGES-CLONE 24 | # git co gh-pages 25 | # 26 | # This should have the contents of the website (configured in 27 | # https://github.com/google/go-cloud/settings/pages). 28 | # 29 | # Once that's ready, copy the contents of internal/website/public into the root 30 | # directory of the clone that's on the gh-pages branch, e.g. with rsync: 31 | # 32 | # rsync -avc internal/website/public/ GH-PAGES-CLONE 33 | # 34 | # Commit into the gh-pages branch and push it to origin (git push origin 35 | # gh-pages). This deploys the new site contents. 36 | 37 | # (Old) 38 | # Here's what we had in Travis: 39 | # install: "curl -fsSL https://github.com/gohugoio/hugo/releases/download/v0.54.0/hugo_0.54.0_Linux-64bit.tar.gz | tar zxf - -C \"$HOME\" hugo" 40 | # script: "HUGO_GOOGLEANALYTICS=UA-135118641-1 \"$HOME/hugo\" -s internal/website" 41 | # deploy: 42 | # provider: pages 43 | # edge: true 44 | # fqdn: gocloud.dev 45 | # skip-cleanup: true 46 | # local-dir: internal/website/public 47 | -------------------------------------------------------------------------------- /internal/testing/git_tag_modules.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2021 The Go Cloud Development Kit Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # This script should be run from the root directory. 17 | # It creates git tags for all marked modules listed in the allmodules file. 18 | set -euo pipefail 19 | 20 | function usage() { 21 | echo 22 | echo "Usage: git_tag_modules.sh vX.X.X" 1>&2 23 | echo " vX.X.X: the git tag version" 24 | exit 64 25 | } 26 | 27 | if [[ $# -ne 1 ]] ; then 28 | echo "Need at least one argument" 29 | usage 30 | fi 31 | version="$1" 32 | 33 | sed -e '/^#/d' -e '/^$/d' allmodules | awk '{ print $1, $2}' | while read -r path update || [[ -n "$path" ]] ; do 34 | if [[ "$update" != "yes" ]]; then 35 | echo "$path is not marked to be released" 36 | continue 37 | fi 38 | 39 | tag="$version" 40 | if [[ "$path" != "." ]]; then 41 | tag="$path/$version" 42 | fi 43 | echo "Creating tag: ${tag}" 44 | git tag "$tag" 45 | done 46 | -------------------------------------------------------------------------------- /internal/testing/gomodcleanup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2019 The Go Cloud Development Kit Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # This script should be run from the root directory. 17 | # It runs "go mod tidy && go list -deps ./..." on all modules in 18 | # the repo, to ensure that go.mod and go.sum are in the canonical 19 | # form that tests will verify (see check_mod_tidy.sh). 20 | set -euo pipefail 21 | 22 | sed -e '/^#/d' -e '/^$/d' allmodules | awk '{print $1}' | while read -r path || [[ -n "$path" ]]; do 23 | echo "cleaning up $path" 24 | ( cd "$path" && go mod tidy && go list -deps ./... &> /dev/null || echo " FAILED!") 25 | done 26 | -------------------------------------------------------------------------------- /internal/testing/listdeps.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2019 The Go Cloud Development Kit Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | set -euo pipefail 17 | 18 | # To run this script manually to update alldeps: 19 | # 20 | # $ internal/testing/listdeps.sh > internal/testing/alldeps 21 | # 22 | # Make sure to use the same version of Go as used by tests 23 | # (see .github/actions/tests.yml) when updating the alldeps file. 24 | tmpfile=$(mktemp) 25 | function cleanup() { 26 | rm -rf "$tmpfile" 27 | } 28 | trap cleanup EXIT 29 | 30 | 31 | sed -e '/^#/d' -e '/^$/d' allmodules | awk '{print $1}' | while read -r path || [[ -n "$path" ]]; do 32 | ( cd "$path" && go list -mod=readonly -deps -f '{{with .Module}}{{.Path}}{{end}}' ./... >> "$tmpfile") 33 | done 34 | 35 | # Sort using the native byte values to keep results from different environment consistent. 36 | LC_ALL=C sort "$tmpfile" | uniq 37 | -------------------------------------------------------------------------------- /internal/testing/start_local_deps.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2019 The Go Cloud Development Kit Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # Starts all local instances needed for Go CDK tests. 17 | # You must have Docker installed. 18 | # Run this script from the top level of the tree, e.g.: 19 | # ./internal/testing/start_local_deps.sh 20 | 21 | # https://coderwall.com/p/fkfaqq/safer-bash-scripts-with-set-euxo-pipefail 22 | set -euo pipefail 23 | 24 | ./pubsub/kafkapubsub/localkafka.sh 25 | ./pubsub/rabbitpubsub/localrabbit.sh 26 | ./runtimevar/etcdvar/localetcd.sh 27 | ./docstore/mongodocstore/localmongo.sh 28 | ./secrets/hashivault/localvault.sh 29 | 30 | sleep 10 31 | -------------------------------------------------------------------------------- /internal/testing/terraform/terraform.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Cloud Development Kit Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package terraform provides a function to read Terraform output. 16 | package terraform // import "gocloud.dev/internal/testing/terraform" 17 | 18 | import ( 19 | "encoding/json" 20 | "fmt" 21 | "os/exec" 22 | ) 23 | 24 | // ReadOutput runs `terraform output` on the given directory and returns 25 | // the parsed result. 26 | func ReadOutput(dir string) (map[string]Output, error) { 27 | c := exec.Command("terraform", "output", "-json") 28 | c.Dir = dir 29 | data, err := c.Output() 30 | if err != nil { 31 | return nil, fmt.Errorf("read terraform output: %v", err) 32 | } 33 | var parsed map[string]Output 34 | if err := json.Unmarshal(data, &parsed); err != nil { 35 | return nil, fmt.Errorf("read terraform output: %v", err) 36 | } 37 | return parsed, nil 38 | } 39 | 40 | // Output describes a single output value. 41 | type Output struct { 42 | Type string `json:"type"` // one of "string", "list", or "map" 43 | Sensitive bool `json:"sensitive"` 44 | Value any `json:"value"` 45 | } 46 | -------------------------------------------------------------------------------- /internal/testing/update_deps.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2019 The Go Cloud Development Kit Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # This script should be run from the root directory. 17 | # It runs "go get -u && go mod tidy" on all modules in 18 | # the repo, to update dependencies. Run runchecks.sh afterwards. 19 | set -euo pipefail 20 | 21 | sed -e '/^#/d' -e '/^$/d' allmodules | awk '{print $1}' | while read -r path || [[ -n "$path" ]]; do 22 | echo "updating $path" 23 | ( cd "$path" && go get -u ./... &> /dev/null && go mod tidy &> /dev/null || echo " FAILED! (some modules without code, like samples, are expected to fail)") 24 | done 25 | -------------------------------------------------------------------------------- /internal/website/README.md: -------------------------------------------------------------------------------- 1 | # gocloud.dev source 2 | 3 | Source for the [gocloud.dev website][]. Powered by [Hugo][]. 4 | 5 | [gocloud.dev website]: https://gocloud.dev/ 6 | [Hugo]: https://gohugo.io/ 7 | 8 | ## Local Development 9 | 10 | Use local hugo server for preview. `cd` into this directory and run: 11 | 12 | ``` 13 | $ hugo server -D 14 | ``` 15 | 16 | This will run the Hugo server that auto-updates its output based on the source 17 | contents. It will print out the `localhost:` URL to point the browser to. 18 | 19 | This was tested with Hugo 0.53 but should work with subsequent versions as well. 20 | 21 | ## Editing 22 | 23 | Use `hugo new foo/page.md` to create `content/foo/page.md`. This will 24 | automatically add the appropriate [Front Matter][] to the site. After modifying 25 | an existing page, add the `lastmod` attribute with the current ISO date, which 26 | you can obtain with `date -I`. For example: 27 | 28 | ```yaml 29 | --- 30 | title: Foo 31 | date: "2019-03-17T09:00:00-07:00" 32 | lastmod: "2019-03-18T13:30:12-07:00" 33 | --- 34 | 35 | ... 36 | ``` 37 | 38 | [Front Matter]: https://gohugo.io/content-management/front-matter/ 39 | -------------------------------------------------------------------------------- /internal/website/archetypes/default.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "{{ replace .Name "-" " " | title }}" 3 | date: {{ .Date }} 4 | draft: true 5 | showInSidenav: false # only for sections (any level) 6 | pagesInSidenav: false # only for top-level sections 7 | weight: 0 8 | --- 9 | 10 | -------------------------------------------------------------------------------- /internal/website/archetypes/howto.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "{{ replace .Name "-" " " | title }}" 3 | date: {{ .Date }} 4 | draft: true 5 | showInSidenav: false # only for sections (any level) 6 | weight: 0 7 | --- 8 | 9 | -------------------------------------------------------------------------------- /internal/website/config.toml: -------------------------------------------------------------------------------- 1 | baseURL = "https://gocloud.dev/" 2 | languageCode = "en-us" 3 | title = "Go CDK" 4 | copyright = "Copyright © 2018–2019 The Go Cloud Development Kit Authors" 5 | pygmentsUseClasses = true 6 | pygmentsCodefences = true 7 | 8 | [outputs] 9 | home = ["HTML", "RSS"] 10 | section = ["HTML"] 11 | taxonomy = ["HTML"] 12 | taxonomyTerm = ["HTML", "RSS"] 13 | 14 | [[menu.footer]] 15 | identifier = "github" 16 | name = "GitHub" 17 | url = "https://github.com/google/go-cloud/" 18 | weight = 1 19 | 20 | [[menu.footer]] 21 | identifier = "private-contact" 22 | name = "Contact Team" 23 | url = "https://github.com/google/go-cloud/issues" 24 | weight = 3 25 | -------------------------------------------------------------------------------- /internal/website/content/aws/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/aws 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/aws/awscloud/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/aws/awscloud 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/aws/rds/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/aws/rds 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/azure/azurecloud/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/azure/azurecloud 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/azure/azuredb/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/azure/azuredb 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/blob/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/blob 3 | type: pkg 4 | --- 5 | 6 | -------------------------------------------------------------------------------- /internal/website/content/blob/azureblob/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/blob/azureblob 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/blob/driver/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/blob/driver 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/blob/drivertest/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/blob/drivertest 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/blob/fileblob/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/blob/fileblob 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/blob/gcsblob/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/blob/gcsblob 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/blob/memblob/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/blob/memblob 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/blob/s3blob/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/blob/s3blob 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/concepts/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Concepts" 3 | date: 2019-05-06T09:52:00-07:00 4 | showInSidenav: true 5 | pagesInSidenav: true 6 | weight: 4 7 | --- 8 | 9 | The documents in this section describe higher level concepts in the Go CDK. 10 | -------------------------------------------------------------------------------- /internal/website/content/concepts/as.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Using provider-specific APIs 3 | date: 2019-05-10T11:17:09-07:00 4 | weight: 3 5 | --- 6 | 7 | It is not feasible or desirable for APIs like `blob.Bucket` to encompass the 8 | full functionality of every provider. Rather, we intend to provide a subset 9 | of the most commonly used functionality. There will be cases where a 10 | developer wants to access provider-specific functionality, such as unexposed 11 | APIs or data fields, errors, or options. This can be accomplished using `As` 12 | functions. 13 | 14 | 15 | 16 | ## `As` {#as} 17 | 18 | `As` functions in the APIs provide the user a way to escape the Go CDK 19 | abstraction to access provider-specific types. They might be used as an 20 | interim solution until a feature request to the Go CDK is implemented. Or, 21 | the Go CDK may choose not to support specific features, and the use of `As` 22 | will be permanent. 23 | 24 | Using `As` implies that the resulting code is no longer portable; the 25 | provider-specific code will need to be ported in order to switch providers. 26 | Therefore, it should be avoided if possible. 27 | 28 | Each API includes examples demonstrating how to use its various `As` 29 | functions, and each provider implementation documents what types it supports 30 | for each. 31 | 32 | Usage: 33 | 34 | 1. Declare a variable of the provider-specific type you want to access. 35 | 2. Pass a pointer to it to `As`. 36 | 3. If the type is supported, `As` will return `true` and copy the 37 | provider-specific type into your variable. Otherwise, it will return `false`. 38 | 39 | Provider-specific types that are intended to be mutable will be exposed 40 | as a pointer to the underlying type. 41 | -------------------------------------------------------------------------------- /internal/website/content/concepts/structure/portable-type-no-driver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/internal/website/content/concepts/structure/portable-type-no-driver.png -------------------------------------------------------------------------------- /internal/website/content/concepts/structure/portable-type.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/internal/website/content/concepts/structure/portable-type.png -------------------------------------------------------------------------------- /internal/website/content/docstore/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/docstore 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/docstore/awsdynamodb/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/docstore/awsdynamodb 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/docstore/driver/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/docstore/driver 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/docstore/drivertest/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/docstore/drivertest 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/docstore/dynamodocstore/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/docstore/dynamodocstore 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/docstore/firedocstore/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/docstore/firedocstore 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/docstore/gcpfirestore/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/docstore/gcpfirestore 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/docstore/internal/fields/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/docstore/internal/fields 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/docstore/memdocstore/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/docstore/memdocstore 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/docstore/mongodocstore/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/docstore/mongodocstore 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/gcerrors/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/gcerrors 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/gcp/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/gcp 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/gcp/cloudsql/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/gcp/cloudsql 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/gcp/gcpcloud/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/gcp/gcpcloud 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/health/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/health 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/health/sqlhealth/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/health/sqlhealth 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/howto/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "How-To Guides" 3 | date: 2019-03-20T14:50:56-07:00 4 | showInSidenav: true 5 | pagesInSidenav: true 6 | weight: 2 7 | --- 8 | 9 | The guides in this section are aimed to help you solve common tasks with 10 | the Go CDK. They are grouped by API. 11 | -------------------------------------------------------------------------------- /internal/website/content/howto/pubsub/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Pub/Sub" 3 | date: 2019-03-26T09:44:06-07:00 4 | showInSidenav: true 5 | --- 6 | 7 | The [`pubsub` package][] provides an easy and portable way to interact with 8 | publish/subscribe systems. This guide shows how to work with pubsub 9 | in the Go CDK. 10 | 11 | 12 | 13 | The [publish/subscribe model][] allows parts of a system to publish messages 14 | that other parts of a system may subscribe to. This is commonly used to 15 | arrange for work to happen at some point after an interactive frontend 16 | request is finished or in other event-driven computing. 17 | 18 | The [`pubsub` package][] supports operations to publish messages to a topic and 19 | to subscribe to receive messages from a topic. 20 | 21 | Subpackages contain driver implementations of pubsub for various services, 22 | including Cloud and on-prem solutions. You can develop your application 23 | locally using [`mempubsub`][], then deploy it to multiple Cloud providers with 24 | minimal initialization reconfiguration. 25 | 26 | [publish/subscribe model]: https://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern 27 | [`pubsub` package]: https://godoc.org/gocloud.dev/pubsub 28 | [`mempubsub`]: https://godoc.org/gocloud.dev/pubsub/mempubsub 29 | 30 | -------------------------------------------------------------------------------- /internal/website/content/internal/batcher/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/internal/batcher 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/internal/escape/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/internal/escape 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/internal/gcerr/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/internal/gcerr 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/internal/oc/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/internal/oc 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/internal/openurl/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/internal/openurl 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/internal/otel/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/internal/otel 3 | type: pkg 4 | --- 5 | 6 | Package otel provides OpenTelemetry integration for Go Cloud Development Kit, supporting tracing, metrics, and logging. It serves as the primary instrumentation framework, replacing the deprecated OpenCensus implementation. 7 | -------------------------------------------------------------------------------- /internal/website/content/internal/releasehelper/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/internal/releasehelper 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/internal/retry/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/internal/retry 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/internal/testing/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/internal/testing 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/internal/testing/cmdtest/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/internal/testing/cmdtest 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/internal/testing/octest/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/internal/testing/octest 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/internal/testing/oteltest/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/internal/testing/oteltest 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/internal/testing/setup/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/internal/testing/setup 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/internal/testing/terraform/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/internal/testing/terraform 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/internal/testing/test-summary/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/internal/testing/test-summary 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/internal/trace/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/internal/trace 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/internal/useragent/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/internal/useragent 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/internal/website/gatherexamples/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/internal/website/gatherexamples 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/mysql/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/mysql 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/mysql/awsmysql/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/mysql/awsmysql 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/mysql/azuremysql/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/mysql/azuremysql 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/mysql/cloudmysql/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/mysql/cloudmysql 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/mysql/gcpmysql/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/mysql/gcpmysql 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/mysql/rdsmysql/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/mysql/rdsmysql 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/postgres/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/postgres 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/postgres/awspostgres/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/postgres/awspostgres 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/postgres/cloudpostgres/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/postgres/cloudpostgres 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/postgres/gcppostgres/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/postgres/gcppostgres 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/postgres/rdspostgres/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/postgres/rdspostgres 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/pubsub/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/pubsub 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/pubsub/awssnssqs/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/pubsub/awssnssqs 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/pubsub/azurepubsub/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/pubsub/azurepubsub 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/pubsub/azuresb/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/pubsub/azuresb 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/pubsub/batcher/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/internal/batcher 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/pubsub/driver/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/pubsub/driver 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/pubsub/drivertest/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/pubsub/drivertest 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/pubsub/gcppubsub/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/pubsub/gcppubsub 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/pubsub/kafkapubsub/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/pubsub/kafkapubsub 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/pubsub/mempubsub/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/pubsub/mempubsub 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/pubsub/natspubsub/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/pubsub/natspubsub 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/pubsub/rabbitpubsub/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/pubsub/rabbitpubsub 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/requestlog/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/requestlog 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/runtimevar/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/runtimevar 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/runtimevar/awsparamstore/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/runtimevar/awsparamstore 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/runtimevar/awssecretsmanager/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/runtimevar/awssecretsmanager 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/runtimevar/blobvar/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/runtimevar/blobvar 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/runtimevar/constantvar/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/runtimevar/constantvar 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/runtimevar/driver/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/runtimevar/driver 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/runtimevar/drivertest/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/runtimevar/drivertest 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/runtimevar/etcdvar/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/runtimevar/etcdvar 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/runtimevar/filevar/_demo/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/runtimevar/filevar/_demo 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/runtimevar/filevar/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/runtimevar/filevar 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/runtimevar/gcpruntimeconfig/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/runtimevar/gcpruntimeconfig 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/runtimevar/gcpsecretmanager/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/runtimevar/gcpsecretmanager 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/runtimevar/httpvar/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/runtimevar/httpvar 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/samples/appengine/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/samples/appengine 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/samples/gocdk-blob/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/samples/gocdk-blob 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/samples/gocdk-docstore/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Gocdk Docstore" 3 | date: 2019-06-11T14:33:50-07:00 4 | showInSidenav: false # only for sections (any level) 5 | pagesInSidenav: false # only for top-level sections 6 | weight: 0 7 | --- 8 | 9 | -------------------------------------------------------------------------------- /internal/website/content/samples/gocdk-pubsub/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/samples/gocdk-pubsub 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/samples/gocdk-runtimevar/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/samples/gocdk-runtimevar 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/samples/gocdk-secrets/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/samples/gocdk-secrets 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/samples/guestbook/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/samples/guestbook 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/samples/guestbook/aws/provision_db/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/samples/guestbook/aws/provision_db 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/samples/guestbook/gcp/deploy/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/samples/guestbook/gcp/deploy 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/samples/guestbook/gcp/provision_db/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/samples/guestbook/gcp/provision_db 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/samples/guestbook/localdb/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/samples/guestbook/localdb 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/samples/order/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/samples/order 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/samples/server/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/samples/server 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/samples/tutorial/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/samples/tutorial 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/secrets/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/secrets 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/secrets/awskms/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/secrets/awskms 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/secrets/azurekeyvault/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/secrets/azurekeyvault 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/secrets/driver/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/secrets/driver 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/secrets/drivertest/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/secrets/drivertest 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/secrets/gcpkms/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/secrets/gcpkms 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/secrets/hashivault/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/secrets/hashivault 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/secrets/localsecrets/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/secrets/localsecrets 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/secrets/vault/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/secrets/vault 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/server/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/server 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/server/driver/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/server/driver 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/server/health/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/server/health 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/server/health/sqlhealth/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/server/health/sqlhealth 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/server/requestlog/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/server/requestlog 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/server/sdserver/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/server/sdserver 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/server/xrayserver/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/server/xrayserver 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/tests/aws/app/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/tests/aws/app 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/tests/gcp/app/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/tests/gcp/app 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/tests/internal/testutil/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gocloud.dev/tests/internal/testutil 3 | type: pkg 4 | --- 5 | -------------------------------------------------------------------------------- /internal/website/content/tutorials/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Tutorials" 3 | date: 2019-03-19T18:45:15-07:00 4 | showInSidenav: true 5 | pagesInSidenav: true 6 | weight: 1 7 | --- 8 | 9 | -------------------------------------------------------------------------------- /internal/website/gatherexamples/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2019 The Go Cloud Development Kit Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # Run gatherexamples for the project. 17 | # The output of this script should be piped into 18 | # internal/website/data/examples.json, where it's picked up by Hugo. 19 | 20 | set -eo pipefail 21 | cd "$(dirname "${BASH_SOURCE[0]}")/../../.." 22 | cd internal/website/gatherexamples 23 | go build gatherexamples.go 24 | cd ../../.. 25 | sed -e '/^#/d' -e '/^$/d' allmodules | awk '{print $1}' | xargs internal/website/gatherexamples/gatherexamples 26 | -------------------------------------------------------------------------------- /internal/website/go.mod: -------------------------------------------------------------------------------- 1 | module gocloud.dev/internal/website 2 | 3 | go 1.23.0 4 | 5 | require ( 6 | github.com/google/go-cmp v0.6.0 7 | golang.org/x/tools v0.31.0 8 | ) 9 | 10 | require ( 11 | golang.org/x/mod v0.24.0 // indirect 12 | golang.org/x/sync v0.12.0 // indirect 13 | ) 14 | -------------------------------------------------------------------------------- /internal/website/go.sum: -------------------------------------------------------------------------------- 1 | github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= 2 | github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= 3 | golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU= 4 | golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= 5 | golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw= 6 | golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= 7 | golang.org/x/tools v0.31.0 h1:0EedkvKDbh+qistFTd0Bcwe/YLh4vHwWEkiI0toFIBU= 8 | golang.org/x/tools v0.31.0/go.mod h1:naFTU+Cev749tSJRXJlna0T3WxKvb1kWEx15xA4SdmQ= 9 | -------------------------------------------------------------------------------- /internal/website/layouts/404.html: -------------------------------------------------------------------------------- 1 | {{ define "main" }} 2 |

404: Page not found

3 |

4 | Sorry, we've misplaced that URL or it's pointing to something that doesn't exist. 5 | Head back home to try finding it again. 6 |

7 | {{ end }} 8 | -------------------------------------------------------------------------------- /internal/website/layouts/_default/li.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /internal/website/layouts/_default/list.html: -------------------------------------------------------------------------------- 1 | {{ define "main" -}} 2 |

{{ .Title }}

3 | {{ partial "page-toc.html" . }} 4 | {{ partial "header-link.html" .Content }} 5 | {{ with .Data.Pages.GroupBy "Weight" }} 6 |
7 | {{- range .}} 8 | {{- range .Pages.ByTitle}} 9 | {{.Render "li"}} 10 | {{- end }} 11 | {{- end }} 12 |
13 | {{end}} 14 | {{- end }} 15 | -------------------------------------------------------------------------------- /internal/website/layouts/_default/single.html: -------------------------------------------------------------------------------- 1 | {{ define "main" -}} 2 |

{{ .Title }}

3 | {{ partial "page-toc.html" . }} 4 | {{ partial "header-link.html" .Content }} 5 | {{- end }} 6 | -------------------------------------------------------------------------------- /internal/website/layouts/_default/sitemap.xml: -------------------------------------------------------------------------------- 1 | {{ printf "" | safeHTML }} 2 | 4 | {{ range sort .Data.Pages "Permalink" }} 5 | 6 | {{ .Permalink }}{{ if not .Lastmod.IsZero }} 7 | {{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}{{ end }}{{ with .Sitemap.ChangeFreq }} 8 | {{ . }}{{ end }}{{ if ge .Sitemap.Priority 0.0 }} 9 | {{ .Sitemap.Priority }}{{ end }}{{ if .IsTranslated }}{{ range .Translations }} 10 | {{ end }} 15 | {{ end }} 20 | 21 | {{ end }} 22 | 23 | -------------------------------------------------------------------------------- /internal/website/layouts/howto/li.html: -------------------------------------------------------------------------------- 1 |
  • 2 | {{ .LinkTitle }} 3 |
  • 4 | -------------------------------------------------------------------------------- /internal/website/layouts/howto/list.html: -------------------------------------------------------------------------------- 1 | {{ define "main" -}} 2 |

    {{ .Title }}

    3 | {{ partial "page-toc.html" . }} 4 | {{ partial "header-link.html" .Content }} 5 | {{ if or .Data.Pages }} 6 |
      7 | {{- range .Data.Pages.GroupBy "Weight" }} 8 | {{- range .ByTitle }} 9 | {{.Render "li"}} 10 | {{- end }} 11 | {{- end }} 12 |
    13 | {{- end }} 14 | {{- end }} 15 | -------------------------------------------------------------------------------- /internal/website/layouts/index.html: -------------------------------------------------------------------------------- 1 | {{ define "main" -}} 2 | {{ partial "header-link.html" .Content }} 3 | {{- end }} 4 | -------------------------------------------------------------------------------- /internal/website/layouts/partials/header-link.html: -------------------------------------------------------------------------------- 1 | {{- /* https://zwbetz.com/create-header-links-hugo-vs-javascript/ */ -}} 2 | {{ . | replaceRE "()(.+)()" `${1} ${3}🔗${4}` | safeHTML -}} 3 | -------------------------------------------------------------------------------- /internal/website/layouts/partials/hook_head_end.html: -------------------------------------------------------------------------------- 1 | {{if .Page.Params.pkgmeta}} 2 | 3 | 4 | {{end}} 5 | -------------------------------------------------------------------------------- /internal/website/layouts/partials/page-toc.html: -------------------------------------------------------------------------------- 1 | {{if .Page.Params.toc}} 2 | 6 | {{end -}} 7 | -------------------------------------------------------------------------------- /internal/website/layouts/pkg/list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Nothing to see here; see the package on godoc. 10 | 11 | 12 | -------------------------------------------------------------------------------- /internal/website/layouts/pkg/single.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Nothing to see here; see the package on godoc. 10 | 11 | 12 | -------------------------------------------------------------------------------- /internal/website/layouts/shortcodes/goexample.html: -------------------------------------------------------------------------------- 1 | {{/* 2 | Usage: 3 | 4 | goexample "gocloud.dev/foo.ExampleBar" 5 | goexample src="gocloud.dev/foo.ExampleBar" 6 | goexample src="gocloud.dev/foo.ExampleBar" imports="0" 7 | 8 | */ -}} 9 | {{ if .IsNamedParams -}} 10 | {{ with index .Site.Data.examples (.Get "src") -}} 11 | {{ if and .imports (ne ($.Get "imports") "0") -}} 12 | {{ highlight (printf "%s\n\n%s\n" .imports .code) "go" "" -}} 13 | {{ else -}} 14 | {{ highlight (printf "%s\n" .code) "go" "" -}} 15 | {{ end -}} 16 | {{ else -}} 17 | {{ errorf "%s: Example %q does not exist" ($.Page.File.Path) (.Get "src") -}} 18 | {{end -}} 19 | {{ else -}} 20 | {{ with index .Site.Data.examples (.Get 0) -}} 21 | {{ if .imports -}} 22 | {{ highlight (printf "%s\n\n%s\n" .imports .code) "go" "" -}} 23 | {{ else -}} 24 | {{ highlight (printf "%s\n" .code) "go" "" -}} 25 | {{ end -}} 26 | {{ else -}} 27 | {{ errorf "%s: Example %q does not exist" ($.Page.File.Path) (.Get 0) -}} 28 | {{end -}} 29 | {{ end -}} 30 | -------------------------------------------------------------------------------- /internal/website/layouts/shortcodes/snippet.html: -------------------------------------------------------------------------------- 1 | {{ readFile (.Get 0 | printf "/snippets/%s") | markdownify -}} 2 | -------------------------------------------------------------------------------- /internal/website/listnewpkgs.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2019 The Go Cloud Development Kit Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # This script lists the package names that makeimports.sh would create 17 | # _index.md files for, one per line. 18 | 19 | 20 | # https://coderwall.com/p/fkfaqq/safer-bash-scripts-with-set-euxo-pipefail 21 | # except x is too verbose 22 | set -euo pipefail 23 | 24 | # Change into repository root. 25 | cd "$(dirname "$0")/../.." 26 | OUTDIR=internal/website/content 27 | 28 | shopt -s nullglob # glob patterns that don't match turn into the empty string, instead of themselves 29 | 30 | function files_exist() { # assumes nullglob 31 | [[ ${1:-""} != "" ]] 32 | } 33 | 34 | # Find all directories that do not begin with '.' or '_' or contain 'testdata'. Use the %P printf 35 | # directive to remove the initial './'. 36 | for pkg in $(find . -type d \( -name '[._]?*' -prune -o -name testdata -prune -o -printf '%P ' \)); do 37 | # Only consider directories that contain Go source files. 38 | outfile="$OUTDIR/$pkg/_index.md" 39 | if files_exist $pkg/*.go && [[ ! -e "$outfile" ]]; then 40 | echo "$pkg" 41 | fi 42 | done 43 | 44 | -------------------------------------------------------------------------------- /internal/website/makeimports.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2018 The Go Cloud Development Kit Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # This script generates Markdown files that will include suitable for 17 | # "go get"'s import path redirection feature (see 18 | # https://golang.org/cmd/go/#hdr-Remote_import_paths) in the final Hugo output. 19 | 20 | 21 | # https://coderwall.com/p/fkfaqq/safer-bash-scripts-with-set-euxo-pipefail 22 | # except x is too verbose 23 | set -euo pipefail 24 | 25 | # Change into repository root. 26 | cd "$(dirname "$0")/../.." 27 | OUTDIR=internal/website/content 28 | 29 | for pkg in $(internal/website/listnewpkgs.sh); do 30 | # Only consider directories that contain Go source files. 31 | outfile="$OUTDIR/$pkg/_index.md" 32 | mkdir -p "$OUTDIR/$pkg" 33 | echo "Generating gocloud.dev/$pkg" 34 | echo "---" >> "$outfile" 35 | echo "title: gocloud.dev/$pkg" >> "$outfile" 36 | echo "type: pkg" >> "$outfile" 37 | echo "---" >> "$outfile" 38 | done 39 | 40 | -------------------------------------------------------------------------------- /internal/website/static/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/internal/website/static/favicon-32x32.png -------------------------------------------------------------------------------- /internal/website/static/gh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/internal/website/static/gh.png -------------------------------------------------------------------------------- /internal/website/static/go-cdk-logo-gopherblue-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/internal/website/static/go-cdk-logo-gopherblue-small.png -------------------------------------------------------------------------------- /internal/website/static/go-cdk-logo-gopherblue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/internal/website/static/go-cdk-logo-gopherblue.png -------------------------------------------------------------------------------- /internal/website/static/go-cdk-logo-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/internal/website/static/go-cdk-logo-white.png -------------------------------------------------------------------------------- /internal/website/static/placeholder-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/internal/website/static/placeholder-logo.png -------------------------------------------------------------------------------- /mysql/awsmysql/example_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Cloud Development Kit Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package awsmysql_test 16 | 17 | import ( 18 | "context" 19 | "log" 20 | 21 | "gocloud.dev/mysql" 22 | _ "gocloud.dev/mysql/awsmysql" 23 | ) 24 | 25 | func Example() { 26 | // PRAGMA: This example is used on gocloud.dev; PRAGMA comments adjust how it is shown and can be ignored. 27 | // PRAGMA: On gocloud.dev, add a blank import: _ "gocloud.dev/mysql/awsmysql" 28 | // PRAGMA: On gocloud.dev, hide lines until the next blank line. 29 | ctx := context.Background() 30 | 31 | // Replace these with your actual settings. 32 | db, err := mysql.Open(ctx, 33 | "awsmysql://myrole:swordfish@example01.xyzzy.us-west-1.rds.amazonaws.com/testdb") 34 | if err != nil { 35 | log.Fatal(err) 36 | } 37 | defer db.Close() 38 | 39 | // Use database in your program. 40 | db.ExecContext(ctx, "CREATE TABLE foo (bar INT);") 41 | } 42 | -------------------------------------------------------------------------------- /mysql/azuremysql/example_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Cloud Development Kit Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package azuremysql_test 16 | 17 | import ( 18 | "context" 19 | "log" 20 | 21 | "gocloud.dev/mysql" 22 | _ "gocloud.dev/mysql/azuremysql" 23 | ) 24 | 25 | func Example() { 26 | // PRAGMA: This example is used on gocloud.dev; PRAGMA comments adjust how it is shown and can be ignored. 27 | // PRAGMA: On gocloud.dev, add a blank import: _ "gocloud.dev/mysql/azuremysql" 28 | // PRAGMA: On gocloud.dev, hide lines until the next blank line. 29 | ctx := context.Background() 30 | 31 | // Replace this with your actual settings. 32 | db, err := mysql.Open(ctx, 33 | "azuremysql://user:password@example00.mysql.database.azure.com/testdb") 34 | if err != nil { 35 | log.Fatal(err) 36 | } 37 | defer db.Close() 38 | 39 | // Use database in your program. 40 | db.Exec("CREATE TABLE foo (bar INT);") 41 | } 42 | -------------------------------------------------------------------------------- /mysql/example_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Cloud Development Kit Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package mysql_test 16 | 17 | import ( 18 | "context" 19 | "log" 20 | 21 | "gocloud.dev/mysql" 22 | ) 23 | 24 | func ExampleOpen() { 25 | // PRAGMA: This example is used on gocloud.dev; PRAGMA comments adjust how it is shown and can be ignored. 26 | // PRAGMA: On gocloud.dev, hide lines until the next blank line. 27 | ctx := context.Background() 28 | 29 | // Replace this with your actual settings. 30 | db, err := mysql.Open(ctx, "mysql://user:password@localhost/testdb") 31 | if err != nil { 32 | log.Fatal(err) 33 | } 34 | defer db.Close() 35 | 36 | // Use database in your program. 37 | db.Exec("CREATE TABLE foo (bar INT);") 38 | } 39 | -------------------------------------------------------------------------------- /mysql/gcpmysql/example_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Cloud Development Kit Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package gcpmysql_test 16 | 17 | import ( 18 | "context" 19 | "log" 20 | 21 | "gocloud.dev/mysql" 22 | _ "gocloud.dev/mysql/gcpmysql" 23 | ) 24 | 25 | func Example() { 26 | // PRAGMA: This example is used on gocloud.dev; PRAGMA comments adjust how it is shown and can be ignored. 27 | // PRAGMA: On gocloud.dev, add a blank import: _ "gocloud.dev/mysql/gcpmysql" 28 | // PRAGMA: On gocloud.dev, hide lines until the next blank line. 29 | ctx := context.Background() 30 | 31 | // Replace this with your actual settings. 32 | db, err := mysql.Open(ctx, 33 | "gcpmysql://user:password@example-project/region/my-instance01/testdb") 34 | if err != nil { 35 | log.Fatal(err) 36 | } 37 | defer db.Close() 38 | 39 | // Use database in your program. 40 | db.Exec("CREATE TABLE foo (bar INT);") 41 | } 42 | -------------------------------------------------------------------------------- /postgres/awspostgres/example_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Cloud Development Kit Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package awspostgres_test 16 | 17 | import ( 18 | "context" 19 | "log" 20 | 21 | "gocloud.dev/postgres" 22 | _ "gocloud.dev/postgres/awspostgres" 23 | ) 24 | 25 | func Example() { 26 | // PRAGMA: This example is used on gocloud.dev; PRAGMA comments adjust how it is shown and can be ignored. 27 | // PRAGMA: On gocloud.dev, add a blank import: _ "gocloud.dev/postgres/awspostgres" 28 | // PRAGMA: On gocloud.dev, hide lines until the next blank line. 29 | ctx := context.Background() 30 | 31 | // Replace these with your actual settings. 32 | db, err := postgres.Open(ctx, 33 | "awspostgres://myrole:swordfish@example01.xyzzy.us-west-1.rds.amazonaws.com/testdb") 34 | if err != nil { 35 | log.Fatal(err) 36 | } 37 | defer db.Close() 38 | 39 | // Use database in your program. 40 | db.ExecContext(ctx, "CREATE TABLE foo (bar INT);") 41 | } 42 | -------------------------------------------------------------------------------- /postgres/example_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Cloud Development Kit Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package postgres_test 16 | 17 | import ( 18 | "context" 19 | "log" 20 | 21 | "gocloud.dev/postgres" 22 | ) 23 | 24 | func ExampleOpen() { 25 | // PRAGMA: This example is used on gocloud.dev; PRAGMA comments adjust how it is shown and can be ignored. 26 | // PRAGMA: On gocloud.dev, hide lines until the next blank line. 27 | ctx := context.Background() 28 | 29 | // Replace this with your actual settings. 30 | db, err := postgres.Open(ctx, "postgres://user:password@localhost/testdb") 31 | if err != nil { 32 | log.Fatal(err) 33 | } 34 | defer db.Close() 35 | 36 | // Use database in your program. 37 | db.Exec("CREATE TABLE foo (bar INT);") 38 | } 39 | -------------------------------------------------------------------------------- /postgres/gcppostgres/example_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Cloud Development Kit Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package gcppostgres_test 16 | 17 | import ( 18 | "context" 19 | "log" 20 | 21 | "gocloud.dev/postgres" 22 | _ "gocloud.dev/postgres/gcppostgres" 23 | ) 24 | 25 | func Example() { 26 | // PRAGMA: This example is used on gocloud.dev; PRAGMA comments adjust how it is shown and can be ignored. 27 | // PRAGMA: On gocloud.dev, add a blank import: _ "gocloud.dev/postgres/gcppostgres" 28 | // PRAGMA: On gocloud.dev, hide lines until the next blank line. 29 | ctx := context.Background() 30 | 31 | // Replace this with your actual settings. 32 | db, err := postgres.Open(ctx, 33 | "gcppostgres://user:password@example-project/region/my-instance01/testdb") 34 | if err != nil { 35 | log.Fatal(err) 36 | } 37 | defer db.Close() 38 | 39 | // Use database in your program. 40 | db.Exec("CREATE TABLE foo (bar INT);") 41 | } 42 | -------------------------------------------------------------------------------- /pubsub/awssnssqs/testdata/TestConformanceSQSTopic/TestSendReceiveTwo.replay: -------------------------------------------------------------------------------- 1 | { 2 | "Initial": "AQAAAA7ffPOTAFOhUAAA", 3 | "Version": "0.2", 4 | "Converter": { 5 | "ScrubBody": [ 6 | "MessageAttributes.*" 7 | ], 8 | "ClearHeaders": [ 9 | "^X-Goog-.*Encryption-Key$", 10 | "^Amz-Sdk-Invocation-Id$", 11 | "^X-Amz-Date$", 12 | "^User-Agent$" 13 | ], 14 | "RemoveRequestHeaders": [ 15 | "^Authorization$", 16 | "^Proxy-Authorization$", 17 | "^Connection$", 18 | "^Content-Type$", 19 | "^Date$", 20 | "^Host$", 21 | "^Transfer-Encoding$", 22 | "^Via$", 23 | "^X-Forwarded-.*$", 24 | "^X-Cloud-Trace-Context$", 25 | "^X-Goog-Api-Client$", 26 | "^X-Google-.*$", 27 | "^X-Gfe-.*$", 28 | "^Authorization$", 29 | "^Duration$", 30 | "^X-Amz-Security-Token$" 31 | ], 32 | "RemoveResponseHeaders": [ 33 | "^X-Google-.*$", 34 | "^X-Gfe-.*$" 35 | ], 36 | "ClearParams": [ 37 | "^X-Amz-Date$" 38 | ], 39 | "RemoveParams": [ 40 | "^X-Amz-Credential$", 41 | "^X-Amz-Signature$", 42 | "^X-Amz-Security-Token$" 43 | ] 44 | }, 45 | "Entries": null 46 | } -------------------------------------------------------------------------------- /pubsub/azuresb/testdata/README: -------------------------------------------------------------------------------- 1 | This directory is here just so that the prerelease script (internal/testing/prerelease.sh) 2 | will run this package's tests with -record. 3 | -------------------------------------------------------------------------------- /pubsub/gcppubsub/testdata/TestConformance/TestAs/gcp_test.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/pubsub/gcppubsub/testdata/TestConformance/TestAs/gcp_test.replay -------------------------------------------------------------------------------- /pubsub/gcppubsub/testdata/TestConformance/TestAs/verify_As_returns_false_when_passed_nil.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/pubsub/gcppubsub/testdata/TestConformance/TestAs/verify_As_returns_false_when_passed_nil.replay -------------------------------------------------------------------------------- /pubsub/gcppubsub/testdata/TestConformance/TestBatching.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/pubsub/gcppubsub/testdata/TestConformance/TestBatching.replay -------------------------------------------------------------------------------- /pubsub/gcppubsub/testdata/TestConformance/TestCancelSendReceive.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/pubsub/gcppubsub/testdata/TestConformance/TestCancelSendReceive.replay -------------------------------------------------------------------------------- /pubsub/gcppubsub/testdata/TestConformance/TestDoubleAck.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/pubsub/gcppubsub/testdata/TestConformance/TestDoubleAck.replay -------------------------------------------------------------------------------- /pubsub/gcppubsub/testdata/TestConformance/TestErrorOnReceiveFromClosedSubscription.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/pubsub/gcppubsub/testdata/TestConformance/TestErrorOnReceiveFromClosedSubscription.replay -------------------------------------------------------------------------------- /pubsub/gcppubsub/testdata/TestConformance/TestErrorOnSendToClosedTopic.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/pubsub/gcppubsub/testdata/TestConformance/TestErrorOnSendToClosedTopic.replay -------------------------------------------------------------------------------- /pubsub/gcppubsub/testdata/TestConformance/TestMetadata.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/pubsub/gcppubsub/testdata/TestConformance/TestMetadata.replay -------------------------------------------------------------------------------- /pubsub/gcppubsub/testdata/TestConformance/TestNack.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/pubsub/gcppubsub/testdata/TestConformance/TestNack.replay -------------------------------------------------------------------------------- /pubsub/gcppubsub/testdata/TestConformance/TestNonExistentSubscriptionSucceedsOnOpenButFailsOnReceive.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/pubsub/gcppubsub/testdata/TestConformance/TestNonExistentSubscriptionSucceedsOnOpenButFailsOnReceive.replay -------------------------------------------------------------------------------- /pubsub/gcppubsub/testdata/TestConformance/TestNonExistentTopicSucceedsOnOpenButFailsOnSend.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/pubsub/gcppubsub/testdata/TestConformance/TestNonExistentTopicSucceedsOnOpenButFailsOnSend.replay -------------------------------------------------------------------------------- /pubsub/gcppubsub/testdata/TestConformance/TestNonUTF8MessageBody.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/pubsub/gcppubsub/testdata/TestConformance/TestNonUTF8MessageBody.replay -------------------------------------------------------------------------------- /pubsub/gcppubsub/testdata/TestConformance/TestSendReceive.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/pubsub/gcppubsub/testdata/TestConformance/TestSendReceive.replay -------------------------------------------------------------------------------- /pubsub/gcppubsub/testdata/TestConformance/TestSendReceiveJSON.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/pubsub/gcppubsub/testdata/TestConformance/TestSendReceiveJSON.replay -------------------------------------------------------------------------------- /pubsub/gcppubsub/testdata/TestConformance/TestSendReceiveTwo.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/pubsub/gcppubsub/testdata/TestConformance/TestSendReceiveTwo.replay -------------------------------------------------------------------------------- /pubsub/kafkapubsub/localkafka.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2019 The Go Cloud Development Kit Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # Starts a local Kafka instance (plus supporting Zookeeper) via Docker. 17 | 18 | # https://coderwall.com/p/fkfaqq/safer-bash-scripts-with-set-euxo-pipefail 19 | set -euo pipefail 20 | 21 | # Clean up and run Zookeeper. 22 | echo "Starting Zookeeper (for Kafka)..." 23 | docker rm -f zookeeper &> /dev/null || : 24 | docker run -d --net=host --name=zookeeper -e ZOOKEEPER_CLIENT_PORT=2181 confluentinc/cp-zookeeper:6.0.1 &> /dev/null 25 | echo "...done. Run \"docker rm -f zookeeper\" to clean up the container." 26 | echo 27 | 28 | # Clean up and run Kafka. 29 | echo "Starting Kafka..." 30 | docker rm -f kafka &> /dev/null || : 31 | docker run -d --net=host -p 9092:9092 --name=kafka -e KAFKA_ZOOKEEPER_CONNECT=localhost:2181 -e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://localhost:9092 -e KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1 -e KAFKA_AUTO_CREATE_TOPICS_ENABLE=false -e KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS=100 confluentinc/cp-kafka:6.0.1 &> /dev/null 32 | echo "...done. Run \"docker rm -f kafka\" to clean up the container." 33 | echo 34 | -------------------------------------------------------------------------------- /pubsub/rabbitpubsub/localrabbit.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2019 The Go Cloud Development Kit Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # Starts a local RabbitMQ instance via Docker. 17 | 18 | # https://coderwall.com/p/fkfaqq/safer-bash-scripts-with-set-euxo-pipefail 19 | set -euo pipefail 20 | 21 | echo "Starting RabbitMQ..." 22 | docker rm -f rabbit &> /dev/null || : 23 | docker run -d --name rabbit -p 5672:5672 rabbitmq:3.10.17 &> /dev/null 24 | echo Sleeping to give RabbitMQ some time to come up.... 25 | sleep 60 26 | echo "...done. Run \"docker rm -f rabbit\" to clean up the container." 27 | echo 28 | -------------------------------------------------------------------------------- /runtimevar/etcdvar/localetcd.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2019 The Go Cloud Development Kit Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # Starts a local etcd instance via Docker. 17 | 18 | # https://coderwall.com/p/fkfaqq/safer-bash-scripts-with-set-euxo-pipefail 19 | set -euo pipefail 20 | 21 | # Clean up and run etcd. 22 | echo "Starting etcd..." 23 | docker rm -f etcd &> /dev/null || : 24 | docker run -d -p 2379:2379 -p 4001:4001 --name etcd quay.io/coreos/etcd:v3.5.4 /usr/local/bin/etcd --advertise-client-urls http://0.0.0.0:2379 --listen-client-urls http://0.0.0.0:2379 &> /dev/null 25 | echo "...done. Run \"docker rm -f etcd\" to clean up the container." 26 | echo 27 | -------------------------------------------------------------------------------- /runtimevar/example_openvariable_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Cloud Development Kit Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package runtimevar_test 16 | 17 | import ( 18 | "context" 19 | "fmt" 20 | "log" 21 | 22 | "gocloud.dev/runtimevar" 23 | _ "gocloud.dev/runtimevar/constantvar" 24 | ) 25 | 26 | func Example_openVariableFromURL() { 27 | // Connect to a Variable using a URL. 28 | // This example uses "constantvar", an in-memory implementation. 29 | // We need to add a blank import line to register the constantvar driver's 30 | // URLOpener, which implements runtimevar.VariableURLOpener: 31 | // import _ "gocloud.dev/runtimevar/constantvar" 32 | // constantvar registers for the "constant" scheme. 33 | // All runtimevar.OpenVariable URLs also work with "runtimevar+" or "runtimevar+variable+" prefixes, 34 | // e.g., "runtimevar+constant://..." or "runtimevar+variable+constant://...". 35 | ctx := context.Background() 36 | v, err := runtimevar.OpenVariable(ctx, "constant://?val=hello+world&decoder=string") 37 | if err != nil { 38 | log.Fatal(err) 39 | } 40 | defer v.Close() 41 | 42 | // Now we can use the Variable as normal. 43 | snapshot, err := v.Latest(ctx) 44 | if err != nil { 45 | log.Fatal(err) 46 | } 47 | // It's safe to cast the Value to string since we used the string decoder. 48 | fmt.Printf("%s\n", snapshot.Value.(string)) 49 | 50 | // Output: 51 | // hello world 52 | } 53 | -------------------------------------------------------------------------------- /runtimevar/gcpruntimeconfig/testdata/TestConformance/TestAs/verify_As.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/runtimevar/gcpruntimeconfig/testdata/TestConformance/TestAs/verify_As.replay -------------------------------------------------------------------------------- /runtimevar/gcpruntimeconfig/testdata/TestConformance/TestAs/verify_As_returns_false_when_passed_nil.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/runtimevar/gcpruntimeconfig/testdata/TestConformance/TestAs/verify_As_returns_false_when_passed_nil.replay -------------------------------------------------------------------------------- /runtimevar/gcpruntimeconfig/testdata/TestConformance/TestDelete.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/runtimevar/gcpruntimeconfig/testdata/TestConformance/TestDelete.replay -------------------------------------------------------------------------------- /runtimevar/gcpruntimeconfig/testdata/TestConformance/TestInvalidJSON.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/runtimevar/gcpruntimeconfig/testdata/TestConformance/TestInvalidJSON.replay -------------------------------------------------------------------------------- /runtimevar/gcpruntimeconfig/testdata/TestConformance/TestJSON.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/runtimevar/gcpruntimeconfig/testdata/TestConformance/TestJSON.replay -------------------------------------------------------------------------------- /runtimevar/gcpruntimeconfig/testdata/TestConformance/TestNonExistentVariable.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/runtimevar/gcpruntimeconfig/testdata/TestConformance/TestNonExistentVariable.replay -------------------------------------------------------------------------------- /runtimevar/gcpruntimeconfig/testdata/TestConformance/TestString.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/runtimevar/gcpruntimeconfig/testdata/TestConformance/TestString.replay -------------------------------------------------------------------------------- /runtimevar/gcpruntimeconfig/testdata/TestConformance/TestUpdate.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/runtimevar/gcpruntimeconfig/testdata/TestConformance/TestUpdate.replay -------------------------------------------------------------------------------- /runtimevar/gcpruntimeconfig/testdata/TestConformance/TestUpdateWithErrors.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/runtimevar/gcpruntimeconfig/testdata/TestConformance/TestUpdateWithErrors.replay -------------------------------------------------------------------------------- /runtimevar/gcpsecretmanager/testdata/TestConformance/TestAs/verify_As.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/runtimevar/gcpsecretmanager/testdata/TestConformance/TestAs/verify_As.replay -------------------------------------------------------------------------------- /runtimevar/gcpsecretmanager/testdata/TestConformance/TestAs/verify_As_returns_false_when_passed_nil.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/runtimevar/gcpsecretmanager/testdata/TestConformance/TestAs/verify_As_returns_false_when_passed_nil.replay -------------------------------------------------------------------------------- /runtimevar/gcpsecretmanager/testdata/TestConformance/TestDelete.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/runtimevar/gcpsecretmanager/testdata/TestConformance/TestDelete.replay -------------------------------------------------------------------------------- /runtimevar/gcpsecretmanager/testdata/TestConformance/TestInvalidJSON.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/runtimevar/gcpsecretmanager/testdata/TestConformance/TestInvalidJSON.replay -------------------------------------------------------------------------------- /runtimevar/gcpsecretmanager/testdata/TestConformance/TestJSON.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/runtimevar/gcpsecretmanager/testdata/TestConformance/TestJSON.replay -------------------------------------------------------------------------------- /runtimevar/gcpsecretmanager/testdata/TestConformance/TestNonExistentVariable.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/runtimevar/gcpsecretmanager/testdata/TestConformance/TestNonExistentVariable.replay -------------------------------------------------------------------------------- /runtimevar/gcpsecretmanager/testdata/TestConformance/TestString.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/runtimevar/gcpsecretmanager/testdata/TestConformance/TestString.replay -------------------------------------------------------------------------------- /runtimevar/gcpsecretmanager/testdata/TestConformance/TestUpdate.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/runtimevar/gcpsecretmanager/testdata/TestConformance/TestUpdate.replay -------------------------------------------------------------------------------- /runtimevar/gcpsecretmanager/testdata/TestConformance/TestUpdateWithErrors.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/runtimevar/gcpsecretmanager/testdata/TestConformance/TestUpdateWithErrors.replay -------------------------------------------------------------------------------- /runtimevar/oc_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Cloud Development Kit Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package runtimevar_test 16 | 17 | import ( 18 | "context" 19 | "testing" 20 | 21 | "go.opencensus.io/stats/view" 22 | "gocloud.dev/internal/oc" 23 | "gocloud.dev/internal/testing/octest" 24 | "gocloud.dev/runtimevar" 25 | "gocloud.dev/runtimevar/constantvar" 26 | ) 27 | 28 | func TestOpenCensus(t *testing.T) { 29 | ctx := context.Background() 30 | te := octest.NewTestExporter(runtimevar.OpenCensusViews) 31 | defer te.Unregister() 32 | 33 | v := constantvar.New(1) 34 | defer v.Close() 35 | if _, err := v.Watch(ctx); err != nil { 36 | t.Fatal(err) 37 | } 38 | cctx, cancel := context.WithCancel(ctx) 39 | cancel() 40 | _, _ = v.Watch(cctx) 41 | 42 | seen := false 43 | const driver = "gocloud.dev/runtimevar/constantvar" 44 | for _, row := range te.Counts() { 45 | if _, ok := row.Data.(*view.CountData); !ok { 46 | continue 47 | } 48 | if row.Tags[0].Key == oc.ProviderKey && row.Tags[0].Value == driver { 49 | seen = true 50 | break 51 | } 52 | } 53 | if !seen { 54 | t.Errorf("did not see count row with provider=%s", driver) 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /samples/appengine/.gcloudignore: -------------------------------------------------------------------------------- 1 | # This file specifies files that are *not* uploaded to Google Cloud Platform 2 | # using gcloud. It follows the same syntax as .gitignore, with the addition of 3 | # "#!include" directives (which insert the entries of the given .gitignore-style 4 | # file at that point). 5 | # 6 | # For more information, run: 7 | # $ gcloud topic gcloudignore 8 | # 9 | .gcloudignore 10 | # If you would like to upload your .git directory, .gitignore file or files 11 | # from your .gitignore file, remove the corresponding line 12 | # below: 13 | .git 14 | .gitignore 15 | 16 | # Binaries for programs and plugins 17 | *.exe 18 | *.exe~ 19 | *.dll 20 | *.so 21 | *.dylib 22 | # Test binary, build with `go test -c` 23 | *.test 24 | # Output of the go coverage tool, specifically when used with LiteIDE 25 | *.out -------------------------------------------------------------------------------- /samples/appengine/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=733558 3 | // for the documentation about the tasks.json format 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "label": "Test", 8 | "type": "shell", 9 | "command": "go test ./...", 10 | "group": { 11 | "kind": "test", 12 | "isDefault": true 13 | } 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /samples/appengine/README.md: -------------------------------------------------------------------------------- 1 | # AppEngine Sample 2 | 3 | This directory holds a simple "Hello world!" AppEngine app that uses 4 | [server.Server](https://github.com/google/go-cloud/blob/master/server/server.go). 5 | 6 | ## Prerequisites 7 | 8 | You will need to install the following software to run this sample: 9 | 10 | - [Go](https://golang.org/doc/install) 11 | - [gcloud CLI](https://cloud.google.com/sdk/downloads) 12 | 13 | ## Deploying 14 | 15 | Run the following in this `samples/appengine` directory: 16 | 17 | ```shell 18 | # Build the binary. 19 | go build 20 | # Deploy it to AppEngine. 21 | gcloud app deploy 22 | # Open a browser to the app. 23 | gcloud app browse 24 | ``` 25 | 26 | Try browsing to the `/healthz/readiness` page that `server.Server` adds a 27 | handler for. 28 | -------------------------------------------------------------------------------- /samples/appengine/app.yaml: -------------------------------------------------------------------------------- 1 | runtime: go111 2 | -------------------------------------------------------------------------------- /samples/appengine/helloworld.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Cloud Development Kit Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // A simple "hello world" application using server.Server, to be run on 16 | // Google App Engine (GAE). 17 | package main 18 | 19 | import ( 20 | "fmt" 21 | "log" 22 | "net/http" 23 | "os" 24 | 25 | "github.com/gorilla/mux" 26 | "gocloud.dev/server" 27 | ) 28 | 29 | func main() { 30 | r := mux.NewRouter() 31 | r.HandleFunc("/", handle) 32 | 33 | port := os.Getenv("PORT") 34 | if port == "" { 35 | port = "8080" 36 | } 37 | srv := server.New(r, nil) 38 | log.Printf("Listening on port %s", port) 39 | log.Fatal(srv.ListenAndServe(fmt.Sprintf(":%s", port))) 40 | } 41 | 42 | func handle(w http.ResponseWriter, r *http.Request) { 43 | if r.URL.Path != "/" { 44 | http.NotFound(w, r) 45 | return 46 | } 47 | fmt.Fprint(w, "Hello world!") 48 | } 49 | -------------------------------------------------------------------------------- /samples/gocdk-blob/blob.ct: -------------------------------------------------------------------------------- 1 | # Copyright 2019 The Go Cloud Development Kit Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Tests of the gocdk-blob program. 16 | 17 | # ROOTDIR_URL is a platform-specific environment variable set 18 | # in main_test.go. 19 | 20 | # Create a subdirectory so we can use fileblob. 21 | $ mkdir bucket 22 | 23 | # List an empty bucket: valid, but no output. 24 | $ gocdk-blob ls ${ROOTDIR_URL}/bucket 25 | 26 | $ fecho hello.txt hello world 27 | $ gocdk-blob upload ${ROOTDIR_URL}/bucket hw < hello.txt 28 | 29 | $ gocdk-blob ls ${ROOTDIR_URL}/bucket 30 | hw 31 | 32 | $ gocdk-blob download ${ROOTDIR_URL}/bucket hw 33 | hello world 34 | 35 | # Error downloading a bucket that doesn't exist. 36 | # For now we can't use this test case, because the output won't be the same across operating systems. 37 | #$ gocdk-blob download ${ROOTDIR_URL}/bucket noexist --> FAIL 38 | #gocdk-blob: Failed to read "noexist": blob (code=NotFound): stat ${SLASHDIR}/bucket/noexist: no such file or directory 39 | 40 | -------------------------------------------------------------------------------- /samples/gocdk-blob/main_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Cloud Development Kit Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package main 16 | 17 | import ( 18 | "flag" 19 | "os" 20 | "path/filepath" 21 | "strings" 22 | "testing" 23 | 24 | "github.com/google/go-cmdtest" 25 | ) 26 | 27 | var update = flag.Bool("update", false, "replace test file contents with output") 28 | 29 | func Test(t *testing.T) { 30 | ts, err := cmdtest.Read(".") 31 | if err != nil { 32 | t.Fatal(err) 33 | } 34 | ts.Commands["gocdk-blob"] = cmdtest.InProcessProgram("gocdk-blob", run) 35 | ts.Setup = func(rootdir string) error { 36 | // On Windows, convert "\" to "/" and add a leading "/": 37 | slashdir := filepath.ToSlash(rootdir) 38 | if os.PathSeparator != '/' && !strings.HasPrefix(slashdir, "/") { 39 | slashdir = "/" + slashdir 40 | } 41 | return os.Setenv("ROOTDIR_URL", "file://"+slashdir) 42 | } 43 | ts.Run(t, *update) 44 | } 45 | -------------------------------------------------------------------------------- /samples/gocdk-docstore/docstore.ct: -------------------------------------------------------------------------------- 1 | # Copyright 2019 The Go Cloud Development Kit Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Tests of the gocdk-doctore program. 16 | 17 | $ setenv url mem://sample-coll/ID?filename=save 18 | 19 | # Collection is initially empty. 20 | $ gocdk-docstore ls ${url} 21 | 22 | $ gocdk-docstore put -d 2019-05-01 -id first ${url} message1 23 | Put message: first 2019-05-01: message1 24 | 25 | $ gocdk-docstore ls -d 2019-05-01 ${url} 26 | first 2019-05-01: message1 27 | 28 | $ gocdk-docstore put -d 2019-05-02 -id second ${url} message2 29 | $ gocdk-docstore ls -d 2019-05-02 ${url} 30 | Put message: second 2019-05-02: message2 31 | second 2019-05-02: message2 32 | 33 | $ gocdk-docstore update first ${url} new-message 34 | updated: first 2019-05-01: new-message 35 | 36 | 37 | # Delete everything. 38 | $ gocdk-docstore delete ${url} 39 | 40 | # Collection is empty again. 41 | $ gocdk-docstore ls ${url} 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /samples/gocdk-docstore/main_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Cloud Development Kit Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package main 16 | 17 | import ( 18 | "flag" 19 | "testing" 20 | 21 | "github.com/google/go-cmdtest" 22 | ) 23 | 24 | var update = flag.Bool("update", false, "replace test file contents with output") 25 | 26 | func Test(t *testing.T) { 27 | ts, err := cmdtest.Read(".") 28 | if err != nil { 29 | t.Fatal(err) 30 | } 31 | ts.Commands["gocdk-docstore"] = cmdtest.InProcessProgram("gocdk-docstore", run) 32 | ts.Run(t, *update) 33 | } 34 | -------------------------------------------------------------------------------- /samples/gocdk-pubsub/pubsub.ct: -------------------------------------------------------------------------------- 1 | # Copyright 2019 The Go Cloud Development Kit Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Tests of the gocdk-pubsub program. 16 | 17 | 18 | $ fecho msg this is the message 19 | 20 | $ gocdk-pubsub pub rabbit://sample-topic < msg 21 | Enter messages, one per line, to be published to "rabbit://sample-topic". 22 | 23 | $ gocdk-pubsub sub -n 1 rabbit://sample-subscription 24 | Receiving messages from "rabbit://sample-subscription"... 25 | this is the message 26 | 27 | -------------------------------------------------------------------------------- /samples/gocdk-runtimevar/main_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Cloud Development Kit Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package main 16 | 17 | import ( 18 | "context" 19 | "flag" 20 | "testing" 21 | 22 | "github.com/google/go-cmdtest" 23 | ) 24 | 25 | var update = flag.Bool("update", false, "replace test file contents with output") 26 | 27 | func Test(t *testing.T) { 28 | ts, err := cmdtest.Read(".") 29 | if err != nil { 30 | t.Fatal(err) 31 | } 32 | 33 | type result struct { 34 | out []byte 35 | err error 36 | } 37 | 38 | ctx := context.Background() 39 | 40 | runtimevar := cmdtest.InProcessProgram("gocdk-runtimevar", func() int { 41 | return run(ctx) 42 | }) 43 | ts.Commands["gocdk-runtimevar"] = runtimevar 44 | ts.Run(t, *update) 45 | } 46 | -------------------------------------------------------------------------------- /samples/gocdk-runtimevar/runtimevar.ct: -------------------------------------------------------------------------------- 1 | # Copyright 2019 The Go Cloud Development Kit Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Tests of the gocdk-runtimevar program. 16 | 17 | $ gocdk-runtimevar cat constant://?val=foo&decoder=string 18 | (string) foo 19 | 20 | $ fecho fvar contents 21 | 22 | $ gocdk-runtimevar cat file:///${ROOTDIR}/fvar?decoder=string 23 | (string) contents 24 | -------------------------------------------------------------------------------- /samples/gocdk-secrets/main_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Cloud Development Kit Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package main 16 | 17 | import ( 18 | "flag" 19 | "testing" 20 | 21 | "github.com/google/go-cmdtest" 22 | ) 23 | 24 | var update = flag.Bool("update", false, "replace test file contents with output") 25 | 26 | func Test(t *testing.T) { 27 | ts, err := cmdtest.Read(".") 28 | if err != nil { 29 | t.Fatal(err) 30 | } 31 | ts.Commands["gocdk-secrets"] = cmdtest.InProcessProgram("gocdk-secrets", run) 32 | ts.Run(t, *update) 33 | } 34 | -------------------------------------------------------------------------------- /samples/gocdk-secrets/secrets.ct: -------------------------------------------------------------------------------- 1 | # Copyright 2019 The Go Cloud Development Kit Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Tests of the gocdk-secrets program. 16 | 17 | # We can't test encrypt because its output is nondeterministic. 18 | 19 | $ gocdk-secrets decrypt -base64in base64key://smGbjm71Nxd1Ig5FS0wj9SlbzAIrnolCz9bQQ6uAhl4= vnO4Lab8WxdGAklhKUAm+OkmM4mD4aRe9+Uo3iU/sBKMsf2txirq3Gg/MIYaOCRQLw== 20 | my-secret 21 | 22 | 23 | -------------------------------------------------------------------------------- /samples/guestbook/README.md: -------------------------------------------------------------------------------- 1 | # Guestbook Sample 2 | 3 | Guestbook is a sample application that records visitors' messages, displays a 4 | cloud banner, and an administrative message. The main business logic is written 5 | in a cloud-agnostic manner using MySQL, the generic blob API, and the generic 6 | runtimevar API. All platform-specific code is set up by 7 | [Wire](https://github.com/google/wire). 8 | 9 | The [online tutorial](https://gocloud.dev/tutorials/guestbook) will walk you through how to build, run, and deploy this sample locally, on Google Cloud Platform (GCP), on Amazon Web Servicess (AWS), or on Microsoft Azure. 10 | 11 | ## Gophers 12 | 13 | The Go gopher was designed by Renee French and used under the 14 | [Creative Commons 3.0 Attributions](https://creativecommons.org/licenses/by/3.0/) 15 | license. 16 | -------------------------------------------------------------------------------- /samples/guestbook/aws/outputs.tf: -------------------------------------------------------------------------------- 1 | # Copyright 2018 The Go Cloud Development Kit Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | output "region" { 16 | value = var.region 17 | description = "Region the resources were created in." 18 | } 19 | 20 | output "bucket" { 21 | value = aws_s3_bucket.guestbook.id 22 | description = "Name of the S3 bucket created to store images." 23 | } 24 | 25 | output "database_host" { 26 | value = aws_db_instance.guestbook.address 27 | description = "Host name of the RDS MySQL database." 28 | } 29 | 30 | output "database_root_password" { 31 | value = random_string.db_password.result 32 | sensitive = true 33 | description = "Password for the root user of the RDS MySQL databse." 34 | } 35 | 36 | output "paramstore_var" { 37 | value = var.paramstore_var 38 | description = "Location of the SSM Parameter Store Message of the Day variable." 39 | } 40 | 41 | output "instance_host" { 42 | value = aws_instance.guestbook.public_ip 43 | description = "Address of the EC2 instance." 44 | } 45 | 46 | -------------------------------------------------------------------------------- /samples/guestbook/aws/variables.tf: -------------------------------------------------------------------------------- 1 | # Copyright 2018 The Go Cloud Development Kit Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | variable "region" { 16 | type = string 17 | description = "Region to create resources in. See https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html for valid values." 18 | } 19 | 20 | variable "ssh_public_key" { 21 | type = string 22 | description = "A public key line in .ssh/authorized_keys format to use to authenticate to your instance. This must be added to your SSH agent for provisioning to succeed." 23 | } 24 | 25 | variable "paramstore_var" { 26 | default = "/guestbook/motd" 27 | description = "The location in SSM Parameter Store of the Message of the Day variable." 28 | } 29 | 30 | -------------------------------------------------------------------------------- /samples/guestbook/azure/outputs.tf: -------------------------------------------------------------------------------- 1 | # Copyright 2019 The Go Cloud Development Kit Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | output "storage_account" { 16 | value = azurerm_storage_account.guestbook.name 17 | description = "Name of the Storage Account created to store images." 18 | } 19 | 20 | output "storage_container" { 21 | value = azurerm_storage_container.guestbook.name 22 | description = "Name of the storage container created to store images." 23 | } 24 | 25 | output "access_key" { 26 | value = azurerm_storage_account.guestbook.primary_access_key 27 | description = "The primary access key for the Storage Account." 28 | } 29 | 30 | -------------------------------------------------------------------------------- /samples/guestbook/azure/variables.tf: -------------------------------------------------------------------------------- 1 | # Copyright 2019 The Go Cloud Development Kit Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | variable "location" { 16 | type = string 17 | description = "Location to create resources in. See https://azure.microsoft.com/en-us/global-infrastructure/locations/ for valid values." 18 | } 19 | 20 | -------------------------------------------------------------------------------- /samples/guestbook/blobs/aws.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/samples/guestbook/blobs/aws.png -------------------------------------------------------------------------------- /samples/guestbook/blobs/azure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/samples/guestbook/blobs/azure.png -------------------------------------------------------------------------------- /samples/guestbook/blobs/gcp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/samples/guestbook/blobs/gcp.png -------------------------------------------------------------------------------- /samples/guestbook/blobs/gophers.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/samples/guestbook/blobs/gophers.jpg -------------------------------------------------------------------------------- /samples/guestbook/blobs/motd.txt: -------------------------------------------------------------------------------- 1 | Message of the Day Is: Hello World! 2 | -------------------------------------------------------------------------------- /samples/guestbook/gcp/.gcloudignore: -------------------------------------------------------------------------------- 1 | *.tf 2 | *.tfstate 3 | *.tfstate.backup 4 | .terraform/ 5 | terraform.tfvars 6 | *.pem 7 | *.json 8 | -------------------------------------------------------------------------------- /samples/guestbook/gcp/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM gcr.io/distroless/base 2 | COPY guestbook / 3 | ENTRYPOINT ["/guestbook"] 4 | -------------------------------------------------------------------------------- /samples/guestbook/gcp/guestbook.yaml.in: -------------------------------------------------------------------------------- 1 | apiVersion: extensions/v1beta1 2 | kind: Deployment 3 | metadata: 4 | name: guestbook 5 | labels: 6 | app: guestbook 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: guestbook 12 | strategy: 13 | type: RollingUpdate 14 | rollingUpdate: 15 | maxSurge: 1 16 | maxUnavailable: 1 17 | template: 18 | metadata: 19 | labels: 20 | app: guestbook 21 | spec: 22 | volumes: 23 | - name: google-cloud-key 24 | secret: 25 | secretName: guestbook-key 26 | containers: 27 | - name: guestbook 28 | image: {{IMAGE}} 29 | args: 30 | - "-env=gcp" 31 | - "-bucket={{bucket}}" 32 | - "-db_host={{database_instance}}" 33 | - "-cloud_sql_region={{database_region}}" 34 | - "-runtime_config={{motd_var_config}}" 35 | - "-motd_var={{motd_var_name}}" 36 | imagePullPolicy: Always 37 | ports: 38 | - containerPort: 8080 39 | protocol: TCP 40 | volumeMounts: 41 | - name: google-cloud-key 42 | mountPath: /var/secrets/google 43 | env: 44 | - name: GOOGLE_APPLICATION_CREDENTIALS 45 | value: /var/secrets/google/key.json 46 | livenessProbe: 47 | httpGet: 48 | path: /healthz/liveness 49 | port: 8080 50 | readinessProbe: 51 | httpGet: 52 | path: /healthz/readiness 53 | port: 8080 54 | --- 55 | apiVersion: v1 56 | kind: Service 57 | metadata: 58 | name: guestbook 59 | labels: 60 | app: guestbook 61 | spec: 62 | type: LoadBalancer 63 | selector: 64 | app: guestbook 65 | ports: 66 | - port: 8080 67 | protocol: TCP 68 | targetPort: 8080 69 | -------------------------------------------------------------------------------- /samples/guestbook/gcp/variables.tf: -------------------------------------------------------------------------------- 1 | # Copyright 2018 The Go Cloud Development Kit Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | variable "project" { 16 | type = string 17 | description = "Project to set up." 18 | } 19 | 20 | variable "region" { 21 | type = string 22 | description = "GCP region to create database and storage in, for example 'us-central1'. See https://cloud.google.com/compute/docs/regions-zones/ for valid values." 23 | } 24 | 25 | variable "zone" { 26 | type = string 27 | description = "GCP zone to create the GKE cluster in, for example 'us-central1-a'. See https://cloud.google.com/compute/docs/regions-zones/ for valid values." 28 | } 29 | 30 | variable "server_service_account_name" { 31 | default = "guestbook" 32 | description = "The username part of the service account email that will be used for the server running inside the GKE cluster." 33 | } 34 | 35 | variable "db_access_service_account_name" { 36 | default = "guestbook-db" 37 | description = "The username part of the service account email that will be used for provisioning the database." 38 | } 39 | 40 | variable "cluster_name" { 41 | default = "guestbook-cluster" 42 | description = "The GKE cluster name." 43 | } 44 | 45 | -------------------------------------------------------------------------------- /samples/guestbook/roles.sql: -------------------------------------------------------------------------------- 1 | -- Copyright 2018 The Go Cloud Development Kit Authors 2 | -- 3 | -- Licensed under the Apache License, Version 2.0 (the "License"); 4 | -- you may not use this file except in compliance with the License. 5 | -- You may obtain a copy of the License at 6 | -- 7 | -- https://www.apache.org/licenses/LICENSE-2.0 8 | -- 9 | -- Unless required by applicable law or agreed to in writing, software 10 | -- distributed under the License is distributed on an "AS IS" BASIS, 11 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | -- See the License for the specific language governing permissions and 13 | -- limitations under the License. 14 | 15 | CREATE USER 'guestbook'@'%' IDENTIFIED BY 'xyzzy'; 16 | GRANT SELECT,INSERT,UPDATE,DELETE ON guestbook.* TO 'guestbook'@'%'; 17 | -------------------------------------------------------------------------------- /samples/guestbook/schema.sql: -------------------------------------------------------------------------------- 1 | -- Copyright 2018 The Go Cloud Development Kit Authors 2 | -- 3 | -- Licensed under the Apache License, Version 2.0 (the "License"); 4 | -- you may not use this file except in compliance with the License. 5 | -- You may obtain a copy of the License at 6 | -- 7 | -- https://www.apache.org/licenses/LICENSE-2.0 8 | -- 9 | -- Unless required by applicable law or agreed to in writing, software 10 | -- distributed under the License is distributed on an "AS IS" BASIS, 11 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | -- See the License for the specific language governing permissions and 13 | -- limitations under the License. 14 | 15 | CREATE TABLE greetings ( 16 | content VARCHAR(255) CHARACTER SET utf8 17 | NOT NULL 18 | CHECK (content <> ''), 19 | post_date DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP 20 | ); 21 | -------------------------------------------------------------------------------- /samples/order/common.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Cloud Development Kit Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package main 16 | 17 | import ( 18 | "time" 19 | ) 20 | 21 | // Order represents an order for a single image operation. 22 | type Order struct { 23 | ID string // unique ID, randomly generated 24 | Email string // email address of customer 25 | InImage string // name of input image 26 | OutImage string // name of output image; empty if there was an error 27 | CreateTime time.Time // time the order was created 28 | FinishTime time.Time // time the order was finished 29 | Note string // note to the customer from the processor, describing success or error 30 | DocstoreRevision any 31 | } 32 | 33 | // OrderRequest is a request for an order. It is the contents of the messages 34 | // sent to the requests topic. 35 | type OrderRequest struct { 36 | ID string 37 | Email string 38 | InImage string 39 | CreateTime time.Time 40 | } 41 | -------------------------------------------------------------------------------- /samples/order/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Go CDK Image Conversion Sample 6 | 7 | 8 | 9 | 10 | 13 |
    14 |
    15 | 16 | 17 |
    18 |
    19 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /samples/order/order-form.htmlt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Create Order - Go CDK Image Conversion Sample 6 | 7 | 8 | 9 | 10 | 13 |
    14 |

    Submit an Image

    15 |
    16 | 19 |
    20 | 21 |
    22 | 25 |
    26 | 27 |
    28 |
    29 | 30 |
    31 |
    32 |
    33 | 34 | 35 | -------------------------------------------------------------------------------- /samples/order/testdata/bad-image: -------------------------------------------------------------------------------- 1 | This is not an image. 2 | -------------------------------------------------------------------------------- /samples/order/testdata/cat1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/samples/order/testdata/cat1 -------------------------------------------------------------------------------- /samples/tutorial/README.md: -------------------------------------------------------------------------------- 1 | # Getting Started With The Go Cloud Development Kit 2 | 3 | This is the source directory for the [command-line uploader tutorial][]. 4 | 5 | [command-line uploader tutorial]: https://gocloud.dev/tutorials/cli-uploader/ 6 | -------------------------------------------------------------------------------- /samples/tutorial/gopher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/samples/tutorial/gopher.png -------------------------------------------------------------------------------- /samples/tutorial/main.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Cloud Development Kit Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Command upload saves files to blob storage on GCP, AWS, and Azure. 16 | package main 17 | 18 | import ( 19 | "context" 20 | "log" 21 | "os" 22 | 23 | "gocloud.dev/blob" 24 | 25 | // Import the blob packages we want to be able to open. 26 | _ "gocloud.dev/blob/azureblob" 27 | _ "gocloud.dev/blob/gcsblob" 28 | _ "gocloud.dev/blob/s3blob" 29 | ) 30 | 31 | func main() { 32 | // Define our input. 33 | if len(os.Args) != 3 { 34 | log.Fatal("usage: upload BUCKET_URL FILE") 35 | } 36 | bucketURL := os.Args[1] 37 | file := os.Args[2] 38 | 39 | ctx := context.Background() 40 | // Open a connection to the bucket. 41 | b, err := blob.OpenBucket(ctx, bucketURL) 42 | if err != nil { 43 | log.Fatalf("Failed to setup bucket: %s", err) 44 | } 45 | defer b.Close() 46 | 47 | // Prepare the file for upload. 48 | data, err := os.ReadFile(file) 49 | if err != nil { 50 | log.Fatalf("Failed to read file: %s", err) 51 | } 52 | 53 | w, err := b.NewWriter(ctx, file, nil) 54 | if err != nil { 55 | log.Fatalf("Failed to obtain writer: %s", err) 56 | } 57 | _, err = w.Write(data) 58 | if err != nil { 59 | log.Fatalf("Failed to write to bucket: %s", err) 60 | } 61 | if err = w.Close(); err != nil { 62 | log.Fatalf("Failed to close: %s", err) 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /samples/wire/README.md: -------------------------------------------------------------------------------- 1 | # Wire Tutorial has moved 2 | 3 | The Wire Tutorial has moved to [the Wire repository](https://github.com/google/wire/tree/master/_tutorial). 4 | -------------------------------------------------------------------------------- /secrets/gcpkms/testdata/TestConformance/TestAs/verify_As_function.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/secrets/gcpkms/testdata/TestConformance/TestAs/verify_As_function.replay -------------------------------------------------------------------------------- /secrets/gcpkms/testdata/TestConformance/TestAs/verify_As_returns_false_when_passed_nil.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/secrets/gcpkms/testdata/TestConformance/TestAs/verify_As_returns_false_when_passed_nil.replay -------------------------------------------------------------------------------- /secrets/gcpkms/testdata/TestConformance/TestDecryptMalformedError.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/secrets/gcpkms/testdata/TestConformance/TestDecryptMalformedError.replay -------------------------------------------------------------------------------- /secrets/gcpkms/testdata/TestConformance/TestEncryptDecrypt.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/secrets/gcpkms/testdata/TestConformance/TestEncryptDecrypt.replay -------------------------------------------------------------------------------- /secrets/gcpkms/testdata/TestConformance/TestMultipleEncryptionsNotEqual.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/secrets/gcpkms/testdata/TestConformance/TestMultipleEncryptionsNotEqual.replay -------------------------------------------------------------------------------- /secrets/gcpkms/testdata/TestConformance/TestMultipleKeys.replay: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/go-cloud/6b8775db152a20e482f227e1aeb3aa8cbbf37618/secrets/gcpkms/testdata/TestConformance/TestMultipleKeys.replay -------------------------------------------------------------------------------- /secrets/hashivault/localvault.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2019 The Go Cloud Development Kit Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # Starts a local Vault instance via Docker. 17 | 18 | # https://coderwall.com/p/fkfaqq/safer-bash-scripts-with-set-euxo-pipefail 19 | set -euo pipefail 20 | 21 | echo "Starting Vault Server..." 22 | docker rm -f dev-vault &> /dev/null || : 23 | docker run --cap-add=IPC_LOCK -d --name=dev-vault -e 'VAULT_DEV_ROOT_TOKEN_ID=faketoken' -p 8200:8200 vault:1.6.0 &> /dev/null 24 | echo "...done. Run \"docker rm -f dev-vault\" to clean up the container." 25 | echo 26 | 27 | -------------------------------------------------------------------------------- /wire/README.md: -------------------------------------------------------------------------------- 1 | # Wire has moved! 2 | 3 | Wire has moved to its own repository: [github.com/google/wire](https://github.com/google/wire) 4 | 5 | Read the [announcement][] for more details. 6 | 7 | [announcement]: https://groups.google.com/d/msg/go-cloud/4HuWfjDAkOY/Y2tUQdB_BQAJ 8 | --------------------------------------------------------------------------------