{"id":18533192,"url":"https://github.com/googleapis/google-cloudevents-go","last_synced_at":"2025-07-26T23:33:43.811Z","repository":{"id":38213525,"uuid":"273051133","full_name":"googleapis/google-cloudevents-go","owner":"googleapis","description":"CloudEvent Types for Go","archived":false,"fork":false,"pushed_at":"2025-06-27T20:22:06.000Z","size":4875,"stargazers_count":27,"open_issues_count":15,"forks_count":7,"subscribers_count":44,"default_branch":"main","last_synced_at":"2025-06-27T21:18:58.883Z","etag":null,"topics":["eventarc","golang","preview","type-definitions"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/googleapis.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-06-17T18:33:44.000Z","updated_at":"2025-06-27T20:22:00.000Z","dependencies_parsed_at":"2023-02-18T21:45:21.575Z","dependency_job_id":"829ef047-ffa1-4d6e-9acd-5ba674cf4b94","html_url":"https://github.com/googleapis/google-cloudevents-go","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/googleapis/google-cloudevents-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleapis%2Fgoogle-cloudevents-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleapis%2Fgoogle-cloudevents-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleapis%2Fgoogle-cloudevents-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleapis%2Fgoogle-cloudevents-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/googleapis","download_url":"https://codeload.github.com/googleapis/google-cloudevents-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleapis%2Fgoogle-cloudevents-go/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267264973,"owners_count":24061462,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-26T02:00:08.937Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["eventarc","golang","preview","type-definitions"],"created_at":"2024-11-06T19:10:01.001Z","updated_at":"2025-07-26T23:33:43.675Z","avatar_url":"https://github.com/googleapis.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Google CloudEvents - Go\n\n[![GoDoc](https://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](https://pkg.go.dev/mod/github.com/googleapis/google-cloudevents-go) [![Preview](https://img.shields.io/badge/stability-preview-orange?style=flat-square)](https://cloud.google.com/products#section-22)\n\nThis library provides Go types for Google CloudEvent data.\n\n## Features\n\n- Simple import and interface\n- Inline documentation for Go structs\n- Automatic decoding of base64 data\n- Enum support\n- Protobuf bindings\n\n## Installation\n\nTo install this package, run:\n\n``` sh\ngo get -u github.com/googleapis/google-cloudevents-go\n```\n\nThis library requires Go 1.17+ and is tested with Go 1.19.\n\n## Usage\n\nUnmarshal a CloudEvent data payload from raw bytes.\n\n\u003c!-- Copied from examples/example_storage_test.go --\u003e\n```golang\npackage examples\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"time\"\n\n\t\"github.com/googleapis/google-cloudevents-go/cloud/storagedata\"\n\t\"google.golang.org/protobuf/encoding/protojson\"\n)\n\n// cloudEventPayload is initialized with an example CloudEvent data payload.\n// Source: github.com/googleapis/google-cloudevents/tree/main/examples/binary/storage/StorageObjectData-simple.json\nvar cloudEventPayload = []byte(`\n{\n\t\"bucket\": \"sample-bucket\",\n\t\"contentType\": \"text/plain\",\n\t\"crc32c\": \"rTVTeQ==\",\n\t\"etag\": \"CNHZkbuF/ugCEAE=\",\n\t\"generation\": \"1587627537231057\",\n\t\"id\": \"sample-bucket/folder/Test.cs/1587627537231057\",\n\t\"kind\": \"storage#object\",\n\t\"md5Hash\": \"kF8MuJ5+CTJxvyhHS1xzRg==\",\n\t\"mediaLink\": \"https://www.googleapis.com/download/storage/v1/b/sample-bucket/o/folder%2FTest.cs?generation=1587627537231057\\u0026alt=media\",\n\t\"metageneration\": \"1\",\n\t\"name\": \"folder/Test.cs\",\n\t\"selfLink\": \"https://www.googleapis.com/storage/v1/b/sample-bucket/o/folder/Test.cs\",\n\t\"size\": \"352\",\n\t\"storageClass\": \"MULTI_REGIONAL\",\n\t\"timeCreated\": \"2020-04-23T07:38:57.230Z\",\n\t\"timeStorageClassUpdated\": \"2020-04-23T07:38:57.230Z\",\n\t\"updated\": \"2020-04-23T07:38:57.230Z\"\n}`)\n\nfunc Example() {\n\tdata := storagedata.StorageObjectData{}\n\n\t// If you omit `DiscardUnknown`, protojson.Unmarshal returns an error\n\t// when encountering a new or unknown field.\n\toptions := protojson.UnmarshalOptions{\n\t\tDiscardUnknown: true,\n\t}\n\tif err := options.Unmarshal(cloudEventPayload, \u0026data); err != nil {\n\t\tlog.Fatal(\"protojson.Unmarshal: \", err)\n\t}\n\n\tupdated := data.Updated.AsTime().Format(time.UnixDate)\n\tfmt.Printf(\"Bucket: %s, Object: %s, Updated: %s\", data.Bucket, data.Name, updated)\n\n\t// Output: Bucket: sample-bucket, Object: folder/Test.cs, Updated: Thu Apr 23 07:38:57 UTC 2020\n}\n```\n\n## Contributing\n\nContributions to this library are always welcome and highly encouraged.\n\nSee [CONTRIBUTING](./CONTRIBUTING.md) for more information how to get started.\n\nPlease note that this project is released with a Contributor Code of Conduct.\nBy participating in this project you agree to abide by its terms.\nSee Code of Conduct for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogleapis%2Fgoogle-cloudevents-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogleapis%2Fgoogle-cloudevents-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogleapis%2Fgoogle-cloudevents-go/lists"}