{"id":23219470,"url":"https://github.com/vallahaye/protobson","last_synced_at":"2025-08-19T10:31:06.401Z","repository":{"id":36972262,"uuid":"474177087","full_name":"vallahaye/protobson","owner":"vallahaye","description":"BSON codecs for Google's protocol buffers","archived":false,"fork":false,"pushed_at":"2024-10-12T10:53:06.000Z","size":68,"stargazers_count":16,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-13T22:48:45.591Z","etag":null,"topics":["go","golang","mongodb","protobuf","protocol-buffers"],"latest_commit_sha":null,"homepage":"https://go.vallahaye.net/protobson","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vallahaye.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-25T22:09:38.000Z","updated_at":"2024-10-12T10:50:08.000Z","dependencies_parsed_at":"2024-03-17T21:43:23.458Z","dependency_job_id":"1a29522b-7827-426c-91d0-e77583fba80c","html_url":"https://github.com/vallahaye/protobson","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vallahaye%2Fprotobson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vallahaye%2Fprotobson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vallahaye%2Fprotobson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vallahaye%2Fprotobson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vallahaye","download_url":"https://codeload.github.com/vallahaye/protobson/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230344000,"owners_count":18211805,"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","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":["go","golang","mongodb","protobuf","protocol-buffers"],"created_at":"2024-12-18T21:34:17.886Z","updated_at":"2024-12-18T21:34:18.889Z","avatar_url":"https://github.com/vallahaye.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# protobson\n\n[![PkgGoDev](https://pkg.go.dev/badge/go.vallahaye.net/protobson)](https://pkg.go.dev/go.vallahaye.net/protobson) ![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/vallahaye/protobson) [![GoReportCard](https://goreportcard.com/badge/github.com/vallahaye/protobson)](https://goreportcard.com/badge/github.com/vallahaye/protobson) ![GitHub](https://img.shields.io/github/license/vallahaye/protobson)\n\nBSON codecs for Google's protocol buffers.\n\nThis library provides add-ons to [go.mongodb.org/mongo-driver](https://pkg.go.dev/go.mongodb.org/mongo-driver) for first-class protobuf support with similar API design, extensive testing and [high reuse of already existing codecs](https://github.com/vallahaye/protobson/blob/main/protobsoncodec/message_codec.go). The following types are currently mapped:\n\n| Protobuf  | MongoDB    |\n|-----------|------------|\n| [`message`](https://pkg.go.dev/google.golang.org/protobuf/proto#Message) | [Document](https://www.mongodb.com/docs/manual/core/document/) |\n| [`google.protobuf.Timestamp`](https://pkg.go.dev/google.golang.org/protobuf/types/known/timestamppb#Timestamp) | [Date](https://www.mongodb.com/docs/manual/reference/bson-types/#date) |\n| [`google.protobuf.Duration`](https://pkg.go.dev/google.golang.org/protobuf/types/known/durationpb#Duration) | [64-bit integer](https://www.mongodb.com/docs/manual/reference/bson-types/#bson-types) |\n| [`google.protobuf.BoolValue`](https://pkg.go.dev/google.golang.org/protobuf/types/known/wrapperspb#BoolValue) | [Boolean](https://www.mongodb.com/docs/manual/reference/bson-types/#bson-types) |\n| [`google.protobuf.BytesValue`](https://pkg.go.dev/google.golang.org/protobuf/types/known/wrapperspb#BytesValue) | [Binary](https://www.mongodb.com/docs/manual/reference/bson-types/#bson-types) |\n| [`google.protobuf.DoubleValue`](https://pkg.go.dev/google.golang.org/protobuf/types/known/wrapperspb#DoubleValue) | [Double](https://www.mongodb.com/docs/manual/reference/bson-types/#bson-types) |\n| [`google.protobuf.FloatValue`](https://pkg.go.dev/google.golang.org/protobuf/types/known/wrapperspb#FloatValue) | [Double](https://www.mongodb.com/docs/manual/reference/bson-types/#bson-types) |\n| [`google.protobuf.Int32Value`](https://pkg.go.dev/google.golang.org/protobuf/types/known/wrapperspb#Int32Value) | [32-bit integer](https://www.mongodb.com/docs/manual/reference/bson-types/#bson-types) |\n| [`google.protobuf.Int64Value`](https://pkg.go.dev/google.golang.org/protobuf/types/known/wrapperspb#Int64Value) | [64-bit integer](https://www.mongodb.com/docs/manual/reference/bson-types/#bson-types) |\n| [`google.protobuf.StringValue`](https://pkg.go.dev/google.golang.org/protobuf/types/known/wrapperspb#StringValue) | [String](https://www.mongodb.com/docs/manual/reference/bson-types/#bson-types) |\n| [`google.protobuf.UInt32Value`](https://pkg.go.dev/google.golang.org/protobuf/types/known/wrapperspb#UInt32Value) | [32-bit integer](https://www.mongodb.com/docs/manual/reference/bson-types/#bson-types) |\n| [`google.protobuf.UInt64Value`](https://pkg.go.dev/google.golang.org/protobuf/types/known/wrapperspb#UInt64Value) | [64-bit integer](https://www.mongodb.com/docs/manual/reference/bson-types/#bson-types) |\n| [`google.type.DateTime`](https://pkg.go.dev/google.golang.org/genproto/googleapis/type/datetime#DateTime) | [Date](https://www.mongodb.com/docs/manual/reference/bson-types/#date) |\n\nThis list will grow as we add support for most [Well-Known Types](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf) as well as [Google APIs Common Types](https://github.com/googleapis/api-common-protos).\n\n## Usage\n\n```\n$ go get go.vallahaye.net/protobson\n```\n\n```go\n// Set client options\nclientOptions := options.Client().\n  SetRegistry(protobson.DefaultRegistry).\n  ApplyURI(\"mongodb://localhost:27017\")\n\n// Connect to MongoDB\nclient, err := mongo.Connect(context.TODO(), clientOptions)\nif err != nil {\n  log.Fatal(err)\n}\n\n// Check the connection\nerr = client.Ping(context.TODO(), nil)\nif err != nil {\n  log.Fatal(err)\n}\n\nfmt.Println(\"Connected to MongoDB!\")\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvallahaye%2Fprotobson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvallahaye%2Fprotobson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvallahaye%2Fprotobson/lists"}